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

Unified Diff: src/bootstrapper.cc

Issue 99203006: Make a strict function's "name" property non-writable. (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: Make Function.name [[Configurable]] per ES6 Created 7 years 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/harmony/object-observe.js » ('j') | test/mjsunit/harmony/object-observe.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 4d69f8407f4fb4e9bff20bd174b8cb848d824fe6..50beafa8e05ed0b3b7528d7bc524e52bc9aa5349 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -407,6 +407,8 @@ void Genesis::SetFunctionInstanceDescriptor(
}
PropertyAttributes attribs = static_cast<PropertyAttributes>(
DONT_ENUM | DONT_DELETE | READ_ONLY);
+ PropertyAttributes ro_configurable_attribs =
+ static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY);
map->set_instance_descriptors(*descriptors);
{ // Add length.
@@ -414,7 +416,8 @@ void Genesis::SetFunctionInstanceDescriptor(
map->AppendDescriptor(&d, witness);
}
{ // Add name.
- CallbacksDescriptor d(*factory()->name_string(), *name, attribs);
+ CallbacksDescriptor d(*factory()->name_string(), *name,
+ ro_configurable_attribs);
map->AppendDescriptor(&d, witness);
}
{ // Add arguments.
@@ -547,6 +550,8 @@ void Genesis::SetStrictFunctionInstanceDescriptor(
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE);
PropertyAttributes ro_attribs =
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY);
+ PropertyAttributes ro_configurable_attribs =
+ static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY);
map->set_instance_descriptors(*descriptors);
{ // Add length.
@@ -554,7 +559,8 @@ void Genesis::SetStrictFunctionInstanceDescriptor(
map->AppendDescriptor(&d, witness);
}
{ // Add name.
- CallbacksDescriptor d(*factory()->name_string(), *name, rw_attribs);
+ CallbacksDescriptor d(*factory()->name_string(), *name,
+ ro_configurable_attribs);
map->AppendDescriptor(&d, witness);
}
{ // Add arguments.
« no previous file with comments | « no previous file | test/mjsunit/harmony/object-observe.js » ('j') | test/mjsunit/harmony/object-observe.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698