OLD | NEW |
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 Loading... |
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 Loading... |
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(); |
OLD | NEW |