private void define(final Class<? extends SimpleScriptable> 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); } } }
private void define(final Class<? extends SimpleScriptable> 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); } } }
((FunctionObject) function).addAsConstructor(window, prototype); if (function instanceof FunctionObject) { try { ((FunctionObject) function).addAsConstructor(window, prototype); final FunctionObject functionObject = new HiddenFunctionObject("ActiveXObject", jsConstructor, window); try { functionObject.addAsConstructor(window, prototype);
if (prototype != null) { final FunctionObject jsCtor = new FunctionObject(jsClassName, jsConstructor, window); jsCtor.addAsConstructor(window, prototype);
if (prototype != null) { final FunctionObject jsCtor = new FunctionObject(jsClassName, jsConstructor, window); jsCtor.addAsConstructor(window, prototype);
((FunctionObject) function).addAsConstructor(window, prototype); if (function instanceof FunctionObject) { try { ((FunctionObject) function).addAsConstructor(window, prototype); final FunctionObject functionObject = new HiddenFunctionObject("ActiveXObject", jsConstructor, window); try { functionObject.addAsConstructor(window, prototype);
if (prototype != null) { final FunctionObject jsCtor = new FunctionObject(jsClassName, jsConstructor, window); jsCtor.addAsConstructor(window, prototype);