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

Unified Diff: src/v8natives.js

Issue 5773002: Fix issue 965. (Closed)
Patch Set: Address review comments 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') | no next file with comments »
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..894df1402598cadb5b93ac06da0075feb9d45d4f 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -615,7 +615,13 @@ function DefineOwnProperty(obj, p, desc, should_throw) {
} else {
flag |= READ_ONLY;
}
- %DefineOrRedefineDataProperty(obj, p, desc.getValue(), flag);
+ var value; // Default value is undefined.
+ if (desc.hasValue()) {
+ value = desc.getValue();
+ } else if (!IS_UNDEFINED(current)) {
+ value = 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698