| 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 |
es6id: 26.1.1 |
| 5 |
description: > |
| 6 |
Throws a TypeError if `target` is not callable. |
| 7 |
info: | |
| 8 |
26.1.1 Reflect.apply ( target, thisArgument, argumentsList ) |
| 9 |
|
| 10 |
1. If IsCallable(target) is false, throw a TypeError exception. |
| 11 |
... |
| 12 |
|
| 13 |
7.2.3 IsCallable ( argument ) |
| 14 |
|
| 15 |
1. ReturnIfAbrupt(argument). |
| 16 |
2. If Type(argument) is not Object, return false. |
| 17 |
3. If argument has a [[Call]] internal method, return true. |
| 18 |
4. Return false. |
| 19 |
---*/ |
| 20 |
|
| 21 |
assert.throws(TypeError, function() { |
| 22 |
Reflect.apply(1, 1, []); |
| 23 |
}); |
| 24 |
|
| 25 |
assert.throws(TypeError, function() { |
| 26 |
Reflect.apply(null, 1, []); |
| 27 |
}); |
| 28 |
|
| 29 |
assert.throws(TypeError, function() { |
| 30 |
Reflect.apply({}, 1, []); |
| 31 |
}); |