Bug 546668 - obj_eval should still call js_GetScriptedCaller (r=mrbkap)
authorLuke Wagner <lw@mozilla.com>
Wed, 17 Feb 2010 11:16:11 -0800
changeset 38592 5a50a2d0fc0fd4b4a12b9281a9189b4f9618c07b
parent 38591 4593e2fa380e43e391e23fe537cab7270fe07387
child 38593 89981683ffd4cbe2c24c3c5d4d0f869042f6be76
push idunknown
push userunknown
push dateunknown
reviewersmrbkap
bugs546668
milestone1.9.3a2pre
Bug 546668 - obj_eval should still call js_GetScriptedCaller (r=mrbkap)
js/src/jsobj.cpp
js/src/trace-test/tests/basic/testEvalCalledFromWatchOverSetter.js
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -1246,17 +1246,17 @@ EvalCacheHash(JSContext *cx, JSString *s
 static JSBool
 obj_eval(JSContext *cx, uintN argc, jsval *vp)
 {
     if (argc < 1) {
         *vp = JSVAL_VOID;
         return JS_TRUE;
     }
 
-    JSStackFrame *caller = js_GetTopStackFrame(cx);
+    JSStackFrame *caller = js_GetScriptedCaller(cx, NULL);
     if (!caller) {
         JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
                              JSMSG_BAD_INDIRECT_CALL, js_eval_str);
         return JS_FALSE;
     }
 
     bool indirectCall = (caller->regs && *caller->regs->pc != JSOP_EVAL);
 
new file mode 100644
--- /dev/null
+++ b/js/src/trace-test/tests/basic/testEvalCalledFromWatchOverSetter.js
@@ -0,0 +1,3 @@
+__defineSetter__("x", function(){});
+this.watch("x", eval);
+x = 0;