OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file relies on the fact that the following declarations have been made | 5 // This file relies on the fact that the following declarations have been made |
6 // in runtime.js: | 6 // in runtime.js: |
7 // var $Object = global.Object; | 7 // var $Object = global.Object; |
8 // var $Boolean = global.Boolean; | 8 // var $Boolean = global.Boolean; |
9 // var $Number = global.Number; | 9 // var $Number = global.Number; |
10 // var $Function = global.Function; | 10 // var $Function = global.Function; |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
966 return DefineObjectProperty(obj, p, desc, should_throw); | 966 return DefineObjectProperty(obj, p, desc, should_throw); |
967 } | 967 } |
968 } | 968 } |
969 | 969 |
970 | 970 |
971 // ES5 section 15.2.3.2. | 971 // ES5 section 15.2.3.2. |
972 function ObjectGetPrototypeOf(obj) { | 972 function ObjectGetPrototypeOf(obj) { |
973 if (!IS_SPEC_OBJECT(obj)) { | 973 if (!IS_SPEC_OBJECT(obj)) { |
974 throw MakeTypeError("called_on_non_object", ["Object.getPrototypeOf"]); | 974 throw MakeTypeError("called_on_non_object", ["Object.getPrototypeOf"]); |
975 } | 975 } |
976 return %GetPrototype(obj); | 976 return %_GetPrototype(obj); |
977 } | 977 } |
978 | 978 |
979 // ES6 section 19.1.2.19. | 979 // ES6 section 19.1.2.19. |
980 function ObjectSetPrototypeOf(obj, proto) { | 980 function ObjectSetPrototypeOf(obj, proto) { |
981 CHECK_OBJECT_COERCIBLE(obj, "Object.setPrototypeOf"); | 981 CHECK_OBJECT_COERCIBLE(obj, "Object.setPrototypeOf"); |
982 | 982 |
983 if (proto !== null && !IS_SPEC_OBJECT(proto)) { | 983 if (proto !== null && !IS_SPEC_OBJECT(proto)) { |
984 throw MakeTypeError("proto_object_or_null", [proto]); | 984 throw MakeTypeError("proto_object_or_null", [proto]); |
985 } | 985 } |
986 | 986 |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1354 | 1354 |
1355 | 1355 |
1356 // ECMA-262, Edition 6, section 19.1.2.10 | 1356 // ECMA-262, Edition 6, section 19.1.2.10 |
1357 function ObjectIs(obj1, obj2) { | 1357 function ObjectIs(obj1, obj2) { |
1358 return SameValue(obj1, obj2); | 1358 return SameValue(obj1, obj2); |
1359 } | 1359 } |
1360 | 1360 |
1361 | 1361 |
1362 // ECMA-262, Edition 6, section B.2.2.1.1 | 1362 // ECMA-262, Edition 6, section B.2.2.1.1 |
1363 function ObjectGetProto() { | 1363 function ObjectGetProto() { |
1364 return %GetPrototype(ToObject(this)); | 1364 return %_GetPrototype(ToObject(this)); |
1365 } | 1365 } |
1366 | 1366 |
1367 | 1367 |
1368 // ECMA-262, Edition 6, section B.2.2.1.2 | 1368 // ECMA-262, Edition 6, section B.2.2.1.2 |
1369 function ObjectSetProto(proto) { | 1369 function ObjectSetProto(proto) { |
1370 CHECK_OBJECT_COERCIBLE(this, "Object.prototype.__proto__"); | 1370 CHECK_OBJECT_COERCIBLE(this, "Object.prototype.__proto__"); |
1371 | 1371 |
1372 if ((IS_SPEC_OBJECT(proto) || IS_NULL(proto)) && IS_SPEC_OBJECT(this)) { | 1372 if ((IS_SPEC_OBJECT(proto) || IS_NULL(proto)) && IS_SPEC_OBJECT(this)) { |
1373 %SetPrototype(this, proto); | 1373 %SetPrototype(this, proto); |
1374 } | 1374 } |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 } | 1890 } |
1891 if (!IS_SPEC_FUNCTION(method)) { | 1891 if (!IS_SPEC_FUNCTION(method)) { |
1892 throw MakeTypeError('not_iterable', [obj]); | 1892 throw MakeTypeError('not_iterable', [obj]); |
1893 } | 1893 } |
1894 var iterator = %_CallFunction(obj, method); | 1894 var iterator = %_CallFunction(obj, method); |
1895 if (!IS_SPEC_OBJECT(iterator)) { | 1895 if (!IS_SPEC_OBJECT(iterator)) { |
1896 throw MakeTypeError('not_an_iterator', [iterator]); | 1896 throw MakeTypeError('not_an_iterator', [iterator]); |
1897 } | 1897 } |
1898 return iterator; | 1898 return iterator; |
1899 } | 1899 } |
OLD | NEW |