2908 Commits

Author SHA1 Message Date
jugglinmike
ebb6c34fa5
Resizable ArrayBuffer: TypedArray methods (#3027)
* ResizableArrayBuffer: TypedArray.prototype.set

* Resizable ArrayBuffer: TypedArray methods

The files in this patch are highly similar. Only the test for
`TypedArray.prototype.copyWithin` was written manually. The others were
generated from that test via the following script:

    #!/bin/bash

    set -eu

    names_cb='
    every
    filter
    find
    findIndex
    forEach
    map
    reduce
    reduceRight
    some
    '
    names_num='
    at
    fill
    includes
    indexOf
    join
    lastIndexOf
    slice
    '
    names_none='
    entries
    values
    keys
    reverse
    sort
    toLocaleString
    values
    '

    for name in $(printf "${names_cb} ${names_num} ${names_none}"); do
      lower=$(echo ${name} | tr '[:upper:]' '[:lower:]')
      if echo "$names_cb" | grep -xq $name; then
        value='() => {}'
      elif echo "$names_num" | grep -xq $name; then
        value='0'
      else
        value=''
      fi

      if [[ "${name}" == 'at' ]]; then
        features_addition='TypedArray.prototype.at, '
      else
        features_addition=''
      fi

      sed \
        -e "s/copywithin/${lower}/g" \
        -e "s/copyWithin/${name}/g" \
        -e "s/${name}(.*);/${name}(${value});/g" \
        -e "s/resizable-arraybuffer/${features_addition}resizable-arraybuffer/g" \
        ./test/built-ins/TypedArray/prototype/copyWithin/return-abrupt-from-this-out-of-bounds.js \
        > ./test/built-ins/TypedArray/prototype/${name}/return-abrupt-from-this-out-of-bounds.js
    done
2021-06-25 15:33:36 -04:00
jmdyck
781f10c9de
Append missing pipe character on "info:" lines (#3030) 2021-06-25 14:50:40 -04:00
Rick Waldron
fb0a68a2cf
Add missing features: [resizable-arraybuffer] (#3029)
* Add missing features: [resizable-arraybuffer]

* fixup! Add missing features: [resizable-arraybuffer]

Co-authored-by: Mike Pennisi <mike@mikepennisi.com>
2021-06-25 14:01:23 -04:00
Mike Pennisi
802f22bf0e Temporal.now.timeZone: improve coverage 2021-06-25 13:52:57 -04:00
Mike Pennisi
19c5e38118 Temporal.now.timeZone: import tests from proposal 2021-06-25 13:52:01 -04:00
jugglinmike
f734c2d547
Resizable ArrayBuffer: TypedArray accessors (#3028)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: TypedArray accessors
2021-06-25 13:38:51 -04:00
jugglinmike
13d7b79e90
Resizable ArrayBuffer: TypedArray constructor (#3026)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: TypedArray constructor
2021-06-25 13:31:05 -04:00
jugglinmike
884ed7f6f8
Resizable ArrayBuffer: SharedArrayBuffer accessors (#3025)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: SharedArrayBuffer accessors

* fixup! Resizable ArrayBuffer: SharedArrayBuffer accessors
2021-06-25 13:30:30 -04:00
jugglinmike
a82aeaa391
Resizable ArrayBuffer: SharedArrayBuffer methods (#3024)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: SharedArrayBuffer methods

* fixup! Resizable ArrayBuffer: SharedArrayBuffer methods
2021-06-25 13:29:29 -04:00
jugglinmike
1db1bb8216
Resizable ArrayBuffer: SharedArrayBuffer ctor (#3023)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: SharedArrayBuffer ctor
2021-06-25 13:27:36 -04:00
jugglinmike
a7fb08e3d7
Resizable ArrayBuffer: DataView accessors (#3022)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: DataView accessors
2021-06-25 13:26:32 -04:00
jugglinmike
5b31a8a9ba
Resizable ArrayBuffer: DataView methods (#3021)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: DataView methods

The files in this patch are highly similar. Only the test for
`DataView.prototype.getBigInt64` and `DataView.prototype.setBigInt64`
were written manually. The others were generated from those files via
the following script:

    #!/bin/bash

    set -eu

    names='
    BigUint64
    Float32
    Float64
    Int16
    Int32
    Int8
    Uint16
    Uint32
    Uint8
    '

    for name in ${names}; do
      lower=$(echo ${name} | tr '[:upper:]' '[:lower:]')
      if [ ${name} == 'BigUint64' ]; then
        replace_bigints=''
      else
        replace_bigints='-e s/\b\([0-9]\+\)n\b/\1/g'
      fi

      sed \
        -e "s/getbigint64/get${lower}/g" \
        -e "s/getBigInt64/get${name}/g" \
        ${replace_bigints} \
        ./test/built-ins/DataView/prototype/getBigInt64/resizable-buffer.js \
        > ./test/built-ins/DataView/prototype/get${name}/resizable-buffer.js

      sed \
        -e "s/setbigint64/set${lower}/g" \
        -e "s/setBigInt64/set${name}/g" \
        ${replace_bigints} \
        ./test/built-ins/DataView/prototype/setBigInt64/resizable-buffer.js \
        > ./test/built-ins/DataView/prototype/set${name}/resizable-buffer.js
    done
2021-06-25 13:24:00 -04:00
jugglinmike
4da5c800a3
Resizable ArrayBuffer: ArrayBuffer accessors (#3020)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: ArrayBuffer accessors

* fixup! Resizable ArrayBuffer: ArrayBuffer accessors
2021-06-25 13:21:11 -04:00
jugglinmike
93ad86b859
Resizable ArrayBuffer: ArrayBuffer methods (#3019)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: ArrayBuffer methods

* fixup! Resizable ArrayBuffer: ArrayBuffer methods
2021-06-25 13:19:33 -04:00
jugglinmike
b3c2d3a88e
Resizable ArrayBuffer: ArrayBuffer constructor (#3018)
* Add "feature" for "Resizable ArrayBuffer" proposal

* Resizable ArrayBuffer: ArrayBuffer constructor
2021-06-25 13:18:42 -04:00
Jamie Kyle
bad7c0487e
Add tests for Object.hasOwn (#2995)
* Add tests for Object.hasOwn

* Update test/built-ins/Object/hasOwn/length.js

Co-authored-by: Jordan Harband <ljharb@gmail.com>

* Update test/built-ins/Object/hasOwn/name.js

Co-authored-by: Jordan Harband <ljharb@gmail.com>

* Fixup comments for Object.hasOwn

* Add Object.hasOwn descriptor test

* use assert.sameValue with true instead of assert()

* remove extra semicolons

* Remove old $ERROR style tests from hasown

* Fix thrown error type in hasown tests

* Fix incorrect test cases

Co-authored-by: Jordan Harband <ljharb@gmail.com>
2021-06-16 17:35:06 -04:00
Michael Dyck
1b16396c88 Delete duplicate feature-declaration 2021-06-10 12:03:05 -04:00
jugglinmike
219ad6ff01
Add test for [[Description]] from Symbol.for (#2970)
* Add test for [[Description]] from `Symbol.for`

* fixup! Add test for [[Description]] from `Symbol.for`
2021-05-13 21:16:43 -04:00
Alexey Shvayka
18638f301f Test non-writable descriptor & valid index 2021-05-11 17:39:18 -04:00
Alexey Shvayka
37999534c2 Test non-enumerable descriptor & valid index 2021-05-11 17:39:18 -04:00
Alexey Shvayka
ac52cbe371 Test non-configurable descriptor & valid index 2021-05-11 17:39:18 -04:00
Alexey Shvayka
ba6fd1d822 Test accessor descriptor & valid index 2021-05-11 17:39:18 -04:00
Alexey Shvayka
c623dd288a Test valid descriptor & invalid index 2021-05-11 17:39:18 -04:00
Alexey Shvayka
63ad029d71 Remove spec step from "info" that is no longer correct 2021-05-11 17:39:18 -04:00
Alexey Shvayka
f89bd5a29b Fix & improve TypeError cross-realm tests for detached buffer 2021-05-11 17:39:18 -04:00
Alexey Shvayka
e1e90abbe9 Test that detached buffer throws TypeError 2021-05-11 17:39:18 -04:00
Alexey Shvayka
88979b5b12 Align [[Value]] ToNumber tests with updated spec 2021-05-11 17:39:18 -04:00
Mike Pennisi
fd029d2d52 Increase precision of assertions for Error Cause
Minimize the code provided to the `assert.throws` utility in order to
reduce the possibility of false positives and to improve failure
messages in non-conforming runtimes.
2021-05-11 17:37:15 -04: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
Shu-yu Guo
70bc32edab
Give Error cause tests the error-cause feature tag (#2977) 2021-04-23 15:53:14 -07:00
legendecas
3e4e07c836
Add tests for stage 3 proposal error cause (#2965)
* Add tests for error cause

* Correct invocation of Proxy constructor

Co-authored-by: Mike Pennisi <mike@mikepennisi.com>
2021-04-23 14:45:27 -04:00
Alexey Shvayka
ce74c5f52d Test BigInt wrapper object 2021-04-20 09:58:16 -04:00
Alexey Shvayka
dcccc418b3 Test Symbol wrapper object 2021-04-20 09:58:16 -04:00
Rick Waldron
bd65623af6 Revert "Add valid index prototype chain [[Set]] tests"
This reverts commit cc18d5bb144a47994555d31e65f74e4936bfd1ee.
2021-04-20 09:56:22 -04:00
Rick Waldron
b90326d9a4 Revert "Add valid index Reflect.set tests"
This reverts commit 20cd505a9659b80d6c03c85ab27d95624a6a0055.
2021-04-20 09:56:22 -04:00
Rick Waldron
3d77404e4f Revert "Add invalid index prototype chain [[Set]] tests"
This reverts commit 477e6ddffec9f15b93e6596749eaf2e45f421065.
2021-04-20 09:56:22 -04:00
Rick Waldron
b110681292 Revert "Add invalid index Reflect.set tests"
This reverts commit a3aa19d2e20aff709f91c1414c6aa33a4fc37ef8.
2021-04-20 09:56:22 -04:00
Alexey Shvayka
a3aa19d2e2 Add invalid index Reflect.set tests 2021-04-20 09:55:27 -04:00
Alexey Shvayka
477e6ddffe Add invalid index prototype chain [[Set]] tests 2021-04-20 09:55:27 -04:00
Alexey Shvayka
20cd505a96 Add valid index Reflect.set tests 2021-04-20 09:55:27 -04:00
Alexey Shvayka
cc18d5bb14 Add valid index prototype chain [[Set]] tests 2021-04-20 09:55:27 -04:00
Alexey Shvayka
6e61dd7754
Test Array's toString() with non-callable "join" (#2973)
* Test Array's toString() with non-callable "join"

* Remove Array.prototype.join modifications
2021-04-15 20:51:08 -04:00
Alexey Shvayka
c00087e129 Test Array.prototype.sort called with a primitive 2021-03-02 16:33:02 -05:00
Gus Caplan
516ca9af39 Update tests for ECMA262 #2216
https://github.com/tc39/ecma262/pull/2216
2021-02-26 11:49:49 -05:00
Ron Buckton
0d922ddc97 Fix lint error 2021-02-25 11:03:39 -05:00
Ron Buckton
64ea2d19e6 rename no-indices-array test 2021-02-25 11:03:39 -05:00
Ron Buckton
d66f270313 PR Feedback 2021-02-25 11:03:39 -05:00
Ron Buckton
a567e4c819 Updates to regexp-match-indices tests based on d-flag 2021-02-25 11:03:39 -05:00
Alexey Shvayka
950d097516 Add Object.freeze test 2021-02-08 15:41:23 -05:00
Alexey Shvayka
a4ca510b55 Add Object.seal test 2021-02-08 15:41:23 -05:00