src/jdk/nashorn/internal/runtime/ScriptRuntime.java

Print this page

        

@@ -472,11 +472,11 @@
      * @param expression expression in with
      *
      * @return {@link WithObject} that is the new scope
      */
     public static ScriptObject openWith(final ScriptObject scope, final Object expression) {
-        final ScriptObject global = Context.getGlobalTrusted();
+        final Global global = Context.getGlobal();
         if (expression == UNDEFINED) {
             throw typeError(global, "cant.apply.with.to.undefined");
         } else if (expression == null) {
             throw typeError(global, "cant.apply.with.to.null");
         }