test262/test/built-ins/Proxy/create-target-is-not-callab...

27 lines
690 B
JavaScript
Raw Normal View History

2015-06-02 22:44:33 +02:00
// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
2020-03-28 15:41:43 +01:00
esid: sec-proxycreate
2015-06-02 22:44:33 +02:00
description: >
A Proxy exotic object is only callable if the given target is callable.
info: |
2015-06-02 22:44:33 +02:00
Proxy ( target, handler )
7. If IsCallable(target) is true, then
a. Set the [[Call]] internal method of P as specified in 9.5.13.
...
12.3.4.3 Runtime Semantics: EvaluateDirectCall( func, thisValue, arguments,
tailPosition )
4. If IsCallable(func) is false, throw a TypeError exception.
features: [Proxy]
2015-06-02 22:44:33 +02:00
---*/
var p = new Proxy({}, {});
assert.throws(TypeError, function() {
2020-03-28 15:41:43 +01:00
p();
2015-06-02 22:44:33 +02:00
});