blob: a111c0942725a5e578b145c55ad456e32f31dff7 [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// Copyright 2015 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5(function(global, utils) {
6
7"use strict";
8
9%CheckIsBootstrapping();
10
11// ----------------------------------------------------------------------------
12// Imports
13//
14var GlobalProxy = global.Proxy;
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000015
16//----------------------------------------------------------------------------
17
18function ProxyCreateRevocable(target, handler) {
19 var p = new GlobalProxy(target, handler);
20 return {proxy: p, revoke: () => %JSProxyRevoke(p)};
21}
22
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000023//-------------------------------------------------------------------
24
25//Set up non-enumerable properties of the Proxy object.
26utils.InstallFunctions(GlobalProxy, DONT_ENUM, [
27 "revocable", ProxyCreateRevocable
28]);
29
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000030})