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

Side by Side Diff: src/v8natives.js

Issue 7631039: Use InternalArray in Object.defineProperties to avoid issues with overwriten properties on Array.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1625.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 } 1013 }
1014 return obj; 1014 return obj;
1015 } 1015 }
1016 1016
1017 1017
1018 // ES5 section 15.2.3.7. 1018 // ES5 section 15.2.3.7.
1019 function ObjectDefineProperties(obj, properties) { 1019 function ObjectDefineProperties(obj, properties) {
1020 if (!IS_SPEC_OBJECT(obj)) 1020 if (!IS_SPEC_OBJECT(obj))
1021 throw MakeTypeError("obj_ctor_property_non_object", ["defineProperties"]); 1021 throw MakeTypeError("obj_ctor_property_non_object", ["defineProperties"]);
1022 var props = ToObject(properties); 1022 var props = ToObject(properties);
1023 var key_values = []; 1023 var key_values = new InternalArray();
1024 for (var key in props) { 1024 for (var key in props) {
Lasse Reichstein 2011/08/18 06:56:41 How about making a way to find all own properties
1025 if (%HasLocalProperty(props, key)) { 1025 if (%HasLocalProperty(props, key)) {
1026 key_values.push(key); 1026 key_values.push(key);
1027 var value = props[key]; 1027 var value = props[key];
1028 var desc = ToPropertyDescriptor(value); 1028 var desc = ToPropertyDescriptor(value);
1029 key_values.push(desc); 1029 key_values.push(desc);
1030 } 1030 }
1031 } 1031 }
1032 for (var i = 0; i < key_values.length; i += 2) { 1032 for (var i = 0; i < key_values.length; i += 2) {
1033 var key = key_values[i]; 1033 var key = key_values[i];
1034 var desc = key_values[i + 1]; 1034 var desc = key_values[i + 1];
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 // ---------------------------------------------------------------------------- 1534 // ----------------------------------------------------------------------------
1535 1535
1536 function SetupFunction() { 1536 function SetupFunction() {
1537 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1537 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1538 "bind", FunctionBind, 1538 "bind", FunctionBind,
1539 "toString", FunctionToString 1539 "toString", FunctionToString
1540 )); 1540 ));
1541 } 1541 }
1542 1542
1543 SetupFunction(); 1543 SetupFunction();
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-1625.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698