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

Unified Diff: src/runtime.cc

Issue 11601: Changing the semantics of cross-frame eval to be compatible with Safari and F... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 12 years, 1 month 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 | « src/runtime.h ('k') | src/v8natives.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 768)
+++ src/runtime.cc (working copy)
@@ -3956,32 +3956,11 @@
Handle<Context> target = Top::global_context();
if (caller->global_context() == *target) return *caller;
- // Compute a function closure that captures the calling context. We
- // need a function that has trivial scope info, since it is only
- // used to hold the context chain together.
- Handle<JSFunction> closure = Factory::NewFunction(Factory::empty_symbol(),
- Factory::undefined_value());
- closure->set_context(*caller);
-
- // Create a new adaptor context that has the target environment as
- // the extension object. This enables the evaluated code to see both
- // the current context with locals and everything and to see global
- // variables declared in the target global object. Furthermore, any
- // properties introduced with 'var' will be added to the target
- // global object because it is the extension object.
- Handle<Context> adaptor =
- Factory::NewFunctionContext(Context::MIN_CONTEXT_SLOTS, closure);
- adaptor->set_extension(target->global());
- return *adaptor;
+ // Otherwise, use the global context from the other environment.
+ return *target;
}
-static Object* Runtime_EvalReceiver(Arguments args) {
- StackFrameLocator locator;
- return locator.FindJavaScriptFrame(1)->receiver();
-}
-
-
static Object* Runtime_GlobalReceiver(Arguments args) {
ASSERT(args.length() == 1);
Object* global = args[0];
« no previous file with comments | « src/runtime.h ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698