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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 204 |
205 function ObjectLookupSetter(name) { | 205 function ObjectLookupSetter(name) { |
206 var receiver = this; | 206 var receiver = this; |
207 if (IS_NULL(receiver) || IS_UNDEFINED(receiver)) { | 207 if (IS_NULL(receiver) || IS_UNDEFINED(receiver)) { |
208 receiver = %GlobalProxy(ObjectLookupSetter); | 208 receiver = %GlobalProxy(ObjectLookupSetter); |
209 } | 209 } |
210 return %LookupAccessor(TO_OBJECT(receiver), TO_NAME(name), SETTER); | 210 return %LookupAccessor(TO_OBJECT(receiver), TO_NAME(name), SETTER); |
211 } | 211 } |
212 | 212 |
213 | 213 |
214 function ObjectKeys(obj) { | |
215 obj = TO_OBJECT(obj); | |
216 var filter = PROPERTY_FILTER_ONLY_ENUMERABLE | PROPERTY_FILTER_SKIP_SYMBOLS; | |
217 return %GetOwnPropertyKeys(obj, filter); | |
218 } | |
219 | |
220 | |
221 // ES6 6.2.4.1 | 214 // ES6 6.2.4.1 |
222 function IsAccessorDescriptor(desc) { | 215 function IsAccessorDescriptor(desc) { |
223 if (IS_UNDEFINED(desc)) return false; | 216 if (IS_UNDEFINED(desc)) return false; |
224 return desc.hasGetter() || desc.hasSetter(); | 217 return desc.hasGetter() || desc.hasSetter(); |
225 } | 218 } |
226 | 219 |
227 | 220 |
228 // ES6 6.2.4.2 | 221 // ES6 6.2.4.2 |
229 function IsDataDescriptor(desc) { | 222 function IsDataDescriptor(desc) { |
230 if (IS_UNDEFINED(desc)) return false; | 223 if (IS_UNDEFINED(desc)) return false; |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 "__lookupGetter__", ObjectLookupGetter, | 878 "__lookupGetter__", ObjectLookupGetter, |
886 "__defineSetter__", ObjectDefineSetter, | 879 "__defineSetter__", ObjectDefineSetter, |
887 "__lookupSetter__", ObjectLookupSetter | 880 "__lookupSetter__", ObjectLookupSetter |
888 ]); | 881 ]); |
889 utils.InstallGetterSetter(GlobalObject.prototype, "__proto__", ObjectGetProto, | 882 utils.InstallGetterSetter(GlobalObject.prototype, "__proto__", ObjectGetProto, |
890 ObjectSetProto); | 883 ObjectSetProto); |
891 | 884 |
892 // Set up non-enumerable functions in the Object object. | 885 // Set up non-enumerable functions in the Object object. |
893 utils.InstallFunctions(GlobalObject, DONT_ENUM, [ | 886 utils.InstallFunctions(GlobalObject, DONT_ENUM, [ |
894 // assign is added in bootstrapper.cc. | 887 // assign is added in bootstrapper.cc. |
895 "keys", ObjectKeys, | 888 // keys is added in bootstrapper.cc. |
896 "defineProperty", ObjectDefineProperty, | 889 "defineProperty", ObjectDefineProperty, |
897 "defineProperties", ObjectDefineProperties, | 890 "defineProperties", ObjectDefineProperties, |
898 "getPrototypeOf", ObjectGetPrototypeOf, | 891 "getPrototypeOf", ObjectGetPrototypeOf, |
899 "setPrototypeOf", ObjectSetPrototypeOf, | 892 "setPrototypeOf", ObjectSetPrototypeOf, |
900 "getOwnPropertyDescriptor", ObjectGetOwnPropertyDescriptor, | 893 "getOwnPropertyDescriptor", ObjectGetOwnPropertyDescriptor, |
901 "getOwnPropertyNames", ObjectGetOwnPropertyNames, | 894 "getOwnPropertyNames", ObjectGetOwnPropertyNames, |
902 // getOwnPropertySymbols is added in symbol.js. | 895 // getOwnPropertySymbols is added in symbol.js. |
903 "is", SameValue, // ECMA-262, Edition 6, section 19.1.2.10 | 896 "is", SameValue, // ECMA-262, Edition 6, section 19.1.2.10 |
904 // deliverChangeRecords, getNotifier, observe and unobserve are added | 897 // deliverChangeRecords, getNotifier, observe and unobserve are added |
905 // in object-observe.js. | 898 // in object-observe.js. |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 | 1196 |
1204 utils.Export(function(to) { | 1197 utils.Export(function(to) { |
1205 to.GetIterator = GetIterator; | 1198 to.GetIterator = GetIterator; |
1206 to.GetMethod = GetMethod; | 1199 to.GetMethod = GetMethod; |
1207 to.IsFinite = GlobalIsFinite; | 1200 to.IsFinite = GlobalIsFinite; |
1208 to.IsNaN = GlobalIsNaN; | 1201 to.IsNaN = GlobalIsNaN; |
1209 to.NumberIsNaN = NumberIsNaN; | 1202 to.NumberIsNaN = NumberIsNaN; |
1210 to.ObjectDefineProperties = ObjectDefineProperties; | 1203 to.ObjectDefineProperties = ObjectDefineProperties; |
1211 to.ObjectDefineProperty = ObjectDefineProperty; | 1204 to.ObjectDefineProperty = ObjectDefineProperty; |
1212 to.ObjectHasOwnProperty = ObjectHasOwnProperty; | 1205 to.ObjectHasOwnProperty = ObjectHasOwnProperty; |
1213 to.ObjectKeys = ObjectKeys; | |
1214 }); | 1206 }); |
1215 | 1207 |
1216 %InstallToContext([ | 1208 %InstallToContext([ |
1217 "object_value_of", ObjectValueOf, | 1209 "object_value_of", ObjectValueOf, |
1218 ]); | 1210 ]); |
1219 | 1211 |
1220 }) | 1212 }) |
OLD | NEW |