Index: src/proxy.js |
diff --git a/src/proxy.js b/src/proxy.js |
index b16de016a7daf2627053a5621a436638b537e875..1eb24d23cc547cadb628cf29b991952e7d3693f9 100644 |
--- a/src/proxy.js |
+++ b/src/proxy.js |
@@ -27,9 +27,13 @@ |
"use strict"; |
-global.Proxy = new $Object(); |
+// This file relies on the fact that the following declaration has been made |
+// in runtime.js: |
+// var $Object = global.Object; |
-var $Proxy = global.Proxy |
+var $Proxy = new $Object(); |
+ |
+// ------------------------------------------------------------------- |
function ProxyCreate(handler, proto) { |
if (!IS_SPEC_OBJECT(handler)) |
@@ -62,12 +66,6 @@ function ProxyCreateFunction(handler, callTrap, constructTrap) { |
handler, callTrap, constructTrap, $Function.prototype) |
} |
-%CheckIsBootstrapping() |
-InstallFunctions($Proxy, DONT_ENUM, [ |
- "create", ProxyCreate, |
- "createFunction", ProxyCreateFunction |
-]) |
- |
//////////////////////////////////////////////////////////////////////////////// |
// Builtins |
@@ -193,3 +191,20 @@ function ProxyEnumerate(proxy) { |
return ToNameArray(handler.enumerate(), "enumerate", false) |
} |
} |
+ |
+ |
+// ------------------------------------------------------------------- |
+ |
+function SetUpProxy() { |
rossberg
2013/04/11 12:00:18
I don't like separating this from the method defin
Michael Starzinger
2013/04/11 12:08:44
Done (likewise for JSON).
|
+ %CheckIsBootstrapping() |
+ |
+ global.Proxy = $Proxy; |
+ |
+ // Set up non-enumerable properties of the Proxy object. |
+ InstallFunctions($Proxy, DONT_ENUM, [ |
+ "create", ProxyCreate, |
+ "createFunction", ProxyCreateFunction |
+ ]) |
+} |
+ |
+SetUpProxy(); |