Skip to content

Commit ebad21d

Browse files
aardvark179gbrail
authored andcommitted
Fix performance regression from LookupResult change.
1 parent 444464e commit ebad21d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

rhino/src/main/java/org/mozilla/javascript/ScriptRuntime.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,7 +3216,7 @@ private static LookupResult getValueAndThisInner(
32163216
|| Undefined.isUndefined(value))) {
32173217
return null;
32183218
}
3219-
return new LookupResult(value, null, value == null ? "null" : value.toString());
3219+
return new LookupResult(value, null, value);
32203220
}
32213221

32223222
Callable f = (Callable) value;
@@ -3237,7 +3237,7 @@ private static LookupResult getValueAndThisInner(
32373237
thisObj = ScriptableObject.getTopLevelScope(thisObj);
32383238
}
32393239
}
3240-
return new LookupResult(f, thisObj, value == null ? "null" : value.toString());
3240+
return new LookupResult(f, thisObj, value);
32413241
}
32423242

32433243
/**
@@ -6011,9 +6011,9 @@ public static final class LookupResult implements Serializable {
60116011

60126012
private final Object result;
60136013
private final Scriptable thisObj;
6014-
private final String name;
6014+
private final Object name;
60156015

6016-
LookupResult(Object result, Scriptable thisObj, String name) {
6016+
LookupResult(Object result, Scriptable thisObj, Object name) {
60176017
this.result = result;
60186018
this.thisObj = thisObj;
60196019
this.name = name;
@@ -6028,7 +6028,7 @@ public Scriptable getThis() {
60286028
}
60296029

60306030
public String getName() {
6031-
return name;
6031+
return name == null ? "null" : name.toString();
60326032
}
60336033

60346034
/**

0 commit comments

Comments
 (0)