Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,18 @@ public Object get(String name, final Scriptable start) {
// Try to get property configured on object itself.
Object response = super.get(name, start);
if (response != NOT_FOUND) {
if (response instanceof ScriptableObject) {
ScriptableObject responseScriptable = (ScriptableObject) response;
if (responseScriptable.getParentScope() == null) {
responseScriptable.setParentScope(this.getParentScope());
}
}
if (response instanceof SimpleScriptable) {
SimpleScriptable simpleScriptable = (SimpleScriptable) response;
if (simpleScriptable.getPrototype() == null) {
simpleScriptable.setPrototype(getPrototype(simpleScriptable.getClass()));
}
}
return response;
}
if (this == start) {
Expand Down