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

changeset 456
e3307f1a30e5
parent 402
9d3a9fdab668
child 459
0cfa27ed82fe
equal deleted inserted replaced
455:3d6f6b8d8bc8 456:e3307f1a30e5
333 * @param args Call arguments. 333 * @param args Call arguments.
334 * @return Call result. 334 * @return Call result.
335 */ 335 */
336 public static Object checkAndApply(final ScriptFunction target, final Object self, final Object... args) { 336 public static Object checkAndApply(final ScriptFunction target, final Object self, final Object... args) {
337 final ScriptObject global = Context.getGlobalTrusted(); 337 final ScriptObject global = Context.getGlobalTrusted();
338 if (! (global instanceof GlobalObject)) { 338 assert (global instanceof GlobalObject): "No current global set";
339 throw new IllegalStateException("No current global set");
340 }
341 339
342 if (target.getContext() != global.getContext()) { 340 if (target.getContext() != global.getContext()) {
343 throw new IllegalArgumentException("'target' function is not from current Context"); 341 throw new IllegalArgumentException("'target' function is not from current Context");
344 } 342 }
345 343

mercurial