Index: src/runtime.cc |
diff --git a/src/runtime.cc b/src/runtime.cc |
index e914a3ae3291ee411b2c3a80122b2725c507fd90..52905ab1be547535ce5c20884b59dfc3ac10abf0 100644 |
--- a/src/runtime.cc |
+++ b/src/runtime.cc |
@@ -4091,6 +4091,14 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DefineOrRedefineDataProperty) { |
if (callback->IsAccessorInfo()) { |
return isolate->heap()->undefined_value(); |
} |
+ // TODO(mstarzinger): The __proto__ property should actually be a real |
+ // JavaScript accessor instead of a foreign callback. But for now we just |
+ // avoid changing the writability and configurability attribute of this |
+ // property. |
+ Handle<String> proto_string = isolate->factory()->proto_string(); |
+ if (callback->IsForeign() && proto_string->Equals(*name)) { |
+ attr = static_cast<PropertyAttributes>(attr & ~(READ_ONLY | DONT_DELETE)); |
+ } |
// Avoid redefining foreign callback as data property, just use the stored |
// setter to update the value instead. |
// TODO(mstarzinger): So far this only works if property attributes don't |