src/jdk/nashorn/internal/runtime/ScriptFunctionData.java
Print this page
@@ -30,10 +30,11 @@
import static jdk.nashorn.internal.runtime.ScriptRuntime.UNDEFINED;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
+import jdk.nashorn.internal.objects.Global;
import jdk.nashorn.internal.runtime.linker.JavaAdapterFactory;
/**
* A container for data needed to instantiate a specific {@link ScriptFunction} at runtime.
* Instances of this class are created during codegen and stored in script classes'
@@ -370,15 +371,15 @@
* @return the converted this object
*/
private Object convertThisObject(final Object thiz) {
if (!(thiz instanceof ScriptObject) && needsWrappedThis()) {
if (JSType.nullOrUndefined(thiz)) {
- return Context.getGlobalTrusted();
+ return Context.getGlobal();
}
if (isPrimitiveThis(thiz)) {
- return ((GlobalObject)Context.getGlobalTrusted()).wrapAsObject(thiz);
+ return Context.getGlobal().wrapAsObject(thiz);
}
}
return thiz;
}