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

Unified Diff: src/runtime.cc

Issue 6591075: Allow eval to be overridden with a callable non-function object. (Closed)
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/override-eval-with-non-function.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index fdbd5afb1bf08da92f7de15b65c046e0a8bb1f4e..c009f3768ea6b76107a62b606fb3421cea9e36a1 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -7872,12 +7872,9 @@ static ObjectPair CompileGlobalEval(Handle<String> source,
static ObjectPair Runtime_ResolvePossiblyDirectEval(Arguments args) {
ASSERT(args.length() == 4);
- if (!args[0]->IsJSFunction()) {
- return MakePair(Top::ThrowIllegalOperation(), NULL);
- }
HandleScope scope;
- Handle<JSFunction> callee = args.at<JSFunction>(0);
+ Handle<Object> callee = args.at<Object>(0);
Handle<Object> receiver; // Will be overwritten.
// Compute the calling context.
@@ -7945,12 +7942,9 @@ static ObjectPair Runtime_ResolvePossiblyDirectEval(Arguments args) {
static ObjectPair Runtime_ResolvePossiblyDirectEvalNoLookup(Arguments args) {
ASSERT(args.length() == 4);
- if (!args[0]->IsJSFunction()) {
- return MakePair(Top::ThrowIllegalOperation(), NULL);
- }
HandleScope scope;
- Handle<JSFunction> callee = args.at<JSFunction>(0);
+ Handle<Object> callee = args.at<Object>(0);
// 'eval' is bound in the global context, but it may have been overwritten.
// Compare it to the builtin 'GlobalEval' function to make sure.
« no previous file with comments | « no previous file | test/mjsunit/override-eval-with-non-function.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698