trap-is-not-callable.js (632B)
1 // Copyright (C) 2015 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys 5 description: > 6 Trap is not callable. 7 info: | 8 [[OwnPropertyKeys]] ( ) 9 10 5. Let trap be ? GetMethod(handler, "ownKeys"). 11 ... 12 13 #sec-getmethod 14 7.3.9 GetMethod (O, P) 15 16 4. If IsCallable(func) is false, throw a TypeError exception. 17 features: [Proxy] 18 ---*/ 19 20 var p = new Proxy({ 21 attr: 1 22 }, { 23 ownKeys: {} 24 }); 25 26 assert.throws(TypeError, function() { 27 Object.keys(p); 28 }); 29 30 reportCompare(0, 0);