Version 2.2.13.
Implement Object.getOwnPropertyDescriptor for element indices and strings (issue 599).
Fix bug for windows 64 bit C calls from generated code.
Add new scons flag unalignedaccesses for arm builds.
Performance improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@4756 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/v8natives.js b/src/v8natives.js
index ed392e2..1d47eb7 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -492,23 +492,23 @@
function GetOwnProperty(obj, p) {
var desc = new PropertyDescriptor();
- // An array with:
- // obj is a data property [false, value, Writeable, Enumerable, Configurable]
- // obj is an accessor [true, Get, Set, Enumerable, Configurable]
+ // GetOwnProperty returns an array indexed by the constants
+ // defined in macros.py.
+ // If p is not a property on obj undefined is returned.
var props = %GetOwnProperty(ToObject(obj), ToString(p));
if (IS_UNDEFINED(props)) return void 0;
// This is an accessor
- if (props[0]) {
- desc.setGet(props[1]);
- desc.setSet(props[2]);
+ if (props[IS_ACCESSOR_INDEX]) {
+ desc.setGet(props[GETTER_INDEX]);
+ desc.setSet(props[SETTER_INDEX]);
} else {
- desc.setValue(props[1]);
- desc.setWritable(props[2]);
+ desc.setValue(props[VALUE_INDEX]);
+ desc.setWritable(props[WRITABLE_INDEX]);
}
- desc.setEnumerable(props[3]);
- desc.setConfigurable(props[4]);
+ desc.setEnumerable(props[ENUMERABLE_INDEX]);
+ desc.setConfigurable(props[CONFIGURABLE_INDEX]);
return desc;
}