Commit Graph

629 Commits

Author SHA1 Message Date
Kevin Gibbons 67a5153cf5
add Float16Array to all generic TypedArray tests (#3849) 2024-01-10 14:07:57 +01:00
Kevin Gibbons 5a263f5b19 add the TypedArray feature flag to some tests which were missing it 2024-01-08 17:21:46 -08:00
Daniel Minor 55e8cceb80 Revert "Revert "Fixup class names in class decorator private identifier tests.""
This reverts commit 31f703cbe69ec2e0fd4b94de2fdf505fb722b552.

The changes are needed to both the templates and the generated files.
2023-10-05 10:23:12 -07:00
Daniel Minor 3ef0777c04 Revert "Fixup class names in class decorator private identifier tests."
This changed the test files, not the templates used to generate the tests.
2023-10-05 10:23:12 -07:00
Daniel Minor 581de2d0f8 Fixup class names in class decorator private identifier tests.
For the statement level test, the inner class name is not initialized
at the time the decorators evaluate, resulting in a ReferenceError
that the declaration can not be accessed prior to initialization.

Similar, non-decorator code, like:
    class C {
        static dec() {}
        static {
            this.x = C.dec();
            class C {}
        }
    }
also results in a ReferenceError.

For the expression level test, the var C is undefined at the time the
decorators are evaluated, resulting in TypeError while trying to access
a member of undefined.

Similar, non-decorator code, like:
    var C = class {
        static f() {};
        static {
            this.x = C.f();
        }
    }
also results in a TypeError.
2023-10-05 10:23:12 -07:00
André Bargull 1bd99bf069 Remove excess leading whitespace 2023-09-13 16:05:40 +02:00
André Bargull c140af3cb3 Update other test/language tests to use verifyProperty 2023-09-13 16:05:40 +02:00
André Bargull ff81dccfc3 Use verifyProperty in language/statements tests 2023-09-13 16:05:40 +02:00
Huáng Jùnliàng ff405fd0df update fixtures 2023-03-29 12:54:37 -07:00
José Julián Espina 4a6439e4a7
Add `Array.prototype.includes` and `exponentiation` features (#3799) 2023-03-23 10:51:08 +01:00
Cam Tenny 4d9d5c570d Refactor simple cases of (IIFE/async function).then(\$DONE, \$DONE); to use asyncTest 2023-02-21 11:04:09 -08:00
Huáng Jùnliàng 58b3321dba remove invalid element decorator yield reference tests 2023-01-03 12:33:04 -08:00
Philip Chimento e7895c53d2 Rebuild generated tests
This adds new tests because the tests that previously had name conflicts
are now renamed.
2022-11-30 16:04:02 -08:00
Philip Chimento cc559ac106 Rebuild generated tests 2022-11-30 16:04:02 -08:00
Philip Chimento d87a7da6e1 Replace Object.hasOwnProperty.call with Object.prototype.hasOwnProperty.call
While we're at it, use assert() instead of assert.sameValue() for brevity,
if we are not specifically testing that the return value of hasOwnProperty
is the value true or false; and add more informative assertion messages to
help with debugging.

In some cases, the Object.hasOwnProperty.call could be replaced with
verifyProperty(), if the property descriptor was also being verified at
the same time.

This fixes some tests that were faulty to begin with: a common mistake was
Object.hasOwnProperty(obj, prop) which is probably going to return false
when that's not what you want.

The only instances left of `Object.hasOwnProperty` are one regression test
in implementation-contributed which I can't tell if it was intentionally
needed to trigger the regression, and a few instances of
`Object.hasOwnProperty('prototype')` which would defeat the purpose to
convert into `Object.prototype.hasOwnProperty.call(Object, 'prototype')`
form.

Closes: #3524
2022-11-30 16:04:02 -08:00
Kevin Gibbons 746197355c
Implement changes for "avoid mostly-redundant `await` in async `yield*`" (#3619) 2022-09-06 13:21:50 +02:00
legendecas ee521159d5 Fix decorator tests 2022-06-23 15:17:43 -04:00
Youssef Soliman 79c4496559 Fixed spelling error identifer -> identifier. 2022-06-21 10:14:17 +02:00
Mike Pennisi 74de3d1d32 Correct spurious syntax errors
Prior to this commit, two tests for specific early errors also included
syntactically invalid `const` declarations. Implementations which
produced the expected syntax error due to these invalid declarations
would pass the tests regardless of whether they produced the early
errors that the tests were written to verify.

Correct the `const` declarations so that the tests verify the parsing
rule that they were designed to verify.
2022-06-17 10:29:52 +02:00
Dmitriy Kubyshkin ba5529d926
Fix wrong error for a lexical redeclaration test (#3575)
The test as originally specified fails in all compatible parsers, but for the wrong reason. Below is an excerpt from V8, but all parser I tested behave the same:

```js
for (const x; false; ) {
           ^
SyntaxError: Missing initializer in const declaration
```

After the change the error is the assumed:

```js
  var x;
      ^
SyntaxError: Identifier 'x' has already been declared
```
2022-06-16 22:24:51 -04:00
Huáng Jùnliàng 79e3bc5176
add noStrict flag to yield-as-binding-id cases (#3551) 2022-06-09 09:01:21 +02:00
legendecas 6f8e0f67ca Decorators: add initial tests on class 2022-05-18 09:49:49 -04:00
Keith Miller b409843612 Update S12.6.4_A7_T2.js
This test currently has some tabs. Clean this up and make them spaces instead.
2022-05-05 10:19:37 -07:00
rwaldron f60d7cf67d fixup! Fix false negative in for-in test 2022-04-05 11:18:45 -04:00
rwaldron 384a4e1368 Fix false negative in for-in test
As originally written, this test would spuriously pass when the deleted
property was incorrectly visited by enumation but correctly removed from
the object. In such cases, the accumulator string would take the form

    "aa1baundefinedca3"

And satisfy all conditions intended to highlight implementation errors.

Refactor the test to avoid false negative by using an object with a null
prototype and verifying the exact contents of the accumulator string.
2022-04-05 11:18:10 -04:00
Mike Pennisi 3c88e9b619 Fix false negative in for-in test
As originally written, this test would spuriously pass when the deleted
property was incorrectly visited by enumation but correctly removed from
the object. In such cases, the accumulator string would take the form

    "aa1baundefinedca3"

And satisfy all conditions intended to highlight implementation errors.

Refactor the test to avoid false negative by using an object with a null
prototype and verifying the exact contents of the accumulator string.
2022-04-05 11:15:21 -04:00
Rick Waldron 8b4382d2f2
Transform compareArray -> assert.compareArray: test/language/**/*.js (#3239) 2021-10-15 20:35:01 -04:00
Mike Pennisi 8d420cef41 Remove unused functions 2021-10-13 14:18:32 -04:00
Rick Waldron 7be8fca485
fix: re-run clean and build on master to sync generated tests (#3247) 2021-10-06 15:47:46 -04:00
Mike Pennisi 8f1fb5c257 Remove unused functions 2021-10-05 16:24:16 -04:00
Mike Pennisi a6834093aa Improve coverage by invoking functions as intended
Some tests which include function declarations designed to verify
behavior do not reference those functions. Insert the references
necessary for those functions to serve their intended purpose.
2021-10-05 16:22:56 -04:00
rwaldron 43c68163c0 Generate tests 2021-10-01 16:38:56 -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
Mike Pennisi 650e7add4a Improve coverage for ops involving negative zero
Prior to this commit, the modified tests used the strict equality
operator to compare computed values with negative zero. Due to the
semantics of that operator, these tests would spuriously pass if the
value under test was in fact positive zero.

Update the tests to be more precise by instead asserting equality with
the `assert.sameValue` utility method (since that method correctly
distinguishes between negative zero and positive zero).
2021-09-16 16:35:41 -04:00
Mike Pennisi 2a898fe819 Add test for normative change to BlockStatement
Normative: continue labels should not pass through blocks
https://github.com/tc39/ecma262/pull/2482
2021-09-07 17:50:02 -04:00
André Bargull 47be34cef7 Split files which test for the property order of functions
So SpiderMonkey can run the other parts of these tests.
2021-08-05 18:23:52 -04:00
André Bargull d00039593d Add various private field and private method tests
This adds tests for implementation bugs in SpiderMonkey [1], plus
additional tests for implementation bugs in V8 and JSC.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1723155
2021-08-04 15:06:38 -04:00
André Bargull b74b15c49c
Derived class constructor checks are executed after leaving the function body (#3129) 2021-08-04 09:58:24 -07:00
rwaldron 4a125f2f4e chore: migrate $ERROR -> throw new Test262Error in test/language/s* 2021-07-29 10:38:53 -04:00
rwaldron 77cc528526 Generate tests 2021-07-22 15:31:36 -04:00
Timothy Gu 6319cb1e2a Add more static class property ordering tests
Since https://github.com/tc39/ecma262/pull/1490, the "length" and "name"
properties of a class are defined before any static methods. This is
tested by #2057, in test/language/computed-property-names of all places.

At the same time, static methods with "name" as the name would overwrite
the original property, but retain the original property enumeration
order. This was not previously tested. In fact, the overwriting behavior
was not tested at all for the "length" property.

This commit mends both holes in test coverage.
2021-07-16 09:27:16 -04:00
jugglinmike afe217b318
Add tests for "Class Static Init. Blocks" proposal (#2968)
* Add tests for "Class Static Init. Blocks" proposal

This proposal is currently at "stage 3" in TC39's standardization
process.

* fixup! Add tests for "Class Static Init. Blocks" proposal

* Correct identifier reference

* Update tests for grammar

* Update tests for identifiers

* Add tests for scope derivation
2021-07-15 08:49:12 -04:00
Stuart Cook 9da1d6119c
Add more tests for `for (async of` edge-cases (#2983) 2021-05-07 16:16:34 -04:00
Stuart Cook c11d6b00bc
Add a test for `for await (async of` (#2982) 2021-05-04 15:05:45 -04:00
Mike Pennisi 3addcc4b04 Generate tests 2021-04-20 09:53:57 -04:00
strager 6888a8df82
Fix typo in private getter/setter tests (#2971)
Several tests for getters and setters claim to check for an early
SyntaxError regarding mixing static and non-static propeties with the
same name. However, the tests trigger another issue: the getters have no
method body; they're missing curlies.

Fix the tests to test only the intended SyntaxError, not unrelated
SyntaxError-s.
2021-04-09 20:13:41 -04:00
Gus Caplan 516ca9af39 Update tests for ECMA262 #2216
https://github.com/tc39/ecma262/pull/2216
2021-02-26 11:49:49 -05:00
jmdyck 11624af8d0
Update "info" field (#2941)
The quoted spec wording changed in ecma262#1694.
2021-01-28 16:03:01 -08:00
Caio Lima f81c2f5422 Adding test case for super access from class field defined as arrow function 2021-01-18 09:41:23 -05:00