Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Unified Diff: src/proxy.js

Issue 14125004: Move global code for builtins into setup functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Even more. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();

Powered by Google App Engine
This is Rietveld 408576698