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

Unified Diff: src/runtime.cc

Issue 116083006: Make Function.length and Function.name configurable properties. (Closed) Base URL: git://github.com/v8/v8.git@bleeding_edge
Patch Set: Make comment + predicate more precise/correct. Created 6 years, 11 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/bootstrapper.cc ('k') | test/cctest/test-accessors.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index a175836adb2a8a83eaac8b3e0342ee2b19b4c8eb..c90d6ac1f3dcfdc7584b2543ed2de5f6e3fe61d9 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -5099,11 +5099,14 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DefineOrRedefineDataProperty) {
if (callback->IsAccessorInfo()) {
return isolate->heap()->undefined_value();
}
- // Avoid redefining foreign callback as data property, just use the stored
- // setter to update the value instead.
+ // Provided a read-only property isn't being reconfigured, 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
// change, this should be fixed once we cleanup the underlying code.
- if (callback->IsForeign() && lookup.GetAttributes() == attr) {
+ if (callback->IsForeign() &&
+ lookup.GetAttributes() == attr &&
+ !(attr & READ_ONLY)) {
Handle<Object> result_object =
JSObject::SetPropertyWithCallback(js_object,
callback,
« no previous file with comments | « src/bootstrapper.cc ('k') | test/cctest/test-accessors.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698