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

Unified Diff: src/runtime.cc

Issue 6223: Make sure that the name accessor on functions return the expected... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 3 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 | « src/regexp-delay.js ('k') | src/runtime.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 413)
+++ src/runtime.cc (working copy)
@@ -135,6 +135,13 @@
Handle<FixedArray> literals = args.at<FixedArray>(0);
int literals_index = Smi::cast(args[1])->value();
Handle<FixedArray> constant_properties = args.at<FixedArray>(2);
+
+ // Get the global context from the literals array. This is the
+ // context in which the function was created and we use the object
+ // function from this context to create the object literal. We do
+ // not use the object function from the current global context
+ // because this might be the object function from another context
+ // which we should not have access to.
Handle<Context> context =
Handle<Context>(JSFunction::GlobalContextFromLiterals(*literals));
@@ -143,11 +150,6 @@
constant_properties,
is_result_from_cache);
- // Get the object function from the literals array. This is the
- // object function from the context in which the function was
- // created. We do not use the object function from the current
- // global context because this might be the object function from
- // another context which we should not have access to.
Handle<JSObject> boilerplate = Factory::NewJSObjectFromMap(map);
{ // Add the constant propeties to the boilerplate.
int length = constant_properties->length();
@@ -189,8 +191,8 @@
// Takes a FixedArray of elements containing the literal elements of
// the array literal and produces JSArray with those elements.
// Additionally takes the literals array of the surrounding function
- // which contains the Array function to use for creating the array
- // literal.
+ // which contains the context from which to get the Array function
+ // to use for creating the array literal.
ASSERT(args.length() == 2);
CONVERT_CHECKED(FixedArray, elements, args[0]);
CONVERT_CHECKED(FixedArray, literals, args[1]);
@@ -727,11 +729,11 @@
Handle<String> pattern = args.at<String>(2);
Handle<String> flags = args.at<String>(3);
- // Get the RegExp function from the literals array. This is the
- // RegExp function from the context in which the function was
- // created. We do not use the RegExp function from the current
- // global context because this might be the RegExp function from
- // another context which we should not have access to.
+ // Get the RegExp function from the context in the literals array.
+ // This is the RegExp function from the context in which the
+ // function was created. We do not use the RegExp function from the
+ // current global context because this might be the RegExp function
+ // from another context which we should not have access to.
Handle<JSFunction> constructor =
Handle<JSFunction>(
JSFunction::GlobalContextFromLiterals(*literals)->regexp_function());
@@ -855,7 +857,7 @@
target->set_code(fun->code());
target->shared()->set_length(fun->shared()->length());
target->shared()->set_formal_parameter_count(
- fun->shared()->formal_parameter_count());
+ fun->shared()->formal_parameter_count());
// Set the source code of the target function.
target->shared()->set_script(fun->shared()->script());
target->shared()->set_start_position(fun->shared()->start_position());
« no previous file with comments | « src/regexp-delay.js ('k') | src/runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698