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

Side by Side Diff: src/v8natives.js

Issue 13914003: Fix detection of indexed properties in Object.defineProperty() (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 8 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/object-define-property.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 932 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 if (updated || reconfigured) { 943 if (updated || reconfigured) {
944 NotifyChange(reconfigured ? "reconfigured" : "updated", 944 NotifyChange(reconfigured ? "reconfigured" : "updated",
945 obj, "length", length_desc.value_); 945 obj, "length", length_desc.value_);
946 } 946 }
947 } 947 }
948 return true; 948 return true;
949 } 949 }
950 950
951 // Step 4 - Special handling for array index. 951 // Step 4 - Special handling for array index.
952 var index = ToUint32(p); 952 var index = ToUint32(p);
953 if (index == ToNumber(p) && index != 4294967295) { 953 if (ToString(index) == p && index != 4294967295) {
954 var length = obj.length; 954 var length = obj.length;
955 var length_desc = GetOwnProperty(obj, "length"); 955 var length_desc = GetOwnProperty(obj, "length");
956 if ((index >= length && !length_desc.isWritable()) || 956 if ((index >= length && !length_desc.isWritable()) ||
957 !DefineObjectProperty(obj, p, desc, true)) { 957 !DefineObjectProperty(obj, p, desc, true)) {
958 if (should_throw) { 958 if (should_throw) {
959 throw MakeTypeError("define_disallowed", [p]); 959 throw MakeTypeError("define_disallowed", [p]);
960 } else { 960 } else {
961 return false; 961 return false;
962 } 962 }
963 } 963 }
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
1790 1790
1791 function SetUpFunction() { 1791 function SetUpFunction() {
1792 %CheckIsBootstrapping(); 1792 %CheckIsBootstrapping();
1793 InstallFunctions($Function.prototype, DONT_ENUM, $Array( 1793 InstallFunctions($Function.prototype, DONT_ENUM, $Array(
1794 "bind", FunctionBind, 1794 "bind", FunctionBind,
1795 "toString", FunctionToString 1795 "toString", FunctionToString
1796 )); 1796 ));
1797 } 1797 }
1798 1798
1799 SetUpFunction(); 1799 SetUpFunction();
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/object-define-property.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698