| 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 |
/*--- |
| 5 |
description: > |
| 6 |
`Promise.race` invoked on a non-object value |
| 7 |
es6id: 25.4.4.3 |
| 8 |
info: | |
| 9 |
1. Let C be the this value. |
| 10 |
2. If Type(C) is not Object, throw a TypeError exception. |
| 11 |
features: [Symbol] |
| 12 |
---*/ |
| 13 |
|
| 14 |
assert.throws(TypeError, function() { |
| 15 |
Promise.race.call(undefined, []); |
| 16 |
}); |
| 17 |
|
| 18 |
assert.throws(TypeError, function() { |
| 19 |
Promise.race.call(null, []); |
| 20 |
}); |
| 21 |
|
| 22 |
assert.throws(TypeError, function() { |
| 23 |
Promise.race.call(86, []); |
| 24 |
}); |
| 25 |
|
| 26 |
assert.throws(TypeError, function() { |
| 27 |
Promise.race.call('string', []); |
| 28 |
}); |
| 29 |
|
| 30 |
assert.throws(TypeError, function() { |
| 31 |
Promise.race.call(true, []); |
| 32 |
}); |
| 33 |
|
| 34 |
assert.throws(TypeError, function() { |
| 35 |
Promise.race.call(Symbol(), []); |
| 36 |
}); |