Skip to content

Commit ab5f6cd

Browse files
committed
fix last optimization
1 parent 6f3c043 commit ab5f6cd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,17 @@ public static void configureScope(final HtmlUnitScriptable jsScope,
287287

288288
// setup the prototypes
289289
for (final ClassConfiguration config : jsConfig.getAll()) {
290-
if (config != scopeConfig) {
290+
if (config == scopeConfig) {
291+
final Scriptable prototype = prototypesPerJSName.get(config.getClassName());
292+
if (!StringUtils.isEmpty(config.getExtendedClassName())) {
293+
final Scriptable parentPrototype = prototypesPerJSName.get(config.getExtendedClassName());
294+
prototype.setPrototype(parentPrototype);
295+
}
296+
else {
297+
prototype.setPrototype(objectPrototype);
298+
}
299+
}
300+
else {
291301
final HtmlUnitScriptable prototype = configureClass(config, jsScope);
292302
if (config.isJsObject()) {
293303
// Place object with prototype property in Window scope

0 commit comments

Comments
 (0)