Closed
Bug 67714
Opened 24 years ago
Closed 24 years ago
Rhino needs to allow indirect eval, as SpiderMonkey now does
Categories
(Rhino Graveyard :: Core, defect)
Tracking
(Not tracked)
VERIFIED
WONTFIX
People
(Reporter: pschwartau, Assigned: rogerl)
Details
Thanks to bug 38512, Spidermonkey now allows indirect calls to eval.
If the "strict" option is on, it will warn about it - but permit it:
-------------------- STRICT WARNING ON --------------------------
[/d/JS_TRUNK/mozilla/js/src/WINNT4.0_DBG.OBJ] ./js
js> var f = eval
js> f('1+1')
2: strict warning: function eval must be called directly, and not by way of a
function of another name.
2
-------------------- STRICT WARNING OFF --------------------------
[/d/JS_TRUNK/mozilla/js/src/WINNT4.0_DBG.OBJ] ./js -W
js> var f = eval
js> f('1+1')
2
Rhino needs to do the same - currently we get this:
[/d/JS_TRUNK/mozilla/js/rhino] java org.mozilla.javascript.tools.shell.Main
js> var f=eval
js> f('1+1')
js: "<stdin>", line 2: uncaught JavaScript exception: EvalError: Function "eval"
must be called directly, and not by way of a function of another name.
(<stdin>; line 2)
Comment 1•24 years ago
|
||
I argue that Rhino can continue to throw an error for indirect eval as it is
permitted to do by ECMA. This allows us to perform the optimizations we
currently perform when our optimizer is enabled.
Phil, could you make the test work for the case where we throw the error?
Reporter | ||
Comment 2•24 years ago
|
||
OK, marking WONTFIX, and adding these testcases to the Rhino "skip list"
(js/tests/rhino-n.tests):
js/tests/js1_4/Eval/eval-001.js
js/tests/js1_4/Eval/eval-002.js
js/tests/js1_4/Eval/eval-003.js
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•