Bug 442333 - remove eval's optional second argument, r=brendan

This commit is contained in:
Brian Crowder
2008-07-01 16:44:44 -07:00
parent dcc9c74539
commit c829565d63
2 changed files with 7 additions and 8 deletions

View File

@@ -1215,14 +1215,12 @@ obj_eval(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
if (caller && !caller->varobj && !js_GetCallObject(cx, caller, NULL))
return JS_FALSE;
/*
* Script.prototype.compile/exec and Object.prototype.eval all take an
* optional trailing argument that overrides the scope object.
*/
if (argc >= 2) {
if (!js_ValueToObject(cx, argv[1], &scopeobj))
return JS_FALSE;
argv[1] = OBJECT_TO_JSVAL(scopeobj);
/* eval no longer takes an optional trailing argument. */
if (argc >= 2 &&
!JS_ReportErrorFlagsAndNumber(cx, JSREPORT_WARNING | JSREPORT_STRICT,
js_GetErrorMessage, NULL,
JSMSG_EVAL_ARITY)) {
return JS_FALSE;
}
/* From here on, control must exit through label out with ok set. */