-
Notifications
You must be signed in to change notification settings - Fork 444
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split Array.prototype.Symbol.unscopables tests for features
- Loading branch information
1 parent
d8fb00d
commit 50dc96e
Showing
3 changed files
with
71 additions
and
33 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
test/built-ins/Array/prototype/Symbol.unscopables/array-find-from-last.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (C) 2022 Microsoft. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
/*--- | ||
esid: sec-array.prototype-@@unscopables | ||
description: > | ||
Initial value of `Symbol.unscopables` property | ||
info: | | ||
22.1.3.32 Array.prototype [ @@unscopables ] | ||
... | ||
7. Perform CreateDataProperty(unscopableList, "findLast", true). | ||
8. Perform CreateDataProperty(unscopableList, "findLastIndex", true). | ||
... | ||
includes: [propertyHelper.js] | ||
features: [Symbol.unscopables, array-find-from-last] | ||
---*/ | ||
|
||
var unscopables = Array.prototype[Symbol.unscopables]; | ||
|
||
assert.sameValue(Object.getPrototypeOf(unscopables), null); | ||
|
||
assert.sameValue(unscopables.findLast, true, '`findLast` property value'); | ||
verifyEnumerable(unscopables, 'findLast'); | ||
verifyWritable(unscopables, 'findLast'); | ||
verifyConfigurable(unscopables, 'findLast'); | ||
|
||
assert.sameValue(unscopables.findLastIndex, true, '`findLastIndex` property value'); | ||
verifyEnumerable(unscopables, 'findLastIndex'); | ||
verifyWritable(unscopables, 'findLastIndex'); | ||
verifyConfigurable(unscopables, 'findLastIndex'); |
31 changes: 31 additions & 0 deletions
31
test/built-ins/Array/prototype/Symbol.unscopables/array-grouping.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (C) 2022 Chengzhong Wu. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
/*--- | ||
esid: sec-array.prototype-@@unscopables | ||
description: > | ||
Initial value of `Symbol.unscopables` property | ||
info: | | ||
22.1.3.32 Array.prototype [ @@unscopables ] | ||
... | ||
10. Perform ! CreateDataPropertyOrThrow(unscopableList, "groupBy", true). | ||
11. Perform ! CreateDataPropertyOrThrow(unscopableList, "groupByToMap", true). | ||
... | ||
includes: [propertyHelper.js] | ||
features: [Symbol.unscopables, array-grouping] | ||
---*/ | ||
|
||
var unscopables = Array.prototype[Symbol.unscopables]; | ||
|
||
assert.sameValue(Object.getPrototypeOf(unscopables), null); | ||
|
||
assert.sameValue(unscopables.groupBy, true, '`groupBy` property value'); | ||
verifyEnumerable(unscopables, 'groupBy'); | ||
verifyWritable(unscopables, 'groupBy'); | ||
verifyConfigurable(unscopables, 'groupBy'); | ||
|
||
assert.sameValue(unscopables.groupByToMap, true, '`groupByToMap` property value'); | ||
verifyEnumerable(unscopables, 'groupByToMap'); | ||
verifyWritable(unscopables, 'groupByToMap'); | ||
verifyConfigurable(unscopables, 'groupByToMap'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters