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

Print this page
rev 1137 : 8068985: Wrong 'this' bound to eval call within a function when caller's 'this' is a Java object
Reviewed-by: jlaskey, attila

*** 701,711 **** } final ScriptFunction func = getProgramFunction(clazz, scope); Object evalThis; if (directEval) { ! evalThis = callThis instanceof ScriptObject || strictFlag ? callThis : global; } else { evalThis = global; } return ScriptRuntime.apply(func, evalThis); --- 701,711 ---- } final ScriptFunction func = getProgramFunction(clazz, scope); Object evalThis; if (directEval) { ! evalThis = (callThis != UNDEFINED && callThis != null) || strictFlag ? callThis : global; } else { evalThis = global; } return ScriptRuntime.apply(func, evalThis);