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

Unified Diff: src/v8natives.js

Issue 7736011: Port r9030 and part of r9016 to 3.3 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.3
Patch Set: Also prevent FromPropertyDescriptor from hitting inherited setters. Created 9 years, 4 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
« src/accessors.cc ('K') | « src/accessors.cc ('k') | src/version.cc » ('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 e27f3b00a34a94375d12eee1aafbdc6f78076532..700fe5889c89c4e4eddfd79b1e5060a15b67b152 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -326,18 +326,18 @@ function IsInconsistentDescriptor(desc) {
// ES5 8.10.4
function FromPropertyDescriptor(desc) {
if (IS_UNDEFINED(desc)) return desc;
- var obj = new $Object();
+
if (IsDataDescriptor(desc)) {
- obj.value = desc.getValue();
- obj.writable = desc.isWritable();
- }
- if (IsAccessorDescriptor(desc)) {
- obj.get = desc.getGet();
- obj.set = desc.getSet();
- }
- obj.enumerable = desc.isEnumerable();
- obj.configurable = desc.isConfigurable();
- return obj;
+ return { value: desc.getValue(),
+ writable: desc.isWritable(),
+ enumerable: desc.isEnumerable(),
+ configurable: desc.isConfigurable() };
+ }
+ // Must be an AccessorDescriptor then. We never return a generic descriptor.
+ return { get: desc.getGet(),
+ set: desc.getSet(),
+ enumerable: desc.isEnumerable(),
+ configurable: desc.isConfigurable() };
}
// ES5 8.10.5.
« src/accessors.cc ('K') | « src/accessors.cc ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698