Skip to content

Commit db9f35f

Browse files
committed
Revert "move some work to the initial setup - hopefully this improves window setup speed"
This reverts commit 6ec390b.
1 parent 6ec390b commit db9f35f

File tree

2 files changed

+17
-29
lines changed

2 files changed

+17
-29
lines changed

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import org.htmlunit.corejs.javascript.Function;
4747
import org.htmlunit.corejs.javascript.FunctionObject;
4848
import org.htmlunit.corejs.javascript.JavaScriptException;
49-
import org.htmlunit.corejs.javascript.MemberBox;
5049
import org.htmlunit.corejs.javascript.NativeArray;
5150
import org.htmlunit.corejs.javascript.NativeArrayIterator;
5251
import org.htmlunit.corejs.javascript.NativeConsole;
@@ -609,24 +608,24 @@ private static void configureProperties(final ClassConfiguration config, final S
609608
if (propertyMap != null) {
610609
for (final Entry<String, PropertyInfo> propertyEntry : propertyMap.entrySet()) {
611610
final PropertyInfo info = propertyEntry.getValue();
612-
final MemberBox readMethod = info.getReadMethod();
613-
final MemberBox writeMethod = info.getWriteMethod();
614-
scriptable.defineProperty(propertyEntry.getKey(), readMethod, writeMethod, ScriptableObject.EMPTY);
611+
final Method readMethod = info.getReadMethod();
612+
final Method writeMethod = info.getWriteMethod();
613+
scriptable.defineProperty(propertyEntry.getKey(), null, readMethod, writeMethod, ScriptableObject.EMPTY);
615614
}
616615
}
617616
}
618617

619618
private static void configureStaticProperties(final ClassConfiguration config, final ScriptableObject scriptable) {
620619
final Map<String, PropertyInfo> staticPropertyMap = config.getStaticPropertyMap();
621620
if (staticPropertyMap != null) {
622-
// for (final Entry<String, ClassConfiguration.PropertyInfo> propertyEntry : staticPropertyMap.entrySet()) {
623-
// final String propertyName = propertyEntry.getKey();
624-
// final Method readMethod = propertyEntry.getValue().getReadMethod();
625-
// final Method writeMethod = propertyEntry.getValue().getWriteMethod();
626-
// final int flag = ScriptableObject.EMPTY;
627-
//
628-
// scriptable.defineProperty(propertyName, null, readMethod, writeMethod, flag);
629-
// }
621+
for (final Entry<String, ClassConfiguration.PropertyInfo> propertyEntry : staticPropertyMap.entrySet()) {
622+
final String propertyName = propertyEntry.getKey();
623+
final Method readMethod = propertyEntry.getValue().getReadMethod();
624+
final Method writeMethod = propertyEntry.getValue().getWriteMethod();
625+
final int flag = ScriptableObject.EMPTY;
626+
627+
scriptable.defineProperty(propertyName, null, readMethod, writeMethod, flag);
628+
}
630629
}
631630
}
632631

src/main/java/org/htmlunit/javascript/configuration/ClassConfiguration.java

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222
import java.util.List;
2323
import java.util.Map;
2424

25-
import org.htmlunit.corejs.javascript.MemberBox;
2625
import org.htmlunit.corejs.javascript.ScriptableObject;
2726
import org.htmlunit.corejs.javascript.Symbol;
28-
import org.htmlunit.corejs.javascript.lc.type.TypeInfoFactory;
2927
import org.htmlunit.javascript.HtmlUnitScriptable;
3028

3129
/**
@@ -315,8 +313,8 @@ public String getClassName() {
315313
* methods that implement the get and set functions.
316314
*/
317315
public static class PropertyInfo {
318-
private final MemberBox readMethod_;
319-
private final MemberBox writeMethod_;
316+
private final Method readMethod_;
317+
private final Method writeMethod_;
320318

321319
/**
322320
* Constructor.
@@ -325,30 +323,21 @@ public static class PropertyInfo {
325323
* @param writeMethod the writeMethod
326324
*/
327325
public PropertyInfo(final Method readMethod, final Method writeMethod) {
328-
MemberBox getterBox = null;
329-
if (readMethod != null) {
330-
getterBox = new MemberBox(readMethod, TypeInfoFactory.GLOBAL);
331-
}
332-
readMethod_ = getterBox;
333-
334-
MemberBox setterBox = null;
335-
if (writeMethod != null) {
336-
setterBox = new MemberBox(writeMethod, TypeInfoFactory.GLOBAL);
337-
}
338-
writeMethod_ = setterBox;
326+
readMethod_ = readMethod;
327+
writeMethod_ = writeMethod;
339328
}
340329

341330
/**
342331
* @return the readMethod
343332
*/
344-
public MemberBox getReadMethod() {
333+
public Method getReadMethod() {
345334
return readMethod_;
346335
}
347336

348337
/**
349338
* @return the writeMethod
350339
*/
351-
public MemberBox getWriteMethod() {
340+
public Method getWriteMethod() {
352341
return writeMethod_;
353342
}
354343
}

0 commit comments

Comments
 (0)