Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index f27ca7ab8d687ac4f9de190edbdf6f247a7f7c21..7a279f66ca633b7a433186e4ab50d6135b529294 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -396,31 +396,32 @@ void Genesis::SetFunctionInstanceDescriptor( |
if (prototypeMode != DONT_ADD_PROTOTYPE) { |
prototype = factory()->NewForeign(&Accessors::FunctionPrototype); |
} |
- PropertyAttributes attribs = static_cast<PropertyAttributes>( |
+ PropertyAttributes ro_attribs = static_cast<PropertyAttributes>( |
DONT_ENUM | DONT_DELETE | READ_ONLY); |
+ PropertyAttributes roc_attribs = static_cast<PropertyAttributes>( |
+ DONT_ENUM | READ_ONLY); |
map->set_instance_descriptors(*descriptors); |
{ // Add length. |
- CallbacksDescriptor d(*factory()->length_string(), *length, attribs); |
+ CallbacksDescriptor d(*factory()->length_string(), *length, roc_attribs); |
map->AppendDescriptor(&d, witness); |
} |
{ // Add name. |
- CallbacksDescriptor d(*factory()->name_string(), *name, attribs); |
+ CallbacksDescriptor d(*factory()->name_string(), *name, roc_attribs); |
map->AppendDescriptor(&d, witness); |
} |
{ // Add arguments. |
- CallbacksDescriptor d(*factory()->arguments_string(), *args, attribs); |
+ CallbacksDescriptor d(*factory()->arguments_string(), *args, ro_attribs); |
map->AppendDescriptor(&d, witness); |
} |
{ // Add caller. |
- CallbacksDescriptor d(*factory()->caller_string(), *caller, attribs); |
+ CallbacksDescriptor d(*factory()->caller_string(), *caller, ro_attribs); |
map->AppendDescriptor(&d, witness); |
} |
if (prototypeMode != DONT_ADD_PROTOTYPE) { |
// Add prototype. |
- if (prototypeMode == ADD_WRITEABLE_PROTOTYPE) { |
- attribs = static_cast<PropertyAttributes>(attribs & ~READ_ONLY); |
- } |
+ PropertyAttributes attribs = (prototypeMode == ADD_WRITEABLE_PROTOTYPE) |
+ ? static_cast<PropertyAttributes>(ro_attribs & ~READ_ONLY) : ro_attribs; |
CallbacksDescriptor d(*factory()->prototype_string(), *prototype, attribs); |
map->AppendDescriptor(&d, witness); |
} |
@@ -538,14 +539,16 @@ void Genesis::SetStrictFunctionInstanceDescriptor( |
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE); |
PropertyAttributes ro_attribs = |
static_cast<PropertyAttributes>(DONT_ENUM | DONT_DELETE | READ_ONLY); |
+ PropertyAttributes roc_attribs = |
+ static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY); |
map->set_instance_descriptors(*descriptors); |
{ // Add length. |
- CallbacksDescriptor d(*factory()->length_string(), *length, ro_attribs); |
+ CallbacksDescriptor d(*factory()->length_string(), *length, roc_attribs); |
map->AppendDescriptor(&d, witness); |
} |
{ // Add name. |
- CallbacksDescriptor d(*factory()->name_string(), *name, ro_attribs); |
+ CallbacksDescriptor d(*factory()->name_string(), *name, roc_attribs); |
map->AppendDescriptor(&d, witness); |
} |
{ // Add arguments. |