Commit Graph

1414 Commits

Author SHA1 Message Date
Gus Caplan 5b231ab2d6 add missing WeakSet and WeakMap features 2020-02-08 08:54:09 -05:00
Rick Waldron 811090fce2 Fix: \$DONE() must not be called with an argument, unless the argument is an error. 2020-02-07 12:24:43 -05:00
Jordan Harband 0ebbdf0395 `Promise.prototype.finally` thunks have a length of 0 2020-02-07 11:44:31 -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
Alexey Shvayka 72c4433687 Add `replaceValue` evaluation order test 2020-02-05 15:08:07 -05:00
Alexey Shvayka 946a2a3fec Merge "length" tests 2020-02-05 15:08:07 -05:00
Alexey Shvayka 57d5ffa471 Fix $DONE usage 2020-02-05 15:05:51 -05:00
Alexey Shvayka c5b1c97362 Fix isConstructor checks 2020-02-05 15:05:51 -05:00
Alexey Shvayka b3ec56fb8c Add CreateResolvingFunctions tests 2020-02-05 15:05:51 -05:00
Alexey Shvayka 8ce27898b9 Add Then Finally Functions test 2020-02-05 15:05:51 -05:00
Alexey Shvayka 1e13f2b1e7 Add Catch Finally Functions test 2020-02-05 15:05:51 -05:00
Alexey Shvayka 95fd012c66 Add isConstructor to Promise.prototype.finally test 2020-02-05 15:05:51 -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
Alexey Shvayka 963917618f Test that JSON.stringify calls replacer on deleted properties 2020-02-05 14:25:04 -05:00
Alexey Shvayka 4383f2c6ba Add Object.{freeze,preventExtensions,seal} abrupt completion tests (#2468)
* Add Object.freeze test

* Add Object.preventExtensions test

* Add Object.seal test
2020-01-14 11:31:45 -05:00
Ross Kirsling 01007880bc Add test verifying offsetless date-time string is local time. (#2461)
* Add test verifying offsetless date-time string is local time.

* Fix copyright year.
2020-01-08 15:32:28 -05:00
Ross Kirsling 623e9d199a Add tests for Array methods throwing with string receiver. (#2463) 2020-01-08 14:00:30 -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 502cc20010 fix delete test, add error tests, fix lint (#2453) 2019-12-21 16:57:41 -05:00
Alexey Shvayka 19fd4bea79 Improve Object.prototype.isPrototypeOf coverage (#2446) 2019-12-18 21:33:31 -05:00
Mathieu Hofman a3370bfca5 FinalizationGroup: Improve tests for cleanupSome/unregister interactions (#2440)
* Add test for unregister when the cell was already cleaned up

* FinalizationGroup.cleanupSome: call unregister after gc is performed
2019-12-18 11:26:54 -05:00
Natalie Silvanovich 0ddce199d5 Adding tests for Array.prototype.copyWithin (#2443)
* Adding tests for Array.prototype.copyWithin. This case caused a security bug in Moddable
2019-12-18 11:26:19 -05:00
Kevin Gibbons cadd47aa5f Add test for for-in order (#2432)
* Add EnumerateObjectProperties tests for builtins which use it

* Add tests for EnumerateObjectProperties for for-in

* Add feature flag for for-in-order
2019-12-18 11:25:20 -05:00
Jon Coppeard f7ad2953ed Update tests now that FinalizationGroup.prototype.cleanupSome throws if cleanup is currently in progress. (#2434)
This behaviour was changed in: https://github.com/tc39/proposal-weakrefs/pull/158
2019-12-18 11:23:23 -05:00
Leo Balter 5c41447b75
Remove incorrect tests for AggregateError#toString (#2435)
A conforming implementation of ECMAScript may provide additional types, values, objects, properties, and functions beyond those described in this specification. In particular, a conforming implementation of ECMAScript may provide properties not described in this specification, and values for those properties, for objects that are described in this specification.

Ref #2433
2019-12-03 12:43:58 -05:00
Leo Balter 3682ddd7e3
Add tests for String#replaceAll (#2423)
Fixes #2417
2019-11-18 10:22:07 -05:00
Leo Balter 7040938bd0
Fix tests for AggregateError (#2419)
Ref tc39/proposal-promise-any#49
2019-11-15 12:46:58 -05:00
Jon Coppeard 43b0c7650d Update tests for FinalizationGroup#register (#2424)
FinalizationGroup#register should throw if called with target and holdings being the same value.

This change happenend in: https://github.com/tc39/proposal-weakrefs/pull/165
2019-11-14 11:13:32 -05:00
Leo Balter 8f8b3374c2
Merge pull request #2420 from shvaikalesh/improve-json-parse-coverage
Improve JSON.parse reviver parameter coverage
2019-11-12 13:38:48 -05:00
Leo Balter 8544b062f3
Merge pull request #2418 from leobalter/remote-aggregateerror-tostring
Remove aggregateerror tostring
2019-11-12 11:56:30 -05:00
Alexey Shvayka 5728e1b6c9 Add reviver prototype chain lookup tests 2019-11-12 02:14:05 +02:00
Alexey Shvayka 80a99f703b Add reviver object with non-configurable property tests 2019-11-12 02:14:05 +02:00
Alexey Shvayka 027cc0c0ca Add reviver array with non-configurable property tests 2019-11-12 02:14:05 +02:00
Alexey Shvayka 64ce046229 Add reviver wrapper test 2019-11-11 23:58:07 +02:00
Alexey Shvayka da9612db98 Add some more Proxy/ownKeys invariants tests (#2413)
* Defer making [[ProxyTarget]] non-extensible

* Fix typo in method name

* Add last Object.keys with Proxy invariant test

* Add Object.getOwnPropertySymbols with Proxy invariants tests

* Add Object.getOwnPropertyNames with Proxy invariants tests

* Replace "es6id" with "esid" in Object.getOwnPropertySymbols tests
2019-11-11 15:02:07 -05:00
Alexey Shvayka 600245fcd3 Add integer index tests for Proxy "set" and "has" traps (#2412)
* Make Proxy [[HasProperty]] in prototype test more robust

* Add integer index Proxy [[HasProperty]] in prototype test

* Add integer index Proxy [[Set]] in prototype test
2019-11-11 15:01:39 -05:00
Leo Balter 02bdf77b19 Add test for AggregateError's toString
Ref tc39/proposal-promise-any#49
2019-11-11 12:19:20 -05:00
Leo Balter 90231ad16f Remote tests for AggregateError.prototype.toString
Ref tc39/proposal-promise-any#49
2019-11-11 11:20:24 -05:00
Gus Caplan a53f43e1ce
add missing newlines in tests 2019-11-10 20:18:56 -08:00
Leo Balter 1bc193528b
Add tests for AggregateError (#2406)
This covers part of the Promise.any proposal
2019-11-07 11:01:21 -05:00
Jordan Harband 59d1af9d2a [matchAll] pass a global regex (#2399)
- also, expect the right kind of error in `flags-undefined-throws.js`

Fixes #2398
2019-10-09 10:32:39 -04:00
Leo Balter d49777de27 Whitespace cleanups. CRLF => LF 2019-10-08 20:44:09 -04:00
Alexey Shvayka bb6ce7e435 Add test for Proxy "has" trap on prototype (#2382)
* Use allowProxyTraps.js in [[Set]] tests

* Add [[HasProperty]] test
2019-10-08 14:58:27 -04:00
Alexey Shvayka 1aac32e2f8 Improve Proxy/ownKeys invariants coverage (#2384)
* Add non-configurable invariant test

* Add non-extensible invariant test
2019-10-08 14:54:46 -04:00
Alexey Shvayka 71a70fc117 Use isConstructor in "executor-function-nonconstructor.js" (#2393) 2019-10-08 14:41:29 -04:00
Mathias Bynens a898fe9826 Add missing `regexp-match-indices` feature tags (#2395) 2019-10-08 14:38:39 -04:00
Leo Balter 8688c4ab79
Fix typo: iterator => iterator (#2394)
Fix #2392
2019-10-07 12:43:23 -04:00
Jordan Harband f3e950e8ed tests for String.prototype.matchAll changes (#2389)
Per https://github.com/tc39/ecma262/pull/1716
2019-10-03 14:47:00 -04:00
Leo Balter e2903e2648
Merge pull request #2366 from bocoup/unnecessary-includes
Remove unnecessary "includes" directives
2019-09-27 16:46:22 -04:00
jugglinmike 87e875f6c9 Correct errors in metadata (#2378)
* Correct typo

* Correct esid
2019-09-27 16:32:52 -04:00
jugglinmike 8953024f1a Remove duplicate tests (#2377)
* Remove duplicate test

The behavior under test is verified by another file in Test262:

test/language/expressions/compound-assignment/S11.13.2_A2.1_T3.3.js

That version is preferable because it does not depend on `eval` and
because it supports both strict and non-strict mode.

* Remove overly-permissive test

By asserting only the presence of an "own" property, this test can be
satisfied from both strict mode code and non-strict mode code.

The following test verifies the presence of the "own" property and the
associated descriptor's values in strict mode:

test/language/arguments-object/10.6-13-c-3-s.js

That subsumes the semantics verified by this test, making it
superfluous. Remove the test.

* Remove overly-permissive test

By asserting only the absence of a syntax error, this test can be
satisfied from both strict mode code and non-strict mode code.

The following test verifies the runtime behavior of accessing the
property in strict mode code:

test/language/arguments-object/10.6-13-c-1-s.js

That subsumes the semantics verified by this test, making it
superfluous. Remove the test.

* Remove duplicate test

The behavior under test is verified by another file in Test262:

test/built-ins/Math/prop-desc.js

That version is preferable because it follows the test suite's
convention for testing property descriptors and because it supports both
strict and non-strict mode.

* Remove duplicate test

The behavior under test is verified by two separate files:

test/language/statements/function/line-terminator-non-strict.js
test/language/statements/function/line-terminator-strict.js

These files differ only in their usage of the `noStrict`/`onlyStrict`
metadata. Because tests are intended to be interpreted in both modes by
default, these can be expressed with a single file that does not limit
the permissible modes.
2019-09-27 16:31:44 -04:00
Leo Balter 83d9f750c9
Merge pull request #2376 from bocoup/ud-coverage
Improve coverage
2019-09-27 16:30:13 -04:00
jugglinmike 479ea0ec0b Avoid false positive (#2375)
Prior to this patch, the modified test would pass if no exception was
produced. Use the `assert.throws` utility function to concisely express
the expectation more completely.
2019-09-27 16:25:07 -04:00
Mike Pennisi 9cd62ffbd7 Improve coverage: ctor props of the global object
Prior to this commit, the descriptors of the constructor properties of
the global object were verified inconsistently, many independent
assertions occured in the same file, and that file test was poorly
located.

Restructure the relevant tests to improve coverage, follow convention,
and promote discoverability.
2019-09-27 15:39:10 -04:00
Mike Pennisi 1f079a3525 Improve coverage: func props of the global object
Prior to this commit, the descriptors of the function properties of the
global object were verified inconsistently, many independent assertions
occured in the same file, and that file test was poorly located.

Restructure the relevant tests to improve coverage, follow convention,
and promote discoverability.
2019-09-27 15:39:10 -04:00
Mike Pennisi f8957be8a7 Improve coverage: value props of the global object
Prior to this commit, the enumerability of the value properties of the
global object were only verified in strict mode, the assertions occured
in the same file, and that file test was poorly located.

Restructure the relevant tests to improve coverage, follow convention,
and promote discoverability.
2019-09-27 15:39:10 -04:00
Mike Pennisi f5d60d4192 Improve coverage
The modified tests are equally valid in strict mode and outside of
strict mode. Remove the flag which limits their use to only one of these
two contexts. Rename tests using the legacy ES5-based naming scheme to
remove the pattern which designates strict mode.
2019-09-27 15:39:10 -04:00
Mike Pennisi 1e4e524251 Update tests to use APIs defined by included files
The `$DETACHBUFFER` function is the preferred mechanism for detaching
array buffers.

Likewise, `verifyNotWritable` is the preferred mechanism for asserting
lack of writability.
2019-09-25 13:59:24 -04: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
Leo Balter 3bfb341203 Fixes after test feedback 2019-09-23 12:26:02 -04:00
Leo Balter 08844700fe Update tests for GC hook, apply async
- Fix incorrect tests for WeakRefs

Ref #2239
Fixes #2260
Fixes #2256
2019-09-23 12:26:02 -04:00
Leo Balter 7134634aa4 Revert "Remove tests based on the $262.gc hook"
This reverts commit d6d37f2f43.
2019-09-23 12:26:02 -04:00
Alexey Shvayka 17685735e1 Add "proto-from-ctor-realm" tests for async functions (#2342)
* Add AsyncFunction test

* Add AsyncGeneratorFunction test
2019-09-20 15:27:32 -03:00
Leo Balter 0fd3cf4d24
Some cleanup follow ups (#2351) 2019-09-18 14:15:53 -03:00
Ron Buckton 1056d8fde9 Add tests for regexp-match-indices (#2309)
* Add tests for regexp-match-indices

* Add tests for unicode matches based on presence of /u flag

* Added deepEqual helper, PR feedback
2019-09-18 13:39:12 -03:00
Alexey Shvayka 256f5f4b46 Improve Proxy/set call parameters coverage (#2347)
* Tweak front matter of basic test

* Simplify basic test

* Add test for proxy as prototype

* Add test for proxy as prototype and __proto__
2019-09-18 13:30:28 -03:00
Alexey Shvayka ff83fb2922 Improve "proto-from-ctor-realm" coverage for Array (#2340)
* Rename "Array/proto-from-ctor-realm.js" test

* Add single argument test

* Add two arguments test
2019-09-18 13:26:40 -03:00
Alexey Shvayka ef7fd2bc27 Add "proto-from-ctor-realm" tests for Intl constructors (#2334)
* Rename "Object/proto-from-ctor.js" test

* Add missing "Symbol" features

* Add Intl.Collator test

* Add Intl.DateTimeFormat test

* Add Intl.NumberFormat test

* Add Intl.PluralRules test
2019-09-11 17:22:21 -03:00
Alexey Shvayka 652cfc764a Add "proto-from-ctor-realm" tests for native errors (#2335)
* Add EvalError test

* Add RangeError test

* Add ReferenceError test

* Add SyntaxError test

* Add TypeError test

* Add URIError test
2019-09-11 17:19:58 -03:00
Leo Balter d6d37f2f43 Remove tests based on the $262.gc hook
Fixes #2239
Closes #2329
2019-09-05 19:38:03 +01:00
Leo Balter 5d84854f27
Avoid usage of Object.keys when asserting order of returned values (#2320)
Fixes #2226
2019-09-04 11:38:18 -03:00
Gus Caplan 841b32c6da fix TypedArray.prototype.sort test (#2326)
* fix TypedArray.prototype.sort test

* Update sorted-values.js

* Update sorted-values.js
2019-09-04 11:36:51 -03:00
Leo Balter 71e40aad50
Fix circular tests for JSON.stringify (#2315)
Ref #2168
2019-08-28 17:37:19 -03:00
Alexey Shvayka d0b5137c15 Improve JSON.stringify coverage (#2168)
* Rename & improve "length" test

* Use verifyProperty in "name" test

* Rename & improve property descriptor test

* Remove duplicated test

https://github.com/tc39/test262/blob/master/test/built-ins/Object/prototype/toString/proxy-array.js

* Rename proxy value test

* Rename & improve String object unwrapping test

* Rename & improve Number object unwrapping test

* Rename & improve Boolean object unwrapping test

* Rename & merge replacer returns undefined tests

* Rename & merge replacer function tests

* Rename replacer array revoked proxy test

* Add cross-realm replacer array revoked proxy test

* Add array proxy replacer test

* Add replacer array keys order test

* Add empty replacer array test

* Add non-finite numbers serialization test

* Add replacer array abrupt completion test

* Add replacer array with duplicates test

* Add replacer array ignores undefined test

* Add replacer array unwraps strings test

* Add replacer array unwraps numbers test

* Rename & merge circular object tests

* Add circular array test

* Rename & merge top-level primitives tests

* Rename string escape tests

* Rename BigInt tests

* Rename & improve function value test

* Add replacer function abrupt test

* Rename & merge wrong space type tests

* Rename float number space test

* Rename & improve Number object space test

* Rename & improve String object space test

* Rename basic numeric space test

* Rename string space slice test

* Add replacer array numbers test

* Add toJSON abrupt completions test

* Add not callable toJSON test

* Add toJSON call arguments test

* Add replacer array wrong types test

* Rename & improve string space test

* Rename & improve replacer wrong type test

* Add built-in object requirements test

* Add basic toJSON result test

* Add abrupt array value test

* Add abrupt object value test

* Rename & merge space number clamp tests

* Add replacer function wrapper test

* Add symbol value test

* Add negative zero value test

* Add replacer function & toJSON test

* Add circular object from toJSON test

* Add circular array from toJSON test

* Add circular object from replacer test

* Add circular array from replacer test

* Add replacer function arguments test

* Split & improve proxy value test

* Split & improve revoked proxy value test
2019-08-28 17:34:59 -03:00
Leo Balter 1c2bd105fb
Remove shared-nonint-views.js files (#2314)
Ref #2103
2019-08-28 16:23:07 -03:00
André Bargull e48bf299a6 Ensure Atomics functions validate the TypedArray type before coercing the other arguments (#2103) 2019-08-28 16:19:22 -03:00
Caio Lima fbbab61b4a Adding cases to check if SyntaxError is thrown if AllPrivateIdentifiersValid returns false. (#2301) 2019-08-28 14:58:43 -03:00
Alexey Shvayka 8042c57d9b Add Promise#finally invoked on thenable test (#2312)
* Rename proxy context test

* Add thenable context test
2019-08-28 12:42:24 -03:00
André Bargull 59a1a016b7 Assign "name" property to all anonymous functions (#2299)
Implements the changes from <https://github.com/tc39/ecma262/pull/1490>.
2019-08-15 10:58:40 -04:00
Kubilay Kahveci 9b29709797 Add tests for .toString() of private methods (#2268) 2019-08-05 16:47:19 -04:00
Leo Balter ff9763729d Remove duplicated es[56]id if esid is present 2019-08-05 10:54:37 -04:00
Gus Caplan 2fb39cb4e9 add missing feature (#2250) 2019-07-22 12:46:59 -04:00
André Bargull d8c20b423b Call $DONE function exactly once per test
Also make a note in CONTRIBUTING.md that `$DONE` shouldn't be called multiple times.
2019-07-22 02:12:24 -07:00
Caio Lima 1dc78879d4 Add edge tests to verify BigInt to Number conversion when BigInt can't directly be represented by a Number. 2019-07-19 13:53:01 -04:00
Leo Balter d02fe7db38
Add coverage for non object values of the Properties arg of Object.create (#2238)
Fixes #2237
2019-07-15 16:17:03 -04:00
Leo Balter 6cb0a531af Fix typos 2019-07-11 11:17:30 -04:00
Leo Balter b45bf4b6fa fixup! Some edgy cases for weakrefs/finalizationgroups 2019-07-11 11:17:30 -04:00
Leo Balter 3c293f0e6c Some edgy cases for weakrefs/finalizationgroups 2019-07-11 11:17:30 -04:00
Alexey Shvayka 19b5a5a635 Improve Object#toString coverage (#2202)
* Move proxies with non-string toStringTag to separate file

* Add coverage for async proxy functions

* Add coverage for built-ins with non-string toStringTag

* Move async proxy function tests to new file
2019-07-10 14:00:04 -04:00
Leo Balter 1ef21eb50b fixup! Cleanup some tests for FinalizationGroup 2019-07-02 10:04:04 -04:00
Leo Balter 6242304cd0 Cleanup some tests for FinalizationGroup 2019-07-02 10:04:04 -04:00
Timothy Gu 9dfb9e14e0 Fix WeakMap/WeakSet typo
The test tries to test against WeakSet, but used WeakMap instead.
2019-07-02 09:37:46 -04:00
Alexey Shvayka d7c95efe66 Improve "name" tests of Promise built-in functions (#2179) 2019-06-26 15:03:14 -04:00
Leo Balter 7c7d3f756c Fix tests for FinalizationGroup 2019-06-26 13:49:08 -04:00
Leo Balter f7f07a9010 Add a test for FinalizationGroupCleanupIteratorPrototype 2019-06-21 20:00:35 -04:00
Gus Caplan 61ccff550e Fix invoke-resolve-get-error-close tests (#2210) 2019-06-21 14:26:57 -04:00