Look up variables in per-thread scope first, then in shared global scope.
This commit is contained in:
parent
5ebbfe70a3
commit
38b4f265ce
1 changed files with 5 additions and 5 deletions
|
@ -35,14 +35,14 @@ public class DynamicGlobalObject extends GlobalObject {
|
|||
}
|
||||
|
||||
public Object get(String s, Scriptable scriptable) {
|
||||
Object obj = super.get(s, scriptable);
|
||||
if (obj != null && obj != NOT_FOUND)
|
||||
return obj;
|
||||
Scriptable scope = getScope();
|
||||
if (scope != null) {
|
||||
return scope.get(s, scope);
|
||||
Object obj = scope.get(s, scope);
|
||||
if (obj != null && obj != NOT_FOUND) {
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
return NOT_FOUND;
|
||||
return super.get(s, scriptable);
|
||||
}
|
||||
|
||||
public void registerScope(Scriptable scope) {
|
||||
|
|
Loading…
Add table
Reference in a new issue