Commit Graph

190 Commits

Author SHA1 Message Date
Peter Klecha 1db9a49eb9 address comments 2023-09-08 16:31:50 -07:00
Peter Klecha 2a4c458002 Update test/built-ins/Promise/withResolvers/ctx-ctor.js
Co-authored-by: Linus Groh <mail@linusgroh.de>
2023-09-08 16:31:50 -07:00
Peter Klecha 998f811e58 Update test/built-ins/Promise/withResolvers/ctx-non-ctor.js
Co-authored-by: Ms2ger <Ms2ger@gmail.com>
2023-09-08 16:31:50 -07:00
Peter Klecha 15e0933cb5 Update test/built-ins/Promise/withResolvers/result.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2023-09-08 16:31:50 -07:00
Peter Klecha 8f8aa971d8 Update test/built-ins/Promise/withResolvers/result.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2023-09-08 16:31:50 -07:00
Peter Klecha ab0d665192 Update test/built-ins/Promise/withResolvers/result.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2023-09-08 16:31:50 -07:00
Peter Klecha d2ac342089 include esids 2023-09-08 16:31:50 -07:00
Peter Klecha 81ba258677 add tests for Promise.withResolvers proposal 2023-09-08 16:31:50 -07:00
jugglinmike 5093c3037d
Reject exceptional input to `isConstructor` (#3748)
* Reject exceptional input to `isConstructor`

Prior to this commit, the `isConstructor` harness function would return
`false` when invoked with a value that lacked a [[Call]] internal
method. While it's true that such values are not constructors, there are
no tests which benefit from using `isConstructor` to make such an
assertion.

Extend `isConstructor` to throw an error when invoked with a
non-function object. Update a test which was misleadingly invoking the
function with the value `undefined`.

* fixup! Reject exceptional input to `isConstructor`
2022-12-15 22:53:34 -05:00
Csaba Osztrogonác bd1acb51a4 tools: enforce restriction on YAML includes key
Includes key should use flow notation to be able parsed easier
as suggested in https://github.com/tc39/test262/issues/1997

Added this check to the linting script and updated tests accordingly.
2022-01-05 17:27:58 -05:00
Mike Pennisi c44cee291a Assert array equivalency
The `compareArray` utility function returns a boolean value describing
whether or not the input arrays are equivalent--it does not throw an
exception when invoked with non-equivalent arrays. Prior to this commit,
however, two tests invoked `compareArray` without inspecting its return
value, so it had no impact on the result of the test.

Update the tests to fail when the "expected" and "actual" arrays are not
equivalent.
2021-10-04 15:38:08 -04:00
Mike Pennisi d9ddf80479 Revert "Merge pull request #3219 from tc39/rwaldron/migrate-comparearray"
This reverts commit b690cb67be, reversing
changes made to 50dd431dff. This is
necessary because the reverted changeset reduced coverage by an unknown
extent.
2021-10-01 10:18:47 -04:00
rwaldron 4847d9db5a chore: update test/**/*.js to use assert.compareArray wherever applicable 2021-09-24 12:58:15 -04:00
rwaldron 2a385983b1 Transform legacy format to harness assertions: test/built-ins/P*/**/*.js 2021-09-02 11:34:18 -07:00
Rick Waldron 826b6ae16f
chore: migrate $ERROR -> throw new Test262Error in test/built-ins/Promise (#3091) 2021-07-21 12:48:13 -07:00
Mike Pennisi 9b622bf093 Remove or relocate misleading tests
These tests were designed to test the built-in "Promise.race Resolve
Element function," but ECMA262 does not describe such a function.

Contrary to the test's description, the function under test is created
by the InstantiateArrowFunctionExpression abstract operation. The
following tests verify most of the details directly (only the function
object's extensibility was not already tested by the existing tests):

- test/language/expressions/arrow-function/name.js
- test/language/expressions/arrow-function/throw-new.js
- test/language/expressions/arrow-function/prototype-rules.js

The definition of the built-in resolving functions is closely related,
but Test262 already includes tests for the corresponding concerns:

- test/built-ins/Promise/resolve-function-extensible.js
- test/built-ins/Promise/resolve-function-name.js
- test/built-ins/Promise/resolve-function-nonconstructor.js
- test/built-ins/Promise/resolve-function-prototype.js

Remove the tests and introduce one additional test to preserve coverage
while improving discoverability.
2021-05-11 17:36:28 -04:00
ExE Boss 8f904d8cc8 Set function `length` and `name` in `CreateBuiltinFunction` 2021-01-29 09:45:20 -05: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 12ed905003 Clean up some existing constructor checks; eliminate duplicate checks 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 e662428fb4 Replace all "valid" occurences of $ERROR with Test262Error.thrower 2020-09-16 17:36:54 -04:00
Alexey Shvayka d10446a5e4 Promise.prototype.finally calls PromiseResolved: add rejected promise test 2020-09-10 16:23:12 -04:00
Alexey Shvayka a841f07a11 Promise.prototype.finally calls PromiseResolved: add resolved promise test 2020-09-10 16:23:12 -04:00
Alexey Shvayka c472aeea4b Use $DONE instead of $ERROR to avoid unhandled rejections 2020-07-07 11:16:04 -07:00
Alexey Shvayka 739c4cd78d Remove duplicate of "subclass-species-constructor-resolve-count.js" 2020-07-07 11:16:04 -07:00
Gus Caplan fe3ad55d80
add missing Promise.any features (#2686) 2020-07-01 10:33:56 -07:00
Rick Waldron 6179359305
Promise.any: coverage updates, R4 (#2683) 2020-06-30 13:56:55 -07:00
Rick Waldron 16b48a1271
Promise.allSettled: coverage updates, R2 (#2684) 2020-06-30 13:56:04 -07:00
André Bargull b5650d23a5
Don't call $DONE twice in S25.4.4_A2.1_T3.js (#2679)
Reverts the change from 040eb5393a to avoid
calling $DONE twice in the test file.
2020-06-25 08:35:46 -07:00
Rick Waldron 2f12ab71f8 Promise: use .then($DONE, $DONE) wherever possible 2020-06-24 15:47:48 -04:00
Rick Waldron 040eb5393a
Promises: whenever evaluating checkSequence(sequence), also assert length of sequence (#2672) 2020-06-24 12:18:35 -07:00
Rick Waldron 9dbaa95aed
Promise.race: coverage updates (#2666)
Ref #2629
2020-06-24 11:42:40 -07:00
Rick Waldron f2ab5b6ca1
Promise.any: coverage update r3 (#2658) 2020-06-12 09:55:37 -07:00
Rick Waldron c4c978b7ed
Promise.all, Promise.allSettled: coverage updates (#2657) 2020-06-12 09:54:52 -07:00
Alexey Shvayka 7ed6238a89 Replace `instanceof` with reference equality 2020-06-11 19:36:49 -04:00
Alexey Shvayka ac4d02d77a Fix Promise.prototype.finally test 2020-06-11 19:36:49 -04:00
Alexey Shvayka 290ceba31f Update Promise.any tests 2020-06-03 15:49:04 -04:00
Alexey Shvayka fb88b47938 Update Promise.race tests 2020-06-03 15:49:04 -04:00
Alexey Shvayka c915741594 Update Promise.allSettled tests 2020-06-03 15:49:04 -04:00
Alexey Shvayka cf37b039a8 Update Promise.all tests 2020-06-03 15:49:04 -04:00
Rick Waldron 081afde9c1 Promise.any: coverage updates, R3 2020-06-03 11:07:28 -07:00
Rick Waldron 9999dff8fd Promise.any: coverage updates, R2 2020-06-03 11:07:28 -07:00
Rick Waldron 3604a65a29 Promise.any: coverage updates, R1 2020-06-03 11:07:28 -07:00
Marja Hölttä 218edad632
Remove duplicate Promise.all tests (#2624)
1) Promise/all/S25.4.4.1_A6.1_T1.js is the same as
Promise/all/S25.4.4.1_A2.1_T1.js

2) Promise/all/S25.4.4.1_A6.1_T2.js is covered by
Promise/all/S25.4.4.1_A2.3_T1.js and
Promise/all/S25.4.4.1_A2.3_T2.js
2020-05-18 10:42:56 -07:00
Marja Hölttä 429c60ec38 fix 2020-05-06 10:48:38 -04:00
Marja Hölttä 4be59efd30 fix 2020-05-06 10:48:38 -04:00
Marja Hölttä affe579677 fix 2020-05-06 10:48:38 -04:00
Marja Hölttä 58dba42939 Add Promise/*/resolve-not-callable-close.js 2020-05-06 10:48:38 -04:00
Gus Caplan 4d9dccf443 Remove invalid feature, fix lint 2020-04-29 17:31:45 -04:00