Commit Graph

30 Commits

Author SHA1 Message Date
Meghan Denny 60963bf468
chore: convert many tests to use verifyProperty (#4263)
Co-authored-by: André Bargull <andre.bargull@gmail.com>
2024-10-14 11:25:05 +02:00
Kevin Gibbons 961480ac61 remove some auto-generated error messages in "assert.throws" tests 2024-03-25 12:09:10 +01:00
Kevin Gibbons 5424d7e834 rewrite tests to use verifyProperty 2024-03-25 12:05:06 +01:00
Ms2ger 0593463817 Add missed changes for Symbols as WeakMap keys proposal.
Co-authored-by: Rick Waldron <waldron.rick@gmail.com>
2022-11-08 09:44:40 -08:00
Shu-yu Guo c15d4bef28 Add missing include to WeakSet/iterable-with-symbol-values 2022-10-24 15:50:52 -07:00
Philip Chimento 554a18c34d Add tests for regular and well-known Symbols as weak values
This adds tests to WeakMap, WeakSet, WeakRef, and FinalizationRegistry for
Symbols as weakly-held values. Regular symbols and well-known symbols are
both tested. These tests correspond to existing tests for Objects as
weakly-held values, but are put in separate files so that they can be
filtered out with the "symbols-as-weakmap-keys" feature flag.

Registered symbols are not allowed; this is already tested in the "cannot-
be-held-weakly" tests.

See: #2850
2022-10-12 09:58:45 +02:00
Philip Chimento d101ab9bc4 Adapt descriptions of existing tests using Objects as weak values
There are many existing tests for WeakMap, WeakSet, WeakRef, and
FinalizationRegistry using Objects as weak values. For symbols-as-weakmap-
keys, we'll want to write tests that parallel these for Symbol keys.

Change the descriptions and filenames of these tests to describe their new
scope of only Object weak values.

Update the front matter of these tests while we're at it, to reflect the
changes to the spec text that the symbols-as-weakmap-keys brings in. (In
some cases, remove irrelevant bits of the front matter.)

See: #2850
2022-10-12 09:58:45 +02:00
Philip Chimento 6291e42a72 Adapt existing tests regarding Symbols as weak values
WeakMap, WeakSet, WeakRef, and FinalizationRegistry all had tests
verifying what would happen if they were called with a value that wasn't
allowed as a weak value: before this proposal, that was a non-Object.
Now, allowed weak values are Objects, well-known Symbols, and unregistered
Symbols. That leaves registered Symbols that are still not allowed as weak
values.

This commit updates those tests to use a registered Symbol instead of an
unregistered Symbol; they should still pass, regardless of whether the
implementation has implemented symbols-as-weakmap-keys yet.

The tests are renamed as appropriate.

Also updates the frontmatter to the most current spec text, including the
CanBeHeldWeakly abstract operation.

See: #2850
2022-10-12 09:58:45 +02:00
Rick Waldron 735f95adf5 Add WeakMap and WeakSet features to tests affected by symbols-as-weakmap-keys
Originally taken from Rick's draft commit for symbols-as-weakmap-keys
tests.
2022-10-12 09:58:45 +02:00
Rick Waldron 145c440069 Remove duplicate WeakSet test
This test is duplicated by WeakSet/prototype/add/value-not-object-throw.js

Originally taken from Rick's draft commit for symbols-as-weakmap-keys
tests.
2022-10-12 09:58:45 +02:00
Rick Waldron d576baf73f Info: adds "sec-evaluatenew" step to info for all "not-a-constructor.js" tests. 2020-10-06 12:01:34 -04:00
Rick Waldron 8aacff591c Standardize built-in constructor testing 2020-10-06 12:01:34 -04:00
Rick Waldron c644ede430 Built-in function objects that are not identified as constructors must throw a TypeError exception when new'ed. Fixes gh-1739 2020-10-06 12:01:34 -04:00
Mike Pennisi f26c2a11bd Remove unnecessary "includes" directives
The values defined by the referenced files are not used by these tests.
This makes their inclusion superfluous, which needlessly increases the
time to execute the tests and may confuse some readers.
2019-09-25 13:59:24 -04:00
Leo Balter ff9763729d Remove duplicated es[56]id if esid is present 2019-08-05 10:54:37 -04:00
Rick Waldron 621d34d5ea built-ins/WeakMap/*: make all indentation consistent (depth & character) (#1428) 2018-02-15 15:40:46 -05:00
André Bargull f95b56ab28 Revert "js-beautify: make all indentation consistent (depth & character) (#1409)" (#1412)
This reverts commit a01de4a722.
2018-02-09 12:09:47 -05:00
Rick Waldron a01de4a722 js-beautify: make all indentation consistent (depth & character) (#1409) 2018-02-09 11:35:37 -05:00
Rick Waldron 92a2621901 Frontmatter: fixup "info: >" to "info: |" 2018-01-05 12:27:59 -05:00
Leo Balter 7cbbe51216 Add cross-realm feature 2017-09-22 15:29:10 -04:00
Leo Balter 2bee5df77a Add missing Symbol.iterator feature flags 2017-09-08 10:13:50 -04:00
Leo Balter c41faf1aca Add missing Symbol features flags 2017-09-07 15:51:13 -04:00
Lyza Danger Gardner 5ad8dc4219 Remove a wee bit o’ trailing whitespace 2017-06-29 17:23:07 -04:00
Lyza Danger Gardner 208344319e Add esid 2017-06-29 17:23:07 -04:00
Rick Waldron fdd2fa9b1c Rename $ => $262. Fixes gh-802 (#823)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-03-01 16:34:15 -05:00
jugglinmike 71e573f7da Add tests for realm interactions (#688)
* Add tests for prototype realm inference

* Add tests for miscellaneous realm concerns

* Add tests for realm of spec-created Errors

In some cases, Error objects produced by the specification are
observable from ECMAScript code. Among these cases, some are further
differentiated in that they occur outside of any built-in function and
may be triggered through syntactic production directly. The current
realm record is commonly interpreted incorrectly under these
circumstances.

Add tests asserting that the expected realm record is used when
constructing such Error objects.

* Add tests for realm use in ArraySpeciesCreate

* Add tests for function realm retrieval

* Add tests for cross-realm behaviors of Symbols

* Add tests for GetValue and PutValue

* Add tests for realm of spec-created Arrays

In some cases, Arrays produced by CreateArrayFromList are observable
from ECMAScript code. Among these cases, two occur outside of any
built-in function and may be triggered through syntactic production
directly. The current realm record is commonly interpreted incorrectly
under these circumstances.

Add tests asserting that the expected realm record is used when
constructing arrays.

* Add test for spec-created object

* fixup! Add tests for realm of spec-created Errors

* fixup! Add tests for realm of spec-created Errors

* fixup! Add tests for prototype realm inference

* fixup! Add tests for miscellaneous realm concerns
2016-10-24 10:43:17 -07:00
Mike Pennisi d6bbbc9aed Add tests for well-known Symbol: @@toStringTag 2015-08-07 20:02:44 -04:00
André Bargull 023c7aa69e - Remove inline license
- Remove duplicate word
- Add missing license
2015-07-17 19:55:00 +02:00
Leonardo Balter b898493f53 WeakSet 2015-06-15 22:37:24 -04:00
Rick Waldron 59e2a7ac57 Import tests from Google V8 (Symbol)
These tests are derived from the following files within the Google V8 project:

	test/mjsunit/harmony/private.js
2015-04-07 16:53:18 -04:00