OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 "use strict"; | 5 "use strict"; |
6 | 6 |
7 // This file relies on the fact that the following declaration has been made | 7 // This file relies on the fact that the following declaration has been made |
8 // in runtime.js: | 8 // in runtime.js: |
9 // var $Object = global.Object; | 9 // var $Object = global.Object; |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 return %CreateJSFunctionProxy( | 42 return %CreateJSFunctionProxy( |
43 handler, callTrap, constructTrap, $Function.prototype) | 43 handler, callTrap, constructTrap, $Function.prototype) |
44 } | 44 } |
45 | 45 |
46 | 46 |
47 // ------------------------------------------------------------------- | 47 // ------------------------------------------------------------------- |
48 | 48 |
49 function SetUpProxy() { | 49 function SetUpProxy() { |
50 %CheckIsBootstrapping() | 50 %CheckIsBootstrapping() |
51 | 51 |
52 var global_receiver = %GlobalReceiver(global); | 52 var global_proxy = %GlobalProxy(global); |
53 global_receiver.Proxy = $Proxy; | 53 global_proxy.Proxy = $Proxy; |
54 | 54 |
55 // Set up non-enumerable properties of the Proxy object. | 55 // Set up non-enumerable properties of the Proxy object. |
56 InstallFunctions($Proxy, DONT_ENUM, [ | 56 InstallFunctions($Proxy, DONT_ENUM, [ |
57 "create", ProxyCreate, | 57 "create", ProxyCreate, |
58 "createFunction", ProxyCreateFunction | 58 "createFunction", ProxyCreateFunction |
59 ]) | 59 ]) |
60 } | 60 } |
61 | 61 |
62 SetUpProxy(); | 62 SetUpProxy(); |
63 | 63 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 182 } |
183 | 183 |
184 function ProxyEnumerate(proxy) { | 184 function ProxyEnumerate(proxy) { |
185 var handler = %GetHandler(proxy) | 185 var handler = %GetHandler(proxy) |
186 if (IS_UNDEFINED(handler.enumerate)) { | 186 if (IS_UNDEFINED(handler.enumerate)) { |
187 return %Apply(DerivedEnumerateTrap, handler, [], 0, 0) | 187 return %Apply(DerivedEnumerateTrap, handler, [], 0, 0) |
188 } else { | 188 } else { |
189 return ToNameArray(handler.enumerate(), "enumerate", false) | 189 return ToNameArray(handler.enumerate(), "enumerate", false) |
190 } | 190 } |
191 } | 191 } |
OLD | NEW |