| 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 |
Return abrupt if argumentsList is not an ArrayLike object. |
| 7 |
info: | |
| 8 |
26.1.1 Reflect.apply ( target, thisArgument, argumentsList ) |
| 9 |
|
| 10 |
... |
| 11 |
2. Let args be CreateListFromArrayLike(argumentsList). |
| 12 |
3. ReturnIfAbrupt(args). |
| 13 |
... |
| 14 |
|
| 15 |
7.3.17 CreateListFromArrayLike (obj [, elementTypes] ) |
| 16 |
|
| 17 |
... |
| 18 |
3. If Type(obj) is not Object, throw a TypeError exception. |
| 19 |
4. Let len be ToLength(Get(obj, "length")). |
| 20 |
5. ReturnIfAbrupt(len). |
| 21 |
... |
| 22 |
---*/ |
| 23 |
|
| 24 |
function fn() {} |
| 25 |
var o = {}; |
| 26 |
|
| 27 |
Object.defineProperty(o, 'length', { |
| 28 |
get: function() { |
| 29 |
throw new Test262Error(); |
| 30 |
} |
| 31 |
}); |
| 32 |
|
| 33 |
assert.throws(Test262Error, function() { |
| 34 |
Reflect.apply(fn, 1, o); |
| 35 |
}); |
| 36 |
|
| 37 |
assert.throws(TypeError, function() { |
| 38 |
Reflect.apply(fn, 1, 1); |
| 39 |
}); |