[runtime] Cleanup native methods creation in js/proxy.js.
This CL replaces usages of utils.InstallFunctions and utils.InstallGetter() with the DEFINE_METHOD* macros that ensure that the native function is created in proper form from the beginning. Thus the function will not require further reconfiguring like adding a computed name or removing of 'prototype' property. This CL is one of a series of cleanup CL which are the preliminary steps for improving function closures creation. Bug: v8:6459 Change-Id: Ic78aa448ffee2cd6edf2d18fd303a34a065ff95a Reviewed-on: https://chromium-review.googlesource.com/548176 Commit-Queue: Igor Sheludko <ishell@chromium.org> Reviewed-by: Toon Verwaest <verwaest@chromium.org> Cr-Commit-Position: refs/heads/master@{#46298}
This commit is contained in:
parent
eb735f3d06
commit
1737ad4439
@ -15,16 +15,13 @@ var GlobalProxy = global.Proxy;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
function ProxyCreateRevocable(target, handler) {
|
||||
var p = new GlobalProxy(target, handler);
|
||||
return {proxy: p, revoke: () => %JSProxyRevoke(p)};
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//Set up non-enumerable properties of the Proxy object.
|
||||
utils.InstallFunctions(GlobalProxy, DONT_ENUM, [
|
||||
"revocable", ProxyCreateRevocable
|
||||
]);
|
||||
DEFINE_METHOD(
|
||||
GlobalProxy,
|
||||
revocable(target, handler) {
|
||||
var p = new GlobalProxy(target, handler);
|
||||
return {proxy: p, revoke: () => %JSProxyRevoke(p)};
|
||||
}
|
||||
);
|
||||
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user