| 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 (function(global, utils) { | 5 (function(global, utils) { |
| 6 | 6 |
| 7 %CheckIsBootstrapping(); | 7 %CheckIsBootstrapping(); |
| 8 | 8 |
| 9 // ---------------------------------------------------------------------------- | 9 // ---------------------------------------------------------------------------- |
| 10 // Imports | 10 // Imports |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 return this.toString(); | 127 return this.toString(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 | 130 |
| 131 // ES6 19.1.3.7 Object.prototype.valueOf() | 131 // ES6 19.1.3.7 Object.prototype.valueOf() |
| 132 function ObjectValueOf() { | 132 function ObjectValueOf() { |
| 133 return TO_OBJECT(this); | 133 return TO_OBJECT(this); |
| 134 } | 134 } |
| 135 | 135 |
| 136 | 136 |
| 137 // ES6 7.3.11 | |
| 138 function ObjectHasOwnProperty(value) { | |
| 139 var name = TO_NAME(value); | |
| 140 var object = TO_OBJECT(this); | |
| 141 return %HasOwnProperty(object, name); | |
| 142 } | |
| 143 | |
| 144 | |
| 145 // ES6 19.1.3.3 Object.prototype.isPrototypeOf(V) | 137 // ES6 19.1.3.3 Object.prototype.isPrototypeOf(V) |
| 146 function ObjectIsPrototypeOf(V) { | 138 function ObjectIsPrototypeOf(V) { |
| 147 if (!IS_RECEIVER(V)) return false; | 139 if (!IS_RECEIVER(V)) return false; |
| 148 var O = TO_OBJECT(this); | 140 var O = TO_OBJECT(this); |
| 149 return %HasInPrototypeChain(V, O); | 141 return %HasInPrototypeChain(V, O); |
| 150 } | 142 } |
| 151 | 143 |
| 152 | 144 |
| 153 // ES6 19.1.3.4 | 145 // ES6 19.1.3.4 |
| 154 function ObjectPropertyIsEnumerable(V) { | 146 function ObjectPropertyIsEnumerable(V) { |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 %SetCode(GlobalObject, ObjectConstructor); | 835 %SetCode(GlobalObject, ObjectConstructor); |
| 844 | 836 |
| 845 %AddNamedProperty(GlobalObject.prototype, "constructor", GlobalObject, | 837 %AddNamedProperty(GlobalObject.prototype, "constructor", GlobalObject, |
| 846 DONT_ENUM); | 838 DONT_ENUM); |
| 847 | 839 |
| 848 // Set up non-enumerable functions on the Object.prototype object. | 840 // Set up non-enumerable functions on the Object.prototype object. |
| 849 utils.InstallFunctions(GlobalObject.prototype, DONT_ENUM, [ | 841 utils.InstallFunctions(GlobalObject.prototype, DONT_ENUM, [ |
| 850 "toString", ObjectToString, | 842 "toString", ObjectToString, |
| 851 "toLocaleString", ObjectToLocaleString, | 843 "toLocaleString", ObjectToLocaleString, |
| 852 "valueOf", ObjectValueOf, | 844 "valueOf", ObjectValueOf, |
| 853 "hasOwnProperty", ObjectHasOwnProperty, | |
| 854 "isPrototypeOf", ObjectIsPrototypeOf, | 845 "isPrototypeOf", ObjectIsPrototypeOf, |
| 855 "propertyIsEnumerable", ObjectPropertyIsEnumerable, | 846 "propertyIsEnumerable", ObjectPropertyIsEnumerable, |
| 856 "__defineGetter__", ObjectDefineGetter, | 847 "__defineGetter__", ObjectDefineGetter, |
| 857 "__lookupGetter__", ObjectLookupGetter, | 848 "__lookupGetter__", ObjectLookupGetter, |
| 858 "__defineSetter__", ObjectDefineSetter, | 849 "__defineSetter__", ObjectDefineSetter, |
| 859 "__lookupSetter__", ObjectLookupSetter | 850 "__lookupSetter__", ObjectLookupSetter |
| 860 ]); | 851 ]); |
| 861 utils.InstallGetterSetter(GlobalObject.prototype, "__proto__", ObjectGetProto, | 852 utils.InstallGetterSetter(GlobalObject.prototype, "__proto__", ObjectGetProto, |
| 862 ObjectSetProto); | 853 ObjectSetProto); |
| 863 | 854 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 // Exports | 1092 // Exports |
| 1102 | 1093 |
| 1103 utils.Export(function(to) { | 1094 utils.Export(function(to) { |
| 1104 to.GetIterator = GetIterator; | 1095 to.GetIterator = GetIterator; |
| 1105 to.GetMethod = GetMethod; | 1096 to.GetMethod = GetMethod; |
| 1106 to.IsFinite = GlobalIsFinite; | 1097 to.IsFinite = GlobalIsFinite; |
| 1107 to.IsNaN = GlobalIsNaN; | 1098 to.IsNaN = GlobalIsNaN; |
| 1108 to.NumberIsNaN = NumberIsNaN; | 1099 to.NumberIsNaN = NumberIsNaN; |
| 1109 to.ObjectDefineProperties = ObjectDefineProperties; | 1100 to.ObjectDefineProperties = ObjectDefineProperties; |
| 1110 to.ObjectDefineProperty = ObjectDefineProperty; | 1101 to.ObjectDefineProperty = ObjectDefineProperty; |
| 1111 to.ObjectHasOwnProperty = ObjectHasOwnProperty; | 1102 to.ObjectHasOwnProperty = GlobalObject.prototype.hasOwnProperty; |
| 1112 }); | 1103 }); |
| 1113 | 1104 |
| 1114 %InstallToContext([ | 1105 %InstallToContext([ |
| 1115 "object_value_of", ObjectValueOf, | 1106 "object_value_of", ObjectValueOf, |
| 1116 ]); | 1107 ]); |
| 1117 | 1108 |
| 1118 }) | 1109 }) |
| OLD | NEW |