Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/main/java/com/dashjoin/jsonata/Jsonata.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,11 @@ public void bind(String name, JFunction function) {
public<A,B,R> void bind(String name, Fn2<A,B,R> lambda) { bind(name, (Object)lambda); }

public Object lookup(String name) {
// Important: if we have a null value,
// return it
if (bindings.containsKey(name))
return bindings.get(name);
if (parent!=null)
return parent.lookup(name);
// Iterative walk of the parent scope chain to avoid StackOverflowError
// on JVMs with small thread stacks (e.g. Windows workers).
for (Frame f = this; f != null; f = f.parent) {
if (f.bindings.containsKey(name)) return f.bindings.get(name);
}
return null;
}

Expand Down
Loading