tests/auto/qml/ecmascripttests/test262/test/built-ins/Promise/reject/ctx-non-ctor.js
raw| 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.reject` invoked on a non-constructor value |
| 7 | es6id: 25.4.4.4 |
| 8 | info: | |
| 9 | [...] |
| 10 | 3. Let promiseCapability be NewPromiseCapability(C). |
| 11 | 4. ReturnIfAbrupt(promiseCapability). |
| 12 | ---*/ |
| 13 | |
| 14 | assert.throws(TypeError, function() { |
| 15 | Promise.reject.call(eval); |
| 16 | }); |