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

Unified Diff: src/proxy.js

Issue 1075773003: Wrap proxy.js in a function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 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
« no previous file with comments | « src/bootstrapper.cc ('k') | src/v8natives.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/proxy.js
diff --git a/src/proxy.js b/src/proxy.js
index 0776eeae8f979302b38630b96374863b98ed9335..9f02705e37acdca5808a4c3f08d23be6ad335d2c 100644
--- a/src/proxy.js
+++ b/src/proxy.js
@@ -2,13 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+var $proxyDelegateCallAndConstruct;
+var $proxyDerivedGetTrap;
+var $proxyDerivedHasTrap;
+var $proxyDerivedHasOwnTrap;
+var $proxyDerivedKeysTrap;
+var $proxyDerivedSetTrap;
+var $proxyEnumerate;
+
+(function() {
+
"use strict";
rossberg 2015/04/10 11:00:28 DBC: is there a reason not to leave this at the to
Yang 2015/04/10 11:05:11 I'm considering the option of concatenating all (n
-// This file relies on the fact that the following declaration has been made
-// in runtime.js:
-// var $Object = global.Object;
+%CheckIsBootstrapping();
-var $Proxy = new $Object();
+var GlobalObject = global.Object;
// -------------------------------------------------------------------
@@ -43,25 +51,6 @@ function ProxyCreateFunction(handler, callTrap, constructTrap) {
handler, callTrap, constructTrap, $Function.prototype)
}
-
-// -------------------------------------------------------------------
-
-function SetUpProxy() {
- %CheckIsBootstrapping()
-
- var global_proxy = %GlobalProxy(global);
- global_proxy.Proxy = $Proxy;
-
- // Set up non-enumerable properties of the Proxy object.
- InstallFunctions($Proxy, DONT_ENUM, [
- "create", ProxyCreate,
- "createFunction", ProxyCreateFunction
- ])
-}
-
-SetUpProxy();
-
-
// -------------------------------------------------------------------
// Proxy Builtins
@@ -189,3 +178,24 @@ function ProxyEnumerate(proxy) {
return ToNameArray(handler.enumerate(), "enumerate", false)
}
}
+
+//-------------------------------------------------------------------
+
+var Proxy = new GlobalObject();
+%AddNamedProperty(global, "Proxy", Proxy, DONT_ENUM);
+
+//Set up non-enumerable properties of the Proxy object.
+InstallFunctions(Proxy, DONT_ENUM, [
+ "create", ProxyCreate,
+ "createFunction", ProxyCreateFunction
+])
+
+$proxyDelegateCallAndConstruct = DelegateCallAndConstruct;
+$proxyDerivedGetTrap = DerivedGetTrap;
+$proxyDerivedHasTrap = DerivedHasTrap;
+$proxyDerivedHasOwnTrap = DerivedHasOwnTrap;
+$proxyDerivedKeysTrap = DerivedKeysTrap;
+$proxyDerivedSetTrap = DerivedSetTrap;
+$proxyEnumerate = ProxyEnumerate;
+
+})();
« no previous file with comments | « src/bootstrapper.cc ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698