1// 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// Flags: --harmony-proxies --harmony-reflect 6 7 8traps = [ 9 "getPrototypeOf", "setPrototypeOf", "isExtensible", "preventExtensions", 10 "getOwnPropertyDescriptor", "has", "get", "set", "deleteProperty", 11 "defineProperty", "ownKeys", "apply", "construct" 12]; 13// TODO(neis): Fix enumerate. 14 15var {proxy, revoke} = Proxy.revocable({}, {}); 16assertEquals(0, revoke.length); 17 18assertEquals(undefined, revoke()); 19for (var trap of traps) { 20 assertThrows(() => Reflect[trap](proxy), TypeError); 21} 22 23assertEquals(undefined, revoke()); 24for (var trap of traps) { 25 assertThrows(() => Reflect[trap](proxy), TypeError); 26} 27