Skip to content

Commit b2a6cb3

Browse files
committed
fix scope ctor prototype
1 parent 40e4330 commit b2a6cb3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/org/htmlunit/javascript/JavaScriptEngine.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,12 @@ public static void configureScope(final HtmlUnitScriptable jsScope,
332332
if (config == scopeConfig) {
333333
addAsConstructorAndAlias(scopeContructorFunctionObject, jsScope, prototype, config);
334334
configureConstantsStaticPropertiesAndStaticFunctions(config, scopeContructorFunctionObject);
335+
336+
// adjust prototype if needed
337+
if (!StringUtils.isEmpty(config.getExtendedClassName())) {
338+
final Scriptable parentPrototype = ctorPrototypesPerJSName.get(config.getExtendedClassName());
339+
scopeContructorFunctionObject.setPrototype(parentPrototype);
340+
}
335341
continue;
336342
}
337343

0 commit comments

Comments
 (0)