Throw EvalError for indirect eval calls iff strict+werror (38512, r=rogerl, sr=shaver).

This commit is contained in:
brendan%mozilla.org 2001-01-31 01:12:15 +00:00
parent 54f5d157e7
commit d0385b286a

View File

@ -872,9 +872,13 @@ obj_eval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
caller = cx->fp->down;
indirectCall = (!caller->pc || *caller->pc != JSOP_EVAL);
if (JSVERSION_IS_ECMA(cx->version) && indirectCall) {
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
JSMSG_BAD_INDIRECT_CALL, js_eval_str);
if (JSVERSION_IS_ECMA(cx->version) &&
indirectCall &&
!JS_ReportErrorFlagsAndNumber(cx,
JSREPORT_WARNING | JSREPORT_STRICT,
js_GetErrorMessage, NULL,
JSMSG_BAD_INDIRECT_CALL,
js_eval_str)) {
return JS_FALSE;
}