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

Unified Diff: src/v8natives.js

Issue 8349031: Fixed evaluation order issue in defineProperties. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years, 2 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
« no previous file with comments | « no previous file | test/mjsunit/object-define-properties.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
===================================================================
--- src/v8natives.js (revision 9693)
+++ src/v8natives.js (working copy)
@@ -1078,11 +1078,13 @@
throw MakeTypeError("obj_ctor_property_non_object", ["defineProperties"]);
var props = ToObject(properties);
var names = GetOwnEnumerablePropertyNames(props);
+ var descriptors = new InternalArray();
for (var i = 0; i < names.length; i++) {
- var name = names[i];
- var desc = ToPropertyDescriptor(props[name]);
- DefineOwnProperty(obj, name, desc, true);
+ descriptors.push(ToPropertyDescriptor(props[names[i]]));
}
+ for (var i = 0; i < names.length; i++) {
+ DefineOwnProperty(obj, names[i], descriptors[i], true);
+ }
return obj;
}
« no previous file with comments | « no previous file | test/mjsunit/object-define-properties.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698