Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Issue 8343054: Make eval consider anything on the form eval(args...) a potential direct cal (Closed)

Created:
9 years, 1 month ago by Lasse Reichstein
Modified:
9 years, 1 month ago
Reviewers:
Rico
CC:
v8-dev
Visibility:
Public.

Description

Make eval consider anything on the form eval(args...) a potential direct cal Previously we omitted all cases where the global eval property was shadowed, even if by a variable holding the same value. ES5 requires us to treat these as direct calls. We still throw if calling indirect eval with a detached global object. BUG=v8:994 TEST=mjsunit/eval.js Committed: http://code.google.com/p/v8/source/detail?r=9838

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -251 lines) Patch
M src/arm/full-codegen-arm.cc View 3 chunks +3 lines, -23 lines 0 comments Download
M src/full-codegen.h View 1 chunk +1 line, -6 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 3 chunks +3 lines, -23 lines 0 comments Download
M src/mips/full-codegen-mips.cc View 3 chunks +3 lines, -23 lines 0 comments Download
M src/parser.cc View 1 chunk +3 lines, -12 lines 0 comments Download
M src/runtime.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M src/runtime.cc View 1 1 chunk +5 lines, -73 lines 0 comments Download
M src/v8natives.js View 1 chunk +5 lines, -10 lines 0 comments Download
M src/variables.h View 1 chunk +1 line, -2 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 3 chunks +3 lines, -23 lines 0 comments Download
M test/cctest/test-api.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M test/mjsunit/eval.js View 1 5 chunks +36 lines, -13 lines 0 comments Download
M test/mjsunit/regress/regress-221.js View 1 1 chunk +0 lines, -34 lines 0 comments Download
M test/mjsunit/strict-mode-implicit-receiver.js View 1 chunk +1 line, -6 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein
9 years, 1 month ago (2011-10-28 08:20:03 UTC) #1
Rico
LGTM http://codereview.chromium.org/8343054/diff/1/src/v8natives.js File src/v8natives.js (right): http://codereview.chromium.org/8343054/diff/1/src/v8natives.js#newcode174 src/v8natives.js:174: throw new $EvalError('The "this" value passed to eval ...
9 years, 1 month ago (2011-10-31 08:14:56 UTC) #2
Lasse Reichstein
9 years, 1 month ago (2011-10-31 09:37:46 UTC) #3
http://codereview.chromium.org/8343054/diff/1/src/v8natives.js
File src/v8natives.js (right):

http://codereview.chromium.org/8343054/diff/1/src/v8natives.js#newcode174
src/v8natives.js:174: throw new $EvalError('The "this" value passed to eval must
' +
Yes and yes.
The message is bogus now, since that's not what we are checking  (but that was
always the case for a detached global).

http://codereview.chromium.org/8343054/diff/1/test/mjsunit/eval.js
File test/mjsunit/eval.js (right):

http://codereview.chromium.org/8343054/diff/1/test/mjsunit/eval.js#newcode161
test/mjsunit/eval.js:161: var obj1 = { f: function(eval) { return eval("this");
} };
Artifact of rewriting. At some point the var was outside the function. I'll just
make it "obj".

http://codereview.chromium.org/8343054/diff/1/test/mjsunit/regress/regress-22...
File test/mjsunit/regress/regress-221.js (right):

http://codereview.chromium.org/8343054/diff/1/test/mjsunit/regress/regress-22...
test/mjsunit/regress/regress-221.js:33: assertThrows('for(;;) eval("delete
eval");');
This test is pretty meaningless now, so I'll just remove it, instead of
rewriting it to something that doesn't test the original intent anyway.

Powered by Google App Engine
This is Rietveld 408576698