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); |