create-target-is-not-callable.js (712B)
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-proxycreate 5 description: > 6 A Proxy exotic object is only callable if the given target is callable. 7 info: | 8 Proxy ( target, handler ) 9 10 7. If IsCallable(target) is true, then 11 a. Set the [[Call]] internal method of P as specified in 9.5.13. 12 ... 13 14 15 12.3.4.3 Runtime Semantics: EvaluateDirectCall( func, thisValue, arguments, 16 tailPosition ) 17 18 4. If IsCallable(func) is false, throw a TypeError exception. 19 features: [Proxy] 20 ---*/ 21 22 var p = new Proxy({}, {}); 23 24 assert.throws(TypeError, function() { 25 p(); 26 }); 27 28 reportCompare(0, 0);