8 Commits

Author SHA1 Message Date
Philip Chimento
2af27af915 harness: Add a function to get well-known intrinsic objects
wellKnownIntrinsicObjects.js now exposes a getWellKnownIntrinsicObject()
function which returns the object corresponding to a key like %Array%. If
the object is not provided by the implementation, or not accessible, it
throws a Test262Error. This is so that tests depending on that intrinsic
object can easily fail.
2025-03-11 18:14:55 -07:00
Philip Chimento
e133564cfa harness: Update list of well-known intrinsics
Looks like this list hasn't been updated in a while. Add
%AsyncGeneratorPrototype%, %GeneratorPrototype%, %Iterator%,
%IteratorHelperPrototype%, and %WrapForValidIteratorPrototype%.

%IteratorPrototype% is no longer a well-known intrinsic; I guess it was
removed because ever since iterator helpers it's accessible as
%Iterator.prototype%.

%Iterator% is available as the global property Iterator, but include a
fallback for implementations that haven't yet implemented iterator
helpers.
2025-03-11 18:14:55 -07:00
Philip Chimento
18ce488401 harness: Correct sources of %{Async,}GeneratorFunction%
As far as I can tell these are wrong, giving %GeneratorFunction.prototype%
and %AsyncGeneratorFunction.prototype% instead. These new expressions are
how MDN claims you can get the intrinsics.
2025-03-11 18:14:55 -07:00
Philip Chimento
a4536dc65f harness: Add clarifying comments about inaccessible intrinsics
As far as I know, %AsyncFromSyncIteratorPrototype% and
%ForInIteratorPrototype% are not (and not intended to be) accessible to
ECMAScript user code, so they are impossible to test directly. Add a
clarifying comment, and make the source expression consistent ('' vs.
'undefined').
2025-03-11 18:14:55 -07:00
Gus Caplan
5f99d05c6a native function validator for your consideration 2020-08-04 19:44:31 -04:00
Gus Caplan
156186aee2 New NativeFunction tests 2020-08-04 19:44:31 -04:00
Mike Pennisi
a9111d7144 lint: add rule to verify use of harness files
Verify that every test file which references a harness file using the
"includes" directive also contains at least one reference to a value
defined in the harness file.

To support this check, extend each harness file with a list of values
which it defines.
2019-09-25 14:00:50 -04:00
Rick Waldron
c55d2ab7c3 Extensive Function toString updates for "Function.prototype.toString revision" proposal. (#1510)
Fixes gh-1453
2018-04-19 16:44:52 -04:00