src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptRuntime.java
Print this page
*** 371,383 ****
*
* @param scope Scope to merge.
* @return prototype object after merge
*/
public static ScriptObject mergeScope(final ScriptObject scope) {
! final ScriptObject global = scope.getProto();
! global.addBoundProperties(scope);
! return global;
}
/**
* Call a function given self and args. If the number of the arguments is known in advance, you can likely achieve
* better performance by {@link Bootstrap#createDynamicInvoker(String, Class, Class...) creating a dynamic invoker}
--- 371,383 ----
*
* @param scope Scope to merge.
* @return prototype object after merge
*/
public static ScriptObject mergeScope(final ScriptObject scope) {
! final ScriptObject parentScope = scope.getProto();
! parentScope.addBoundProperties(scope);
! return parentScope;
}
/**
* Call a function given self and args. If the number of the arguments is known in advance, you can likely achieve
* better performance by {@link Bootstrap#createDynamicInvoker(String, Class, Class...) creating a dynamic invoker}