Skip to content

Commit

Permalink
Merge pull request #1279 from cxielarko/bigint-constructor
Browse files Browse the repository at this point in the history
Property descriptor tests for BigInt.name, BigInt.length, and BigInt.prototype.constructor
  • Loading branch information
rwaldron authored Oct 16, 2017
2 parents 3c5c0ed + 0d44bc8 commit 339222b
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/built-ins/BigInt/length.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (C) 2017 Robin Templeton. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-bigint-constructor-number-value
description: BigInt.length property descriptor
info: >
BigInt ( value )
17 ECMAScript Standard Built-in Objects
Every built-in function object, including constructors, has a length
property whose value is an integer. Unless otherwise specified, this
value is equal to the largest number of named arguments shown in the
subclause headings for the function description. Optional parameters
(which are indicated with brackets: [ ]) or rest parameters (which
are shown using the form «...name») are not included in the default
argument count.
Unless otherwise specified, the length property of a built-in
function object has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
features: [BigInt]
---*/

verifyProperty(BigInt, "length", {
value: 1,
writable: false,
enumerable: false,
configurable: true
});
31 changes: 31 additions & 0 deletions test/built-ins/BigInt/name.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright (C) 2017 Robin Templeton. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-bigint-constructor-number-value
description: BigInt.name property descriptor
info: >
BigInt ( value )
17 ECMAScript Standard Built-in Objects
Every built-in function object, including constructors, that is not
identified as an anonymous function has a name property whose value
is a String. Unless otherwise specified, this value is the name that
is given to the function in this specification. For functions that
are specified as properties of objects, the name value is the
property name string used to access the function. [...]
Unless otherwise specified, the name property of a built-in function
object, if it exists, has the attributes { [[Writable]]: false,
[[Enumerable]]: false, [[Configurable]]: true }.
includes: [propertyHelper.js]
features: [BigInt]
---*/

verifyProperty(BigInt, "name", {
value: "BigInt",
writable: false,
enumerable: false,
configurable: true
});
29 changes: 29 additions & 0 deletions test/built-ins/BigInt/prototype/constructor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (C) 2017 Robin Templeton. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-bigint.prototype.constructor
description: BigInt.prototype.constructor property descriptor
info: >
BigInt.prototype.constructor
The initial value of BigInt.prototype.constructor is the intrinsic
object %BigInt%.
The BigInt Constructor
The BigInt constructor is the %BigInt% intrinsic object and the
initial value of the BigInt property of the global object. When BigInt
is called as a function, it performs a type conversion.
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
features: [BigInt]
---*/

verifyProperty(BigInt.prototype, "constructor", {
value: BigInt,
writable: true,
enumerable: false,
configurable: true
});

0 comments on commit 339222b

Please sign in to comment.