@@ -92,14 +92,14 @@ private void define(final TopLevel scope, final Class<? extends HtmlUnitScriptab
9292 final HtmlUnitScriptable prototype = JavaScriptEngine .configureClass (config , scope );
9393 final FunctionObject constructorFn = new FunctionObject (config .getJsConstructor ().getKey (),
9494 config .getJsConstructor ().getValue (), scope );
95- // constructorFn.addAsConstructor(scope, prototype, ScriptableObject.DONTENUM);
95+
9696 ScriptRuntime .setFunctionProtoAndParent (constructorFn , Context .getCurrentContext (), scope );
9797 constructorFn .setImmunePrototypeProperty (prototype );
9898 prototype .setParentScope (scope );
99- constructorFn .defineProperty (prototype , "constructor" , this , ScriptableObject .DONTENUM );
99+ ScriptableObject .defineProperty (prototype , "constructor" , constructorFn , ScriptableObject .DONTENUM );
100100 constructorFn .setParentScope (scope );
101101
102- defineProperty (this , prototype .getClassName (), constructorFn , ScriptableObject .DONTENUM );
102+ ScriptableObject . defineProperty (this , prototype .getClassName (), constructorFn , ScriptableObject .DONTENUM );
103103
104104 defineStaticFunctions (config , scope , constructorFn );
105105 }
0 commit comments