summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/module-code/top-level-await/new-await-parens.js
blob: db9ddf76a84d3bea5ff83e18914fcc97e8c3bc17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// |reftest| module async
// Copyright (C) 2020 Rick Waldron. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: prod-AwaitExpression
description: >
  `new (await Constructor)` returns instance of Constructor
flags: [module, async]
features: [top-level-await]
---*/

assert.sameValue((new (await Number)).valueOf(), 0);
assert.sameValue((new (await String)).valueOf(), '');
assert.sameValue((new (await Boolean)).valueOf(), false);
assert.sameValue((new (await Array)).length, 0);
assert.sameValue((new (await Map)).size, 0);
assert.sameValue((new (await Set)).size, 0);

$DONE();