Commit Graph

155 Commits

Author SHA1 Message Date
Mike Pennisi ab353c6e73 Correct tests and improve documentation
The tests for the "Array findFromLast" proposal were originally authored
based on related tests that had already been merged to the repository's
`main` branch [1]. While those new tests were under review, a number of
tests for the Resizable ArrayBuffer proposal were found to be incorrect
[2]. The problem was fixed for the tests in `main`, but because the
corresponding tests for "Array findFromLast" were not yet merged, the
error persisted there [3].

Apply the same correction to the new tests.

[1] https://github.com/tc39/test262/issues/3111
[2] https://github.com/tc39/test262/pull/3113
[3] https://github.com/tc39/test262/pull/3045
2021-08-02 12:20:09 -04:00
Wenlu Wang 915f7e79be Fix incorrect case 2021-07-28 13:53:14 -04:00
Wenlu Wang 74727cd4ed Fix CR issues 2021-07-28 13:53:14 -04:00
Wenlu Wang 6a6211e495 Fix format 2021-07-28 13:53:13 -04:00
Wenlu Wang 3d82bd7ffb Fix format 2021-07-28 13:53:13 -04:00
Wenlu Wang ed2addaa73 Fix format 2021-07-28 13:53:13 -04:00
rwaldron 4b54d54113 Fix copyrights and features metadata 2021-07-28 13:53:12 -04:00
Wenlu Wang 41e946d00b Fix format 2021-07-28 13:51:38 -04:00
Wenlu Wang 642a180e62 Fix minor typo 2021-07-28 13:51:38 -04:00
Wenlu Wang f354da8ba4 Add typedarray findLastIndex 2021-07-28 13:51:38 -04:00
Wenlu Wang cb54d119e3 Add typedarray find last tests 2021-07-28 13:51:37 -04:00
Mike Pennisi 8428e70367 Correct tests and improve documentation 2021-07-28 11:04:49 -04:00
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
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
Yusuke Suzuki 93a2ba8c28 Fix BigInt TypedArrays tests
1. test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-may-detach-buffer.js
It is not updated when a60a67ea88 is landed. This patch fixes it.

2. test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-detachbuffer.js
After detaching, BigInt64Array/BigUint64Array will produce undefined for indexed access. And
if `filter`'s callback says `true` for these results, we need to store `ToBigInt(undefined)`
to a newly resulted BigInt64Array/BigUint64Array and this will throw an error. But this test
assumed it does not throw. This patch fixed flag so that we do not throw that error while keeping
detached typed arrays tested.
2021-02-03 22:10:52 -05:00
Rick Waldron de091de9f6 Include indexOf(undefined, ...) and lastIndexOf(undefined, ...) 2020-12-16 11:59:56 -05:00
Rick Waldron 167e596a64 Align detached buffer semantics with web reality, R6. Fixes gh-2915 2020-12-16 11:59:56 -05:00
Rick Waldron 96aff62fb2 IntegerIndexedElementSet should always indicate success. Ref: tc39/ecma262/pull/2210 2020-12-02 15:06:36 -05:00
Ross Kirsling 73798cbc61
Fix typos for at/prop-desc tests. (#2908) 2020-11-19 02:32:38 -08:00
Leo Balter 65bd4432f9 Fix missing renames for item->at
Ref #2905
2020-11-18 15:18:14 -05:00
Ross Kirsling df1bce9c2e Rename item() to at(). 2020-11-18 13:31:11 -05:00
Rick Waldron 3c58228465 Align detached buffer semantics with web reality, R4. Fixes gh-2879 2020-11-02 12:20:44 -05:00
Rick Waldron 224c0ce19e Replace unicode characters that pyyaml cannot read 2020-10-29 13:49:09 -04:00
Rick Waldron 0001489473 Update test/built-ins/TypedArray/prototype/forEach/callbackfn-detachbuffer.js
Co-authored-by: Ross Kirsling <rkirsling@gmail.com>
2020-10-21 20:14:36 -04:00
Rick Waldron a60a67ea88 Align detached buffer semantics with web reality, R3 2020-10-21 20:14:36 -04:00
Rick Waldron f2a8384d4d Align detached buffer semantics with web reality, R1 2020-10-16 20:38:21 -04:00
Rick Waldron 59463a2dd7 Cleanups 2020-10-09 13:46:50 -04:00
Rick Waldron bf900a30b2 Create and assign feature: "align-detached-buffer-semantics-with-web-reality" 2020-10-09 13:46:50 -04:00
Rick Waldron 47be1e83e2 [[Delete]] ( P ) 2020-10-09 13:46:50 -04:00
Rick Waldron 9c069a6810 sec-%typedarray%.prototype.slice 2020-10-09 13:46:50 -04:00
Rick Waldron 36c2cd165f WIP: Align detached buffer semantics with web reality
To support https://github.com/tc39/ecma262/pull/2164
2020-10-09 13:46:50 -04:00
Rick Waldron 20e3101105 Lint fixes 2020-10-06 12:01:34 -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 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 fd65b84378 Coverage: %TypedArray%.prototype.sort( comparefn = undefined ). Fixes gh-2843 2020-10-05 11:05:57 -04:00
Rick Waldron e3b12065b2 Coverage: Array.prototype.item, String.prototype.item, TypedArray.prototype.item. Closes gh-2809, gh-2810, gh-2811 2020-09-24 17:23:38 -04:00
Alexey Shvayka 2dcdba94e5 Simplify tests 2020-06-17 12:42:37 -04:00
Alexey Shvayka 23417d9569 Test %TypedArray%.prototype.set with primitives 2020-06-17 12:42:37 -04:00
Alexey Shvayka adf2cf4204 Add %TypedArray%.prototype.lastIndexOf tests 2020-06-10 15:59:14 -04:00
Alexey Shvayka 063cdb5731 Add %TypedArray%.prototype.indexOf tests 2020-06-10 15:59:14 -04:00
Ross Kirsling 723205bd54 Fix invalid YAML from #2470 and #2474. 2020-02-20 12:12:03 -05:00
Natalie Silvanovich 5c9b5ed610 Updating description for search element test 2020-02-06 12:43:52 -05:00
Natalie Silvanovich 07e708d900 TypedArray includes tests 2020-02-06 12:43:52 -05:00
Natalie Silvanovich 7ad85e90a9 Security test for TypedArray.prototype.sort based on CVE-2016-7288 2020-02-06 11:10:17 -05:00
Natalie Silvanovich a12677ec4c Adding security tests for TypedArray.prototype.fill based on CVE-2016-4734 2020-02-05 15:04:06 -05:00
Natalie Silvanovich c2e157240d Test that Typed Array internal slots are not inherited by TypedArray.prototype.buffer 2020-02-05 14:31:10 -05:00
Leo Balter 6e4d442cc6
Fix syntax typos + whitespace (#2466)
Ref #2444
2020-01-08 13:57:49 -05:00
Natalie Silvanovich 65afdfbff6 Additional tests for TypedArray copyWithin (#2444) 2020-01-08 13:26:40 -05:00
Gus Caplan a53f43e1ce
add missing newlines in tests 2019-11-10 20:18:56 -08:00
Mike Pennisi f26c2a11bd Remove unnecessary "includes" directives
The values defined by the referenced files are not used by these tests.
This makes their inclusion superfluous, which needlessly increases the
time to execute the tests and may confuse some readers.
2019-09-25 13:59:24 -04:00