Commit Graph

70 Commits

Author SHA1 Message Date
Mike Pennisi c51227c3e1 Add tests: resizing ArrayBuffer from DataView ctor 2021-12-18 11:50:14 -05:00
Mike Pennisi 09485d387f Update tests for DataView & resizable Arraybuffer
This change concerns normative text of the Resizable ArrayBuffer
proposal which is believed to be invalid in its current form; a patch
updating the text is under review [1].

[1] https://github.com/tc39/proposal-resizablearraybuffer/pull/78
2021-10-25 09:17:19 -04:00
rwaldron 1c24e4b915 Transform legacy format to harness assertions 2021-09-02 11:21:25 -07: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
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 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 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 f4a9af6587 Fix: $262.detachArrayBuffer -> $DETACHBUFFER 2020-09-28 13:28:39 -04:00
Leo Balter ff9763729d Remove duplicated es[56]id if esid is present 2019-08-05 10:54:37 -04:00
Leo Balter 93635ca3b2 Assert extensibility of dataview objects 2018-09-10 11:13:11 -04:00
Robin Templeton bf1b79d65a remove IsSafeInteger checks for BigInt 2018-04-16 13:29:03 -04:00
Jeff Walden ba783aef91 Add a test verifying that the OrdinaryCreateFromConstructor call in the DataView constructor is checked for underlying-buffer detachedness before its result is used. 2018-04-02 15:19:13 -07:00
Leo Balter ccab9a18b0
Fix length prop tests for the TypedArrays ctors family (#1479) 2018-03-08 09:21:09 -05:00
Rick Waldron 4b5f07a9ff built-ins/DataView/*: make all indentation consistent (depth & character) (#1416) 2018-02-15 15:55:14 -05:00
André Bargull f95b56ab28 Revert "js-beautify: make all indentation consistent (depth & character) (#1409)" (#1412)
This reverts commit a01de4a722.
2018-02-09 12:09:47 -05:00
Rick Waldron a01de4a722 js-beautify: make all indentation consistent (depth & character) (#1409) 2018-02-09 11:35:37 -05:00
Rick Waldron 92a2621901 Frontmatter: fixup "info: >" to "info: |" 2018-01-05 12:27:59 -05:00
Josh Wolfe e10344acf2 generate type coercion tests for DataView tests 2018-01-05 12:09:17 -05:00
Rick Waldron 1f1d2d275d
Merge pull request #1317 from cxielarko/getbiguint64
getBigUint64 tests
2017-11-01 09:01:36 -04:00
Rick Waldron bbdf494500
Merge pull request #1316 from cxielarko/setbigint64
setBigInt64 tests
2017-11-01 08:58:44 -04:00
Robin Templeton f9e93bd61c update frontmatter 2017-10-24 12:36:13 -04:00
Robin Templeton 2f20235f3e setBigInt64 tests 2017-10-24 11:50:14 -04:00
Robin Templeton 9aa15de18f getBigUint64 tests 2017-10-24 11:48:59 -04:00
Robin Templeton c23f22936c update copyright 2017-10-24 11:48:34 -04:00
Robin Templeton f2322cf8a6 use hex literals 2017-10-24 11:48:34 -04:00
Robin Templeton 2892cc78c7 improve error messages 2017-10-24 11:48:34 -04:00
Robin Templeton cca3876881 getBigInt64 2017-10-24 11:48:34 -04:00
Leo Balter 7cbbe51216 Add cross-realm feature 2017-09-22 15:29:10 -04:00
Leo Balter c41faf1aca Add missing Symbol features flags 2017-09-07 15:51:13 -04:00
deathbearbrown fe494ed4d7 add esid to Dataview frontmatter 2017-08-02 15:56:22 -04:00
André Bargull d59e30c95e Remove execute bit from files (#976) 2017-04-13 16:24:07 -04:00
Leonardo Balter 340543bc11
Rename top level 'name' and 'length' bindings
Fix 850
2017-03-14 12:43:24 -04:00
Leo Balter ea45caf046 fix $.agent to $262.agent (#876)
Fixes #875
2017-03-02 12:00:16 -05:00
Rick Waldron fdd2fa9b1c Rename $ => $262. Fixes gh-802 (#823)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-03-01 16:34:15 -05:00
Shu-yu Guo a72ee6d912 SharedArrayBuffer and Atomics tests (#839) 2017-02-07 11:17:31 -05:00
André Bargull 204266794c Fix various test issues (#840)
test/annexB/built-ins/Date/prototype/setYear/time-clip.js
test/built-ins/Date/prototype/setFullYear/new-value-time-clip.js
test/built-ins/Date/prototype/setMonth/new-value-time-clip.js
- Don't try to test time-clip at the end points, because this is near
impossible to get right (needs to consider time zone offset, dst, local
mean time because of Africa/Monrovia, etc.).

test/built-ins/DataView/prototype/setFloat64/detached-buffer-after-toindex-byteoffset.js
test/built-ins/DataView/prototype/setInt16/detached-buffer-after-toindex-byteoffset.js
- Wasn't update to expect RangeError

test/built-ins/Function/internals/Construct/derived-this-uninitialized-realm.js
- Change ClassDeclaration -> ClassExpression to get completion value

test/built-ins/Function/prototype/toString/AsyncFunction.js
- Add missing \n in expected string
- Also fixed in gh-847

test/built-ins/global/global-object.js
- Add 'var' to make test pass in strict-mode

test/language/block-scope/syntax/redeclaration-in-block/attempt-to-redeclare-function-declaration-with-function-declaration.js
- This is allowed in sloppy mode when Annex B is implemented

test/language/expressions/async-generators/expression-yield-as-statement.js
- Fix calls to then()

test/language/module-code/namespace/internals/own-property-keys-binding-types.js
test/language/module-code/namespace/internals/own-property-keys-sort.js
- Tests weren't updated after removal of @@iterator from module
namespace objects

test/language/module-code/namespace/internals/set-prototype-of-null.js
- Fix syntax error

test/language/statements/async-function/early-errors-no-async-generator.js
- No longer valid now that async iteration proposal is at stage 3
2017-02-07 11:10:56 -05:00
jugglinmike 71e573f7da Add tests for realm interactions (#688)
* Add tests for prototype realm inference

* Add tests for miscellaneous realm concerns

* Add tests for realm of spec-created Errors

In some cases, Error objects produced by the specification are
observable from ECMAScript code. Among these cases, some are further
differentiated in that they occur outside of any built-in function and
may be triggered through syntactic production directly. The current
realm record is commonly interpreted incorrectly under these
circumstances.

Add tests asserting that the expected realm record is used when
constructing such Error objects.

* Add tests for realm use in ArraySpeciesCreate

* Add tests for function realm retrieval

* Add tests for cross-realm behaviors of Symbols

* Add tests for GetValue and PutValue

* Add tests for realm of spec-created Arrays

In some cases, Arrays produced by CreateArrayFromList are observable
from ECMAScript code. Among these cases, two occur outside of any
built-in function and may be triggered through syntactic production
directly. The current realm record is commonly interpreted incorrectly
under these circumstances.

Add tests asserting that the expected realm record is used when
constructing arrays.

* Add test for spec-created object

* fixup! Add tests for realm of spec-created Errors

* fixup! Add tests for realm of spec-created Errors

* fixup! Add tests for prototype realm inference

* fixup! Add tests for miscellaneous realm concerns
2016-10-24 10:43:17 -07:00
Tom Care e3ae1c88ff Merge pull request #699 from bocoup/685-range-check
Fix range check tests for DataView#set methods
2016-07-19 14:55:14 -07:00
Leonardo Balter 5525a64fbb
Update DataView method tests for detached buffer check order 2016-07-06 14:37:34 -03:00
Leonardo Balter a78cf3de4a Fix tests for DataView#setFloat when no value arg is provided
Fixes gh-686
2016-07-05 16:29:21 -04:00
Leonardo Balter 9ff1cbb50c
Fix range check tests for DataView#set methods
Fixes gh-685
2016-06-23 17:34:58 -04:00
Leonardo Balter cfc77c83e3 Update tests for TypedArrays, DataView and ArrayBuffer
Ref tc39/ecma262#410
2016-06-13 16:17:09 -04:00
Leonardo Balter d3effa125f Add tests for DataView.prototype.setUint32 2016-05-25 10:28:01 -04:00
Leonardo Balter d672cf24ea Add tests for DataView.prototype.setUint16 2016-05-25 10:28:00 -04:00
Leonardo Balter ab494e1e32 Add tests for DataView.prototype.setUint8 2016-05-25 10:28:00 -04:00
Leonardo Balter 88f427b4b9 Add tests for DataView.prototype.setInt32 2016-05-25 10:28:00 -04:00
Leonardo Balter a9b65bdf2d Add tests for DataView.prototype.setInt16 2016-05-25 10:28:00 -04:00
Leonardo Balter 138f8b1fdb Add tests for DataView.prototype.setInt8 2016-05-25 10:27:59 -04:00