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 26 matching lines...) Expand all Loading... |
37 writeable: true, | 37 writeable: true, |
38 configurable: true, | 38 configurable: true, |
39 enumerable: false }); | 39 enumerable: false }); |
40 %FunctionSetName(f, name); | 40 %FunctionSetName(f, name); |
41 %FunctionRemovePrototype(f); | 41 %FunctionRemovePrototype(f); |
42 %SetNativeFlag(f); | 42 %SetNativeFlag(f); |
43 } | 43 } |
44 | 44 |
45 | 45 |
46 // Helper function to install a getter-only accessor property. | 46 // Helper function to install a getter-only accessor property. |
47 function InstallGetter(object, name, getter) { | 47 function InstallGetter(object, name, getter, attributes) { |
| 48 if (typeof attributes == "undefined") { |
| 49 attributes = DONT_ENUM; |
| 50 } |
48 %FunctionSetName(getter, name); | 51 %FunctionSetName(getter, name); |
49 %FunctionRemovePrototype(getter); | 52 %FunctionRemovePrototype(getter); |
50 %DefineAccessorPropertyUnchecked(object, name, getter, null, DONT_ENUM); | 53 %DefineAccessorPropertyUnchecked(object, name, getter, null, attributes); |
51 %SetNativeFlag(getter); | 54 %SetNativeFlag(getter); |
52 } | 55 } |
53 | 56 |
54 | 57 |
55 // Helper function to install a getter/setter accessor property. | 58 // Helper function to install a getter/setter accessor property. |
56 function InstallGetterSetter(object, name, getter, setter) { | 59 function InstallGetterSetter(object, name, getter, setter) { |
57 %FunctionSetName(getter, name); | 60 %FunctionSetName(getter, name); |
58 %FunctionSetName(setter, name); | 61 %FunctionSetName(setter, name); |
59 %FunctionRemovePrototype(getter); | 62 %FunctionRemovePrototype(getter); |
60 %FunctionRemovePrototype(setter); | 63 %FunctionRemovePrototype(setter); |
(...skipping 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1894 } | 1897 } |
1895 if (!IS_SPEC_FUNCTION(method)) { | 1898 if (!IS_SPEC_FUNCTION(method)) { |
1896 throw MakeTypeError('not_iterable', [obj]); | 1899 throw MakeTypeError('not_iterable', [obj]); |
1897 } | 1900 } |
1898 var iterator = %_CallFunction(obj, method); | 1901 var iterator = %_CallFunction(obj, method); |
1899 if (!IS_SPEC_OBJECT(iterator)) { | 1902 if (!IS_SPEC_OBJECT(iterator)) { |
1900 throw MakeTypeError('not_an_iterator', [iterator]); | 1903 throw MakeTypeError('not_an_iterator', [iterator]); |
1901 } | 1904 } |
1902 return iterator; | 1905 return iterator; |
1903 } | 1906 } |
OLD | NEW |