summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Promise/allSettled/ctx-non-ctor.js
blob: 3850884632a8e85d8f199ece42abc337a06ad847 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (C) 2019 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
description: >
  Promise.allSettled invoked on a non-constructor value
esid: sec-promise.allsettled
info: |
  ...
  3. Let promiseCapability be ? NewPromiseCapability(C).

  NewPromiseCapability ( C )

  1. If IsConstructor(C) is false, throw a TypeError exception.
features: [Promise.allSettled]
---*/

assert.throws(TypeError, function() {
  Promise.allSettled.call(eval);
});

reportCompare(0, 0);