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

Unified Diff: src/v8natives.js

Issue 5773002: Fix issue 965. (Closed)
Patch Set: Created 10 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/object-define-property.js » ('j') | test/mjsunit/object-define-property.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index 50a2774d122072654cabadc5b8e0a9d8a4f81921..afa18cb4ddc20d0df8b0f9a29cfa075329edb8ec 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -615,7 +615,9 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
} else {
flag |= READ_ONLY;
}
- %DefineOrRedefineDataProperty(obj, p, desc.getValue(), flag);
+ var value =
Rico 2010/12/10 10:42:35 Maybe add a comment that states that this actually
Kevin Millikin (Chromium) 2010/12/10 11:08:23 I would actually suggest writing it just like the
Lasse Reichstein 2010/12/10 11:21:45 Changed to: var value; // Default value is undef
Kevin Millikin (Chromium) 2010/12/10 11:28:20 I still think that's too cute. This is a long fun
Lasse Reichstein 2010/12/10 11:37:51 True, good point. I'll make a new CL and make it
+ desc.hasValue() ? desc.getValue() : (current && current.getValue());
+ %DefineOrRedefineDataProperty(obj, p, value, flag);
} else {
if (desc.hasGetter() && IS_FUNCTION(desc.getGet())) {
%DefineOrRedefineAccessorProperty(obj, p, GETTER, desc.getGet(), flag);
« no previous file with comments | « no previous file | test/mjsunit/object-define-property.js » ('j') | test/mjsunit/object-define-property.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698