Commit Graph

54 Commits

Author SHA1 Message Date
Gus Caplan ef1ad4c041 add dup __proto__ in json test 2020-10-08 18:05:00 -04:00
Gus Caplan 881c9e3ba5 move __proto__ tests 2020-10-08 18:05:00 -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 12ed905003 Clean up some existing constructor checks; eliminate duplicate checks 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
Leo Balter b9e4010b20
Fix language in test file (#2700) 2020-07-13 15:01:38 -07:00
Gus Caplan a799a4ac23 Sort out __proto__ occurances outside of annexB 2020-04-18 17:04:51 -04:00
Alexey Shvayka 8fe71e1f56 Drop JSON.stringify stack overflow tests 2020-03-25 11:59:43 -04:00
Alexey Shvayka 1eff480aca Add toJSON stack overflow test 2020-03-23 14:47:16 -04:00
Alexey Shvayka 2255a0ff11 Add replacer stack overflow test 2020-03-23 14:47:16 -04:00
Alexey Shvayka d2b5f63a15 Improve "info" meta of replacer with deleted property test 2020-03-23 14:47:16 -04:00
Alexey Shvayka 963917618f Test that JSON.stringify calls replacer on deleted properties 2020-02-05 14:25:04 -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
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
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 ff9763729d Remove duplicated es[56]id if esid is present 2019-08-05 10:54:37 -04:00
Alexey Shvayka 395401cba0 Slightly improve JSON.parse coverage (#2196) 2019-06-12 15:29:04 -04:00
Andy Wingo 298ad6907b Add new test for receiver of toJSON on bigint values (#2079)
Spec link:

  https://tc39.github.io/proposal-bigint/#sec-serializejsonproperty

Thanks to André Bargull for the test:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1528784
2019-02-19 13:23:41 -05:00
Richard Gibson e064fcd7ce Remove redundant JSON test 2018-10-03 11:06:32 -04:00
Richard Gibson 58e308753c Fix grammar in JSON.stringify tests 2018-10-03 11:06:32 -04:00
Richard Gibson d961fcc905 Add feature for well-formed-stringify tests 2018-10-03 11:06:32 -04:00
Richard Gibson ce967f7a86 Add tests for proposal-well-formed-stringify
* unpaired surrogate escape sequences
2018-10-03 11:06:32 -04:00
Richard Gibson 783fc5d8bb Remove redundant test 2018-10-03 11:06:32 -04:00
Richard Gibson d6e83453b2 Simplify and improve control character escaping tests 2018-10-03 11:06:32 -04:00
Richard Gibson 61fdc701fa Remove duplicate test 2018-10-03 11:06:32 -04:00
Richard Gibson 950d58a7ca Improve test description grammar 2018-10-03 11:06:32 -04:00
Robin Templeton dbf1362cbc Check that JSON.stringify works with BigInt objects from other realms
This is based on André Bargull's test case in
<https://bugzilla.mozilla.org/show_bug.cgi?id=1464757>.
2018-05-28 19:58:02 -04:00
Rick Waldron 9f57733ed9 Test all no-construct no-call objects consistently (#1520)
Related to https://github.com/tc39/ecma262/pull/1177
2018-04-19 11:23:17 -04:00
Rick Waldron 7c66f39f41 built-ins/JSON/*: make all indentation consistent (depth & character) (#1440) 2018-02-15 15:25:45 -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
Robin Templeton 184a37f011 additional BigInt JSON tests (#1235)
* additional BigInt JSON tests

* single quotes

* BigInt stringify order of steps
2017-10-03 17:00:31 -04:00
Robin Templeton 37beb36524
add BigInt tests 2017-08-24 15:58:14 -04:00
André Bargull d59e30c95e Remove execute bit from files (#976) 2017-04-13 16:24:07 -04:00
jugglinmike 2c5138a4c7 Add tests for abrupt completions during JSON.parse (#721)
* Add tests for abrupt completions during JSON.parse

Due to the use of the IsArray abstract operation, observing many of the
targeted semantics requires the use of a Proxy exotic object. Mark the
tests that require this unrelated ES2015 feature using a dedicated
"features" flag.
2016-07-19 14:33:27 -07:00
jugglinmike 96c4e7730b Json whitespace (#724)
* Express JSON syntax tests with multiple assertions

When written with a single assertion, this test verifies only that "one
or more" of the Unicode points produces a SyntaxError. Re-factor the
test so that parsing behavior for each code point can be tested in
isolation.

* Re-introduce assertion

ECMAScript edition 2016 relies on the Unicode standard at version 8.0.0.
As part of a larger effort to update Test262 accordingly, the assertion
for the SyntaxError resulting from the use of the Mongolian Vowel
Separator (U+180E) was removed. However, ECMA-401 (The JSON Data
Interchange Format) continues to describe "insignificant whitespace" as
follows:

> Insignificant  whitespace  is  allowed  before  or  after  any  token.
> The  whitespace  characters  are:  character  tabulation  (U+0009),
> line  feed  (U+000A),  carriage  return (U+000D),  and  space
> (U+0020)

And because ECMA262 specifies step 2 of the `JSON.parse` algorithm as
follows:

> 2. Parse JText interpreted as UTF-16 encoded Unicode points (6.1.4) as
>    a JSON text as specified in ECMA-404. Throw a SyntaxError exception
>    if JText is not a valid JSON text as defined in that specification.

...the use of U+180E between JSON tokens should continue to produce a
SyntaxError, regardless of ECMA262's updated Unicode standard.

* fixup! Express JSON syntax tests with multiple assertions
2016-07-06 23:06:58 -07:00
Mathias Bynens 3a5a09eba2 Ensure U+180E is no longer considered whitespace
Ref. https://hashseed.blogspot.com/2014/08/in-ecma-262-5.html
Ref. https://github.com/tc39/ecma262/pull/300#issuecomment-181376767
Ref. 9b10d2a597

Fix and add @anba’s U+180E tests
2016-07-06 10:11:32 -04:00
jugglinmike ee7496f713 Add tests for usage of IsArray (#667) 2016-06-10 15:07:40 -04:00
André Bargull ca61d9b876 Add missing tests for "length" and "name" properties of built-in functions
Note: Already uses the updated DataView function lengths from tc39/ecma262#266 (ES2016 Draft 2015-12-20)
2016-01-15 18:12:05 +01:00
Rick Waldron a2554d909b Merge branch 'remove-runTestCase-builtins-other' of https://github.com/anba/test262 into anba-remove-runTestCase-builtins-other
# By André Bargull
# Via André Bargull
* 'remove-runTestCase-builtins-other' of https://github.com/anba/test262:
  Replace runTestCase with assert helpers, rest [test/built-ins]
  Replace runTestCase with assert helpers [test/built-ins]

Conflicts:
	test/built-ins/Array/from/S22.1.2.1_T1.js
	test/built-ins/Array/from/S22.1.2.1_T2.js
	test/built-ins/Array/from/S22.1.2.1_T3.js
2015-09-04 13:25:41 -04:00
Rick Waldron 50423896d5 Merge pull request #414 from bocoup/symbol-to-string-tag
Add tests for well-known Symbol: @@toStringTag
2015-09-02 17:15:55 -04:00
André Bargull 4ec97779fd Replace runTestCase with assert helpers, rest [test/built-ins] 2015-08-13 17:57:23 +02:00
André Bargull 1b14708467 Replace runTestCase with assert helpers [test/built-ins] 2015-08-13 17:50:58 +02:00
André Bargull 589b638ab5 Replace runTestCase with assert.throws [test/built-ins] 2015-08-11 17:44:37 +02:00
Mike Pennisi d6bbbc9aed Add tests for well-known Symbol: @@toStringTag 2015-08-07 20:02:44 -04:00