test262/test/built-ins/BigInt/new-target-throws.js
André Bargull f95b56ab28 Revert "js-beautify: make all indentation consistent (depth & character) (#1409)" (#1412)
This reverts commit a01de4a722d088055a7d84d8c691ddd7109edb34.
2018-02-09 12:09:47 -05:00

22 lines
531 B
JavaScript

// Copyright (C) 2017 Robin Templeton. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Throws a TypeError if BigInt is called with a new target
esid: sec-bigint-constructor
info: |
1. If NewTarget is not undefined, throw a TypeError exception.
...
features: [BigInt]
---*/
assert.throws(TypeError, function() {
new BigInt();
});
assert.throws(TypeError, function() {
new BigInt({
valueOf: function() { throw new Test262Error("unreachable"); }
});
});