Reviewers: Michael Starzinger,
Description:
Set up Proxy methods the proper way.
[email protected]
BUG=
Please review this at https://codereview.chromium.org/11274047/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/proxy.js
Index: src/proxy.js
diff --git a/src/proxy.js b/src/proxy.js
index
4e86c8892a3c8d08ef966f70d8485de50a5f10fd..91019d71a151b5d1c73e8896c9bff87de45fd612
100644
--- a/src/proxy.js
+++ b/src/proxy.js
@@ -31,7 +31,7 @@ global.Proxy = new $Object();
var $Proxy = global.Proxy
-$Proxy.create = function(handler, proto) {
+function ProxyCreate(handler, proto) {
if (!IS_SPEC_OBJECT(handler))
throw MakeTypeError("handler_non_object", ["create"])
if (IS_UNDEFINED(proto))
@@ -41,7 +41,7 @@ $Proxy.create = function(handler, proto) {
return %CreateJSProxy(handler, proto)
}
-$Proxy.createFunction = function(handler, callTrap, constructTrap) {
+function ProxyCreateFunction(handler, callTrap, constructTrap) {
if (!IS_SPEC_OBJECT(handler))
throw MakeTypeError("handler_non_object", ["create"])
if (!IS_SPEC_FUNCTION(callTrap))
@@ -62,6 +62,10 @@ $Proxy.createFunction = function(handler, callTrap,
constructTrap) {
handler, callTrap, constructTrap, $Function.prototype)
}
+%InstallFunctions($Proxy, DONT_ENUM, [
+ "create", ProxyCreate,
+ "createFunction", ProxyCreateFunction
+])
////////////////////////////////////////////////////////////////////////////////
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev