| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 return %CreateJSFunctionProxy( | 65 return %CreateJSFunctionProxy( |
| 66 handler, callTrap, constructTrap, $Function.prototype) | 66 handler, callTrap, constructTrap, $Function.prototype) |
| 67 } | 67 } |
| 68 | 68 |
| 69 | 69 |
| 70 // ------------------------------------------------------------------- | 70 // ------------------------------------------------------------------- |
| 71 | 71 |
| 72 function SetUpProxy() { | 72 function SetUpProxy() { |
| 73 %CheckIsBootstrapping() | 73 %CheckIsBootstrapping() |
| 74 | 74 |
| 75 global.Proxy = $Proxy; | 75 var global_receiver = %GlobalReceiver(global); |
| 76 global_receiver.Proxy = $Proxy; |
| 76 | 77 |
| 77 // Set up non-enumerable properties of the Proxy object. | 78 // Set up non-enumerable properties of the Proxy object. |
| 78 InstallFunctions($Proxy, DONT_ENUM, [ | 79 InstallFunctions($Proxy, DONT_ENUM, [ |
| 79 "create", ProxyCreate, | 80 "create", ProxyCreate, |
| 80 "createFunction", ProxyCreateFunction | 81 "createFunction", ProxyCreateFunction |
| 81 ]) | 82 ]) |
| 82 } | 83 } |
| 83 | 84 |
| 84 SetUpProxy(); | 85 SetUpProxy(); |
| 85 | 86 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 } | 205 } |
| 205 | 206 |
| 206 function ProxyEnumerate(proxy) { | 207 function ProxyEnumerate(proxy) { |
| 207 var handler = %GetHandler(proxy) | 208 var handler = %GetHandler(proxy) |
| 208 if (IS_UNDEFINED(handler.enumerate)) { | 209 if (IS_UNDEFINED(handler.enumerate)) { |
| 209 return %Apply(DerivedEnumerateTrap, handler, [], 0, 0) | 210 return %Apply(DerivedEnumerateTrap, handler, [], 0, 0) |
| 210 } else { | 211 } else { |
| 211 return ToNameArray(handler.enumerate(), "enumerate", false) | 212 return ToNameArray(handler.enumerate(), "enumerate", false) |
| 212 } | 213 } |
| 213 } | 214 } |
| OLD | NEW |