26 Commits

Author SHA1 Message Date
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
b1f3390fe4
Features: remove duplicate "cleanupSome" feature (#2892)
* Features: remove duplicate "cleanupSome" feature

* Replace feature flag in harness file

Co-authored-by: Mike Pennisi <mike@mikepennisi.com>
2021-11-04 13:27:30 -04: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
Rick Waldron
ce8ec71c98 Features: add full name for FinalizationRegistry.prototype.cleanupSome. 2020-10-06 12:01:10 -04:00
Leo Balter
5a01caed71 Add feature tag for cleanupSome
The WeakRefs proposal advanced to Stage 4 but cleanupSome moved back to a Stage 2 status.
The tests should remain in Test262 for now but this feature flag should help users to
filter tests out.
2020-07-21 16:57:50 -04:00
Daniel Ehrenberg
c6dd620ad3 Rename FinalizationGroup to FinalizationRegistry
Corresponds to https://github.com/tc39/proposal-weakrefs/pull/183

(Note, this is untested)
2020-02-20 12:13:29 -05:00
Gus Caplan
5b231ab2d6 add missing WeakSet and WeakMap features 2020-02-08 08:54:09 -05:00
Gus Caplan
a53f43e1ce
add missing newlines in tests 2019-11-10 20:18:56 -08:00
Leo Balter
3bfb341203 Fixes after test feedback 2019-09-23 12:26:02 -04:00
Leo Balter
08844700fe Update tests for GC hook, apply async
- Fix incorrect tests for WeakRefs

Ref #2239
Fixes #2260
Fixes #2256
2019-09-23 12:26:02 -04:00
Leo Balter
7134634aa4 Revert "Remove tests based on the $262.gc hook"
This reverts commit d6d37f2f4399ef74a096b74b91f526758cab933f.
2019-09-23 12:26:02 -04:00
Alexey Shvayka
ef7fd2bc27 Add "proto-from-ctor-realm" tests for Intl constructors (#2334)
* Rename "Object/proto-from-ctor.js" test

* Add missing "Symbol" features

* Add Intl.Collator test

* Add Intl.DateTimeFormat test

* Add Intl.NumberFormat test

* Add Intl.PluralRules test
2019-09-11 17:22:21 -03:00
Leo Balter
d6d37f2f43 Remove tests based on the $262.gc hook
Fixes #2239
Closes #2329
2019-09-05 19:38:03 +01:00
Leo Balter
3c293f0e6c Some edgy cases for weakrefs/finalizationgroups 2019-07-11 11:17:30 -04:00
Gus Caplan
7a1da555a5 add WeakRef feature to WeakRef/constructor test. (#2209) 2019-06-21 13:41:28 -04:00
Leo Balter
dcac20d8ed Add tests for FG register/unregister 2019-06-21 11:50:22 -04:00
Leo Balter
ab38ce4e84 Add more tests, include deref 2019-06-21 11:50:22 -04:00
Leo Balter
c2c81409b2 fixup! Normative optional WeakRef#constructor 2019-06-21 11:50:22 -04:00
Leo Balter
5fabef83dc Normative optional WeakRef#constructor 2019-06-21 11:50:22 -04:00
Leo Balter
62477ea0c9 More tests 2019-06-21 11:50:22 -04:00
Leo Balter
e3d87d6690 No ctor for WeakRef.prototype 2019-06-21 11:50:22 -04:00
Leo Balter
969d4e68b4 Basic tests for weakref and finalizationgroup 2019-06-21 11:50:22 -04:00