Reviewers: Rico,
Description:
Fix a problem where Object.getOwnPropertyDescriptor and related functions
unintentionally called toString on the values of an object's properties.
Fixes
issue 1233.
Please review this at http://codereview.chromium.org/6677017/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/v8natives.js
Index: src/v8natives.js
===================================================================
--- src/v8natives.js (revision 7146)
+++ src/v8natives.js (working copy)
@@ -495,7 +495,7 @@
// property descriptor. For a description of the array layout please
// see the runtime.cc file.
function ConvertDescriptorArrayToDescriptor(desc_array) {
- if (desc_array == false) {
+ if (desc_array === false) {
throw 'Internal error: invalid desc_array';
}
@@ -544,7 +544,7 @@
var props = %GetOwnProperty(ToObject(obj), ToString(p));
// A false value here means that access checks failed.
- if (props == false) return void 0;
+ if (props === false) return void 0;
return ConvertDescriptorArrayToDescriptor(props);
}
@@ -554,7 +554,7 @@
function DefineOwnProperty(obj, p, desc, should_throw) {
var current_or_access = %GetOwnProperty(ToObject(obj), ToString(p));
// A false value here means that access checks failed.
- if (current_or_access == false) return void 0;
+ if (current_or_access === false) return void 0;
var current = ConvertDescriptorArrayToDescriptor(current_or_access);
var extensible = %IsExtensible(ToObject(obj));
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev