diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /js/src/tests/test262/language/computed-property-names/object/property | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/language/computed-property-names/object/property')
3 files changed, 52 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/computed-property-names/object/property/browser.js b/js/src/tests/test262/language/computed-property-names/object/property/browser.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/computed-property-names/object/property/browser.js diff --git a/js/src/tests/test262/language/computed-property-names/object/property/number-duplicates.js b/js/src/tests/test262/language/computed-property-names/object/property/number-duplicates.js new file mode 100644 index 0000000000..8f0ec366d7 --- /dev/null +++ b/js/src/tests/test262/language/computed-property-names/object/property/number-duplicates.js @@ -0,0 +1,52 @@ +// Copyright (C) 2014 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +es6id: 12.2.5 +description: > + computed property names can be numbers +---*/ +var object = { + [1.2]: 'A', + [1e55]: 'B', + [0.000001]: 'C', + [-0]: 'D', + [Infinity]: 'E', + [-Infinity]: 'F', + [NaN]: 'G', +}; +assert.sameValue( + object['1.2'], + 'A', + "The value of `object['1.2']` is `'A'`. Defined as `[1.2]: 'A'`" +); +assert.sameValue( + object['1e+55'], + 'B', + "The value of `object['1e+55']` is `'B'`. Defined as `[1e55]: 'B'`" +); +assert.sameValue( + object['0.000001'], + 'C', + "The value of `object['0.000001']` is `'C'`. Defined as `[0.000001]: 'C'`" +); +assert.sameValue( + object[0], + 'D', + "The value of `object[0]` is `'D'`. Defined as `[-0]: 'D'`" +); +assert.sameValue(object[Infinity], + 'E', + "The value of `object[Infinity]` is `'E'`. Defined as `[Infinity]: 'E'`" +); +assert.sameValue( + object[-Infinity], + 'F', + "The value of `object[-Infinity]` is `'F'`. Defined as `[-Infinity]: 'F'`" +); +assert.sameValue( + object[NaN], + 'G', + "The value of `object[NaN]` is `'G'`. Defined as `[NaN]: 'G'`" +); + +reportCompare(0, 0); diff --git a/js/src/tests/test262/language/computed-property-names/object/property/shell.js b/js/src/tests/test262/language/computed-property-names/object/property/shell.js new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/js/src/tests/test262/language/computed-property-names/object/property/shell.js |