Search in sources :

Example 1 with RecursiveFunctionObject

use of com.gargoylesoftware.htmlunit.javascript.RecursiveFunctionObject in project htmlunit by HtmlUnit.

the class Intl method define.

private void define(final Class<? extends HtmlUnitScriptable> c, final BrowserVersion browserVersion) {
    try {
        final ClassConfiguration config = AbstractJavaScriptConfiguration.getClassConfiguration(c, browserVersion);
        final HtmlUnitScriptable prototype = JavaScriptEngine.configureClass(config, this, browserVersion);
        final FunctionObject functionObject = new RecursiveFunctionObject(c.getSimpleName(), config.getJsConstructor(), this);
        if (c == V8BreakIterator.class) {
            prototype.setClassName("v8BreakIterator");
        }
        functionObject.addAsConstructor(this, prototype);
    } catch (final Exception e) {
        throw Context.throwAsScriptRuntimeEx(e);
    }
}
Also used : HtmlUnitScriptable(com.gargoylesoftware.htmlunit.javascript.HtmlUnitScriptable) RecursiveFunctionObject(com.gargoylesoftware.htmlunit.javascript.RecursiveFunctionObject) FunctionObject(net.sourceforge.htmlunit.corejs.javascript.FunctionObject) RecursiveFunctionObject(com.gargoylesoftware.htmlunit.javascript.RecursiveFunctionObject) ClassConfiguration(com.gargoylesoftware.htmlunit.javascript.configuration.ClassConfiguration)

Aggregations

HtmlUnitScriptable (com.gargoylesoftware.htmlunit.javascript.HtmlUnitScriptable)1 RecursiveFunctionObject (com.gargoylesoftware.htmlunit.javascript.RecursiveFunctionObject)1 ClassConfiguration (com.gargoylesoftware.htmlunit.javascript.configuration.ClassConfiguration)1 FunctionObject (net.sourceforge.htmlunit.corejs.javascript.FunctionObject)1