Skip to content

Commit a4c4ec7

Browse files
committed
scope handling fix (wip)
1 parent 9d5d8a9 commit a4c4ec7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • src/main/java/org/htmlunit/javascript/host/intl

src/main/java/org/htmlunit/javascript/host/intl/Intl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)