Commit Graph

1454 Commits

Author SHA1 Message Date
André Bargull fdccf26317 Update length property test for Intl.DateTimeFormat.prototype.format
Per https://github.com/tc39/ecma402/issues/76
2017-02-22 18:05:16 +01:00
André Bargull 7e94b8b7ac Fix executor arguments validation in Promise subclass test 2017-02-22 18:05:08 +01:00
André Bargull 8a4abc2a00 Replace __proto__ with non-Annex B alternative 2017-02-22 18:04:59 +01:00
André Bargull bb369e1e7c Fix typo in TypedArray test with SharedArrayBuffers 2017-02-22 18:04:51 +01:00
André Bargull c16359bc3c Update tests for classes extending null
Per https://github.com/tc39/ecma262/pull/781
2017-02-22 18:04:43 +01:00
Caitlin Potter 098f9ca3de Add tests for try/finally in async functions 2017-02-17 19:29:21 -05:00
⭐caitp⭐ be0964c8ff Add tests for %TypedArray%.prototype.copyWithin() with target/start/end=Infinity (#849)
ToInteger can result in the values +Infinity and -Infinity.
2017-02-13 13:51:45 -08:00
littledan f21ac5609b Fix call to assert.notSameValue (#859)
Thanks to @demurgos for spotting this bug at #858
2017-02-13 13:48:38 -08:00
littledan 91ba9a0a25 Update RegExp tests for the semantics change (#853)
Spec change at https://github.com/tc39/ecma262/pull/798
2017-02-09 12:51:02 -05:00
littledan 1fb47cba88 Remove empty info section from a SharedArrayBuffer test (#852)
This section is useless (and also trips up the YAML parser V8 uses)
2017-02-07 15:41:48 -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
Josh Wolfe 4203261ba2 add line feed following `{` of F.p.toString output for dynamic functions (#847)
This is a continuation of 4a5c52beb5.
2017-02-07 11:06:37 -05:00
Corey Frang 8a0563dd5e Remove old test file (now using the named version) 2017-01-31 10:55:58 -05:00
Corey Frang 80b091ce2d Add Array.prototype.every.length tests 2017-01-31 10:55:58 -05:00
Leo Balter a8c0939bc3 Merge pull request #766 from juandopazo/date-utc-nan
Add tests for non-optional arguments of Date.UTC()
2017-01-23 18:10:21 -05:00
Lyza Danger Gardner d13565ab05 Rename 2017-01-20 16:06:46 -05:00
Lyza Danger Gardner da6657c94c Add descriptor tests for sec-array.isarray 2017-01-20 16:06:46 -05:00
littledan e31b7c43b0 Test for case-insensitivity in invalid BCP 47 usage (#836)
This patch adds a regression test for a previous V8 bug reported originally at
https://bugs.chromium.org/p/v8/issues/detail?id=4215
2017-01-20 11:56:46 -08:00
Rick Waldron f280db452e Test Symbol.toStringTag overrides on primitive wrapper prototypes. Closes gh-809 (#837)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-01-20 11:55:36 -08:00
Michael "Z" Goddard ced9bfd7be Test that Number.prototype.toFixed.length is 1 (#826)
Add a test to confirm that the length member of
Number.prototype.toFixed is 1.
2017-01-19 22:33:53 -05:00
K. Adam White 182e0dee7b Remove es6id line per PR review 2017-01-19 14:51:57 -05:00
K. Adam White 5d69e30929 Add Number.prototype.toFixed return value test
Adds a test to ensure that toFixed returns a string value
2017-01-19 14:51:57 -05:00
Caitlin Potter 6391689a6b Add tests for async generator function expressions 2017-01-19 14:50:15 -05:00
Rick Waldron 8178b763dc Add Date.UTC(+/-Infinity) single arg test variants to infinity-make-day.js
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-01-19 12:00:10 -05:00
Rick Waldron 1163e1a6ff Moves Date.UTC() test to no-args.js
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-01-19 11:58:26 -05:00
Rick Waldron 9a308a967b Adds missing Date.UTC(NaN) variant, per review request.
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2017-01-19 11:55:54 -05:00
Zibi Braniecki 82c2ca0709 Add Intl.PluralRules tests (#782)
* Add Intl.PluralRules tests

* document the tests
2017-01-18 15:56:44 -08:00
Caio Lima c2eacd956e Adding test cases to validate property descriptors on cases of mapped arguments (#815) 2017-01-17 10:27:40 -05:00
Zibi Braniecki 28fc809f3e Remove BYR currency code which has been removed from ISO 4217 (#818) 2017-01-09 14:27:23 -08:00
Michael Ficarra 9737f3704f Function.prototype.toString no longer does line terminator normalisation (#820) 2017-01-09 14:25:02 -08:00
Adam Klein 4ff7e4342e Fix test for instantiating a class extending null (#813)
The sameValue assertion should be that the [[Prototype]] is
equal to the class's prototype, not the constructor.
2016-12-28 17:18:19 -08:00
Kevin Gibbons a73221eb8f mark namespace object toStringTag as non-configurable (#811) 2016-12-28 14:16:24 -08:00
Adam Klein b5edd1256c Add test for setting a module namespace object's prototype to null (#805)
The behavior changed from returning false to true in
https://github.com/tc39/ecma262/commit/13906140a
2016-12-28 10:58:15 -08:00
Kevin Gibbons 03453d6098 Remove tests for module namespace iterator (#810) 2016-12-28 10:57:46 -08:00
littledan d9732d8323 Test for new TypedArray iterator detach logic (#784)
Tests new logic in https://github.com/tc39/ecma262/pull/724
2016-12-28 10:55:25 -08:00
Kevin Gibbons 3b9953d65c remove last usage of arguments.caller (#812) 2016-12-28 10:54:02 -08:00
jungshik 6a0f1189eb Drop 3 tests testing an obsolete Ecma402 v1 spec (#807)
The following three tests check an obsolete provision in Ecma 402
v1 regarding Intl.{Collator,DateTimeFormat,NumberFormat} constructor
called as a function.

Collator/10.1.2.1_4.js
DateTimeFormat/12.1.2.1_4.js
NumberFormat/11.1.2.1_4.js
2016-12-21 11:11:39 -08:00
Kevin Gibbons fcc9e07265 Add test for extending a constructor with null .prototype (#806) 2016-12-21 01:30:06 -05:00
jungshik db3aa4ca4f Replace islamicc with islamic-umalqura in getCanonicalLocales/main.js (Intl402) (#789)
* Replace islamicc with islamic-umalqura

Per discussion in #743, it's implementation-dependent how ismalicc is
canonicalized. However, 'islamic-umalqura' should be treated the same
way by all implementations.

* Remove ar-ma-u-ca-islamic-umalqura per discussion
2016-12-19 11:34:35 -08:00
Michael Ficarra 4a5c52beb5 add line feeds following `{` of F.p.toString output for dynamic functions (#803)
This aligns the tests with this recent change to the F.p.toString proposal:
7432ded0e6
2016-12-06 12:23:05 -05:00
Simon Richter 08071715e4 Add missing operator in test (#804)
Automatic Semicolon Insertion hides an error here by transforming a long
ReturnStatement into a ReturnStatement followed by an ExpressionStatement
that is never reached. The conditions on the second line are thus never
tested.
2016-12-06 12:22:29 -05:00
Kevin Gibbons 3ed2c78600 Avoid writing to top-level vars named "top", for browser compat (#794)
The HTML spec requires browsers define a non-configurable property
of the global (window) object named "top". This makes it
impossible for a browser to successfully run a test in strict mode
if said test attempts to write to a global variable named "top".
2016-11-22 12:02:40 -05:00
Kevin Gibbons c779cba592 Remove tests for arguments.caller (#797) 2016-11-22 11:59:37 -05:00
Michael Ficarra a4a1dd551b fix expected raw value for invalid escape sequences in tagged templates (#800) 2016-11-22 11:45:39 -05:00
Kevin Gibbons e6abf652d9 Ensure that tests calling $DONE have the async flag 2016-11-21 10:14:30 -05:00
Dmitry Panov ffd8039386 Replaced tabs with spaces in YAML. 2016-11-19 23:13:26 +00:00
Aleksey Shvayka bef7f988d2 Ensure Proxy [[Get]] and [[Set]] pass correct receiver (#792)
* Ensure Proxy [[Get]] passes correct receiver

* add [[Get]] test for proxy in prototype

* diversify how traps are missing

* ensure [[Set]] passes correct receiver

* rename to match other tests

* remove extra tests

* add esid

* add description
2016-11-17 14:26:34 -08:00
Sathya 84e6ba81d0 Update context-non-object-with-promise.js (#790)
Promise constructor accepts only one executor function
2016-11-15 10:45:03 -08:00
Josh Wolfe 4fd91d8904 fix incorrect tests for trailing commas (#787) 2016-11-11 09:44:38 -08:00
dop251 8982c3c3ab Reformat negative tests metadata (#785) 2016-11-11 09:43:36 -08:00
Henrique Ferreiro d1d91af256 Integer indexed property descriptor must be non-configurable (#786)
* Integer indexed property descriptor must be non-configurable

* Make the configurable key explicitly 'false'
2016-11-11 09:42:01 -08:00
jugglinmike c9569a7e7e Improve coverage for YieldExpression (#681)
* Re-organize coverage for YieldExpression

* Extend test coverge for YieldExpression

* fixup! Extend test coverge for YieldExpression

Remove unused variables
2016-10-24 11:29:56 -07:00
jugglinmike 720c3cc8cc Update for new `eval` restrictions on `super` (#781)
A recent change to the specification [1] introduces parse-time errors
for certain usages of `super` within eval code. Modify all tests that
are affected by this change:

- Update the test bodies to accurately enforce the new semantics
- Rename files to better reflect the section of the specification that
  they enforce
- Update test meta-data
  - Change the `esid` meta-data to reflect the location of the relevant
    specification text
  - Remove the `es6id` meta-data as the behavior is no longer relatable
    to that specification
  - Introduce the `features` meta-data in cases where the test file's
    new location no longer reflects all required language features

[1] "Normative: Clarify rules around super inside eval"
    https://github.com/tc39/ecma262/pull/685
2016-10-24 10:43:44 -07: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 f39b7cfb7a Merge pull request #701 from bocoup/audit2016-section-25-promises
Extend coverage for Section 25 - Promises
2016-10-20 13:02:49 -07:00
Kevin Gibbons b4c633fc4f Add test for inequality of RegExps created from the same source (#776) 2016-10-20 11:41:31 -07:00
Leo Balter 638c4801e6 Merge pull request #778 from jugglinmike/negative-reform-9
Encode expected error "phase"
2016-10-20 12:59:30 -04:00
Viktor 22f8df2315 Update S15.4.4.11_A7.2.js (#777)
`Array.prototype.sort` should be used instead of `Array.sort`
2016-10-19 14:00:35 -07:00
Mike Pennisi ade6d2e384 Remove "NotEarlyError" object
Because expectations regarding error "phase" are now expressed via test
meta-data, the test runner may now enforce this requirement on negative
tests.

Remove the "NotEarlyError" from the project source. This reduces the
amount of domain knowledge required to author tests and lessens the
potential for inconsistencies between tests.
2016-10-19 15:24:22 -04:00
Mike Pennisi 7d4b1d28ae Re-format tests for SyntaxErrors
Authored via the following command:

   $ find test -type f -print0 | \
       xargs -0 sed \
         -i 's/^\(\s*\)negative:\s*SyntaxError\s*$/\1negative:\n\1  phase: early\n\1  type: SyntaxError/g'
2016-10-19 15:24:21 -04:00
Mike Pennisi cdc62ce0fa Re-generate tests 2016-10-19 15:24:20 -04:00
Mike Pennisi 0c29e6de86 Reformat miscellaneous negative tests
The expected errors in these tests cannot be asserted with the
`assert.throws` helper function for various reasons. Re-format their
meta-data according to the latest design in order to more precisely
describe test expectations.
2016-10-19 15:24:19 -04:00
Mike Pennisi 203b234fc0 Reformat negative SyntaxError tests (runtime)
These tests specifically concern error produced from the global scope,
precluding the use of the `assert.throws` helper function.
2016-10-19 15:24:18 -04:00
Mike Pennisi d5a3a962b2 Reformat negative ReferenceError tests 2016-10-19 15:24:18 -04:00
Mike Pennisi 24e774251a Test runtime errors with assertion utility method
Improve test consistency by using the `assert.throws` helper function to
assert runtime exceptions. Remove superfluous code.
2016-10-18 14:36:14 -04:00
Joseph Pecoraro fb61ab44eb Fix incorrect generator syntax (#761) (#762) 2016-10-14 15:58:46 -07:00
Leo Balter febb11b249 Revert "islamicc should be canonicalized to islamic-civil (#747)" (#774)
This reverts commit da4f4385fd.
2016-10-14 11:05:41 -07:00
jugglinmike b9d6fec9ac Correct name of fixture file (#775)
The file previously named `values-binding-types_.js` is not intended to
be interpreted as a test. Therefor (in accordance with the project's
`INTERPETING.md` file), its name should include `_FIXTURE` as a suffix.
2016-10-14 11:04:47 -07:00
Leo Balter 8c67edab05 Fix invalid yaml on tests for global (#772) 2016-10-07 10:34:11 -07:00
Henrique Ferreiro 0651a7fad1 setPrototypeOf returns 'true' if called with the target's prototype (#768) 2016-10-05 13:25:35 -04:00
Tim Disney 9d8d8b6920 Add tests to handle revised template literals (#764) 2016-10-03 13:59:53 -07:00
Juan Dopazo b77714514e Add tests for non-optional arguments of Date.UTC() 2016-09-29 13:59:23 -07:00
Jakob Gruber 81f66a5a3a Tests for new lastIndex semantics (#760)
* Tests for new lastIndex semantics

Add and update tests for the lastIndex semantic change introduced in
https://github.com/tc39/ecma262/pull/627.

* Address comments
2016-09-29 10:41:37 -07:00
Jordan Harband be16caa4c8 Add `global` tests. (#765)
Closes #605, relates to #567 / https://github.com/tc39/proposal-global/issues/12 / 9c45e2ac68
2016-09-28 10:53:50 -07:00
jungshik da4f4385fd islamicc should be canonicalized to islamic-civil (#747)
Moves ismalicc test out of main.js and creates a new
test, preferred-subtag.js (per RFC 5646 section 4.5 and
http://www.unicode.org/repos/cldr/tags/latest/common/bcp47/calendar.xml
)

Fix #743
2016-09-12 12:54:55 -07:00
Keith Miller ba93cfa52d Update the toString/proxy.js to test stringifing functions 2016-08-30 14:03:54 -07:00
Viktor 29c2384449 Update return-values.js (Number#toExponential bug in Firefox) (#751)
Update test cases for Number#toExponential

Includes test cases addressing a known bug on Firefox 48.

Ref https://bugzilla.mozilla.org/show_bug.cgi?id=944846
2016-08-29 17:33:55 -04:00
Anthony Van de Gejuchte 11d7dcc997 Remove duplicate description keys 2016-08-27 18:55:27 -04:00
jugglinmike 4ffee35d89 Add tests for surrogate pairs with RegExp atoms (#722) 2016-08-25 13:29:51 -07:00
Tom Care b2b4254266 Merge pull request #727 from bocoup/audit2016-section-20-date
Improve coverage for section 20
2016-08-25 10:30:43 -07:00
jungshik fb45ed9772 Test that getCanonicalLocales() returns a mutable object. (#746)
Will fix #745

Besides, add additional checks to make sure that getCanonicalLocales()
returns an array.
2016-08-22 14:25:00 -07:00
Zibi Braniecki cac55f2999 NumberFormat.prototype.formatToParts tests, part 1 (#744) 2016-08-15 15:23:34 -07:00
Michael Ficarra 894bbcc747 add PropertyDefinitionList evaluation order test (#739)
This test is being added because the committee is considering changing
this evaluation order (as discussed at the May 2016 Munich meeting). The
consequences of this spec change will be more clear as a test change
than a simple test addition.
2016-08-12 12:01:43 -04:00
jugglinmike c5cbf4122d Improve coverage for section 9 (#726)
* Assert creation of 'arguments' object

Ensure that the 'arguments' object is created in cases where it is not
required by the body but is required by the parameters.

* Add tests for cases that disable "arguments" map

* Add tests for NewTarget override of bound function

* Add test for properties of exotic String objects
2016-08-05 10:07:02 -07:00
Tom Care 8a6d7a49ee Merge pull request #711 from bocoup/audit2016-section-21-regexp
Improve coverage for section 21: RegExp
2016-08-04 16:22:18 -07:00
Yusuke Suzuki dfd1fb3a97 Fix incorrect value retrieving in module-code test (#741)
Fix language/module-code/namespace/internals/get-own-property-str-found-init.js.
2016-08-04 11:19:36 -04:00
Kevin Gibbons d6580e8b66 Add tests for for-in initializers (#735)
These were re-introduced in sloppy mode per
https://github.com/tc39/ecma262/pull/614
2016-08-02 15:47:39 -04:00
Jordan Harband 55cf59c80d `Object.getOwnPropertyDescriptors`: add test to ensure undefined descriptors are not added. (#662)
Per https://github.com/tc39/ecma262/pull/593
2016-08-01 13:54:53 -04:00
Yusuke Suzuki e2fb909a1d Fix importing filename in module-code/instn-star-err-not-found.js test
Fix the incorrect module filename.
2016-07-30 15:08:26 -04:00
Brian Terlson dbf251586e Add tests for async functions
Closes #479
2016-07-28 15:11:28 -07:00
Jeff Morrison b785fdf942 Tests for trailing commas in function arg lists (#733)
Adds tests for the proposal as described here:
http://jeffmo.github.io/es-trailing-function-commas/
2016-07-28 12:32:03 -07:00
Zibi Braniecki 1bf44eb349 Add DateTimeFormat.prototype.formatToParts tests (#734) 2016-07-28 10:22:09 -07:00
Leo Balter 3275f17cd4 Add tests for Number#toExponential (#664)
* Add tests for Number#toExponential
2016-07-21 10:57:05 -07:00
Tom Care 9ec41dfabd Merge pull request #719 from bocoup/audit2016-section-15
Improve coverage for section 15: Scripts and Modules
2016-07-20 14:28:29 -07:00
jugglinmike b9e21138cc Add tests for script interactions (#689)
ECMA262 allows for an arbitrary number of "ScriptJob"s to run in a given realm.
Although there is no standard mechanism for enqueuing these jobs, many
implementations offer this functionality through custom APIs. In those hosts,
the semantics describing script interactions are directly observable.
In order to guarantee conformance to the specification in advance of a
standardized API, Test262 now requires that hosts provide a $.evalScript
function whose behavior is defined in the project's "INTERPRETING.md" file.
Use this host-provided API to ensure that implementations correctly observe the
specification text that dictates script interactions.
(In writing these tests, I noticed some gaps in coverage that are observable
from a single script execution. This patch includes a dedicated commit for
these tests that do not require $.evalScript.)

* Improve coverage of GlobalDeclarationInstantiation

* Add tests for script interactions

Use the host-provied `$.evalScript` method to assert conformance to the
specification text that defines script interactions.

* fixup! Improve coverage of GlobalDeclarationInstantiation
2016-07-19 18:02:05 -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
Leo Balter e8e0fb9d34 Update tests for Proxy.[[SetPrototypeOf]] (#716)
* Update tests for Proxy.[[SetPrototypeOf]]

Expand coverage for proxies' [[SetPrototypeOf]] and update tests to
verify that target's [[IsExtensible]] is not called anymore if trap
returns a falsy value.

Ref tc39/ecma262#331
2016-07-19 14:51:02 -07: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
Tom Care 163fae3e68 Merge pull request #715 from bocoup/audit2016-section-13
Improve coverage for section 13, "Statements and Declarations"
2016-07-12 13:51:15 -07:00
jugglinmike a41b71115b Annex b skip fib (#704)
* Re-generate tests

The test generation tool has been modified in the time since these tests
were first generated and committed to the project. Re-generate the tests
using the latest version of the tool.

* Add test cases for Annex B hoisting disqualifiers

The "variable-like" function hoisting semantics defined in Annex B
extension B.3.3 is only applied if "[...] replacing the
FunctionDeclaration f with a VariableStatement that has F as a
BindingIdentifier would not produce any Early Errors [...]". Test262
previously included tests for this condition when the disqualifying
early error originated from the ScriptBody and FunctionBody productions.

Add test cases to assert the behavior when it is disqualified by all
other relevant early errors: Block statements, `for` statements,
`for-of` statements, `for-in` statements, and Switch statements.

* Generate tests

* fixup! Add test cases for Annex B hoisting disqualifiers

* fixup! Add test cases for Annex B hoisting disqualifiers

Correct test case "info" meta-data.

* fixup! Add test cases for Annex B hoisting disqualifiers

Improve test bodies

* fixup! Generate tests
2016-07-11 16:37:42 -07:00
jugglinmike 35206ee85b Add test for subclassing bound functions (#720)
The semantics under test have been incorrectly implemented by the
SpiderMonkey engine.
2016-07-11 13:46:03 -07:00
Mike Pennisi acebbcaeb2 Add tests for Date.prototype methods 2016-07-09 13:09:15 -04:00
Mike Pennisi 8918e860cc Add tests for Date.UTC 2016-07-09 12:15:17 -04:00
Mike Pennisi 8791771268 Add test for subclassing Date 2016-07-09 12:15:16 -04:00
Mike Pennisi 7ac2aa06ca Add test for `name` property of Date constructor 2016-07-09 12:15:16 -04:00
Mike Pennisi 577a9cac9e Add tests for use of ToPrimitive in Date ctor 2016-07-09 12:15:15 -04:00
jugglinmike da0a8e33f0 Improve coverage for section 14: Functions and Classes (#717)
* Add tests for early errors in functions

* Improve tests for class accessors

Use the `propertyHelper.js` utility in order to functionally test the
property descriptors of class methods.

* Remove redundant tests

The semantics of an IdentifierReference as a PropertyDefinition within
an object initializer are exhaustively tested by the files in this
directory whose name match the pattern `prop-def-id-*.js`.

Delete the redundant tests in favor of the more descriptively-named and
more exhaustive alternatives.

* Rename tests

* Update test names to be more descriptive

* Add tests for property descriptors of accessors

* Add tests for runtime error during method dfn

* Add test for observable iteration
2016-07-08 18:43:32 -07:00
jugglinmike 2bfaa0d895 Improve coverage for class "name" inference (#718)
* Extend tests for class "name" inference

Ensure that when a class defines a static "name" method, that method
definition prevents the "name" inference behavior.

* Re-generate tests
2016-07-08 18:37:04 -07:00
jugglinmike 8d78eddcc6 Add test for early error in RegExp literals (#723) 2016-07-08 18:01:35 -07:00
Leonardo Balter 7b1eddf6b0 Update and expand tests for isNaN 2016-07-07 15:55:28 -04:00
Leonardo Balter 81f22800fa Update and expand tests for isFinite 2016-07-07 15:55:27 -04: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
Leo Balter ca7018bc7e Use global values on typeof tests for Number values (#713)
This is a pure miscellaneous change to use global values of NaN and Infinity instead of their namespaced equivalents.
Ref 9ae0567a50 (r69049894)
cc @suwc
2016-07-06 14:41:22 -07:00
Leonardo Balter 5525a64fbb
Update DataView method tests for detached buffer check order 2016-07-06 14:37:34 -03:00
Leonardo Balter 3868f8f765 Update test for distinct NaN replacement on DefineOwnProperty
Fixes gh-683
Ref gh-648
Ref tc39/ecma262#353
2016-07-06 11:30:33 -04: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 ab4ff914fb Add tests for assignment target validation of new ES2015 forms (#693)
This re-factors some existing Sputnik tests to be more targeted and to use a
pattern that can be generalized to other forms. We could test these all day,
but I've limited myself to forms introduced in ES2015, specifically
YieldExpression and new.target. Note that SpiderMonkey incorrectly throws a
SyntaxError for these.
I thoughtlessly wrote ReferenceError tests for yield = 1 until I realized
that such productions are not actually recognized by the grammar, so the early
errors do not apply. Instead, I've added a negative syntax test for that case.

* Refactor test for valid cover

* Add tests for ValidSimpleAssignmentTarget

Ensure that constructs introduced in ES2015 are disallowed as assignment
targets, with or without a "cover" grammar.

* Add test for grammar precedence of YieldExpression
2016-07-05 15:20:56 -07:00
jugglinmike f554f68ae9 Improve coverage for section 21: String (#712)
This changeset increases coverage for section 21, specifically "21.1 String
Objects".

* Add tests for "this" validation of String methods

* Add tests for ToNumber as used by String methods

* Add test for `length` prop of exotic String objs

* fixup! Add test for `length` prop of exotic String objs
2016-07-05 14:04:31 -07:00
Leonardo Balter 021d44822c Add tests for custom ctor returns on TypedArrays from and of 2016-07-05 16:29:23 -04:00
Leonardo Balter 6fcbfaf0f0 Assert TypedArray iterators inherit from ArrayPrototypeIterator 2016-07-05 16:29:22 -04:00
Leonardo Balter c204c30a54 Remove invalid test from ArrayBuffer subclassing
Fixes gh-696

As pointed in gh-696, the ArrayBuffer ctor won't throw a RangeError when
invoked without arguments.

Instead of fixing the invalid assertion, this commit removes it as the
coverage for subclassing is already satisfied by the use of slice.
2016-07-05 16:29:21 -04: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 09be4da196 Fix test for TypedArray(length)
Fixes gh-694
2016-07-05 16:29:21 -04:00
Leonardo Balter 6497c1f5cc Merge tests for TypedArrays#length when this is not object 2016-07-05 16:29:20 -04:00
Leonardo Balter d190e700f3 Add bit-precision tests for TypedArray#copyWithin 2016-07-05 16:20:16 -04:00
Mike Pennisi 14595b47b8 Add tests for restricted grammar productions 2016-07-02 15:46:16 -04:00
Mike Pennisi 24391fb9e8 Add tests for early errors from `super` 2016-07-02 15:46:15 -04:00
jugglinmike fce8b5852d Extend coverage for Section 25 - Generators (#700)
* Improve tests for GeneratorPrototype methods

- Assert return values more consistently
- Expand tests for constraints on `this` value

* Add more tests for dynamic GeneratorFunctions

* Add more tests for GenerationFunction.prototype

* Add more tests for the GeneratorFunction object

* Extend test: GeneratorFunction.prototype.prototype

* Improve precision of tests for generator methods

Extend existing assertions to explicitly verify that execution halts at
the intended location. Correct tests which were previously asserting
this behavior in contexts that did not match their name/description.

* Remove unused variables

* fixup! Improve tests for GeneratorPrototype methods

* fixup! Improve tests for GeneratorPrototype methods
2016-07-01 11:24:27 -07:00
jugglinmike e290a337b8 Improve coverage for section 12, "Expression" (#695)
* Add missing test for early error

* Add missing test for WithBaseObject

* Improve coverage for `new.target`

* Add test for deletion of SuperReference

* Add tests for `in` keyword restrictions

* fixup! Improve coverage for `new.target`
2016-07-01 11:23:43 -07:00
Leo Balter e49d2661a8 Improve assertions comparing values to NaN (#690)
The global isNaN is not precise at all, and Number.isNaN is an ES6 feature that makes it preferrable to use assert's sameValue for NaN values, as it handles it internally using the comparison.
2016-07-01 11:22:55 -07:00
Mike Pennisi 2aa8d4838b Add test for LabelledItem and ContinueStatement 2016-06-30 15:24:42 -04:00
Mike Pennisi ce2e421464 Add tests for interpretation of `let` token 2016-06-30 15:24:42 -04:00
Mike Pennisi 7a8e644696 Correct test for `for-in` IterationStatement
This test was intended to assert the semantics of the `for-in`
statement, but it was mistakenly authored to use a `for-of` statement.
Update the statement under test, and improve the testing methodology to
correctly assert the creation of distinct bindings.
2016-06-30 15:24:42 -04:00
Mike Pennisi 53df13bf9d Complete test coverage for labelled fn decls
Ensure that early errors restricting labelled function declarations
within WithStatement and IfStatement are honored. Rename existing tests
to match the specification's spelling.
2016-06-30 15:24:42 -04:00
Mike Pennisi ec9d79c027 Add missing tests for statement completion values
The project contains tests for the completion value of most (but not
all) statements. Introduce tests to complete coverage of this detail.
2016-06-30 15:24:41 -04:00
Mike Pennisi b0072ca1b5 Add tests for early errors in SwithStatement 2016-06-30 15:03:30 -04:00
Mike Pennisi 843d14ec48 Add test for order of operations in "var" stmnt 2016-06-30 15:03:29 -04:00
jugglinmike a3fffa754b Improve coverage for "super" keyword (#687)
* Improve test coverage for `super` keyword

Add tests for SuperCall and SuperProperty, organized together in the
`test/language/expressions/super/` directory. For SuperProperty, include
tests for usage from within Object initializers and class bodies because
a different set of semantics are observable from each context.
2016-06-29 16:45:19 -07:00
Mike Pennisi 4e781091f8 Improve tests for RegExp `lastIndex` property
The prior version of this test asserted only the property's
configurability. It was also limited to the RegExp object as returned
from the RegExp constructor.

Extend the test to verify all values of the property descriptor.
Duplicate these assertions in a separate file dedicated to the RegExp
object as created from a RegExp literal.
2016-06-29 17:29:43 -04:00
Mike Pennisi 1d0dbc5726 Assert absense of internal slot on RegExpPrototype
The previous commit removed two invalid tests designed to ensure that
the RegExpPrototype object is not itself a RegExp object. Introduce a
new test to assert this detail in a way that accounts for the
possibility of host extensions.
2016-06-29 17:29:42 -04:00
Mike Pennisi 9c3bb8d69e Remove invalid tests for %RegExpPrototype%
From ECMA262, section 16:

>  Except as restricted in 16.2, an implementation may provide
>  additional types, values, objects, properties, and functions beyond
>  those described in this specification.

Section 16.2 makes no mention of the `lastIndex` property of the
%RegExpPrototype% intrinsic. It is therefor not a violation to define
%such an "own" property.

Remove the tests that assert otherwise.
2016-06-29 17:29:42 -04:00
Mike Pennisi b9587262d4 Add tests for return value: 'get RegExp.p.source' 2016-06-29 17:29:42 -04:00
Mike Pennisi e1cd1e7f85 Update and tests for %RegExpPrototype% methods
A recent web-compatability change to ECMA262 modified the semantics of
the accessor methods on the %RegExpPrototype% intrinsic--the "get"
accessors now include steps dedicated to the case where the "this" value
is the %RegExpPrototype% object itself.

Remove the tests that have been invalidated by this change, introduce
tests asserting the new behavior, and extend coverage for other possible
"this" values.
2016-06-29 17:07:46 -04:00
Mike Pennisi 9114f815a0 Add test for '^' assertion with 'm' flag
The specification contains an explicit informative NOTE explaining that
the 'm' flag does not effect the behavior of the '^' assertion. Add a
test to verify this.
2016-06-29 17:07:45 -04:00
Mike Pennisi 0ba684e312 Assert SyntaxError with lower bound in escape seq.
ES2015 reads:

> RegExpUnicodeEscapeSequence :: u{ HexDigits }
>
> - It is a Syntax Error if the MV of HexDigits > 1114111.

Use the MV 0x110000 to assert the lower boundary of values which are
expected to produce the SyntaxError.
2016-06-29 12:34:17 -04:00
jugglinmike 23efc2c96a Extend test for HTML comments (#684)
Extend test for HTML comments

The V8 engine incorrectly requires a leading newline character for
MultiLineComments which contain the optional trailing HTMLCloseComment
[1]. Extend the current tests to fail when such an invalid restriction
is in place.
[1] https://bugs.chromium.org/p/v8/issues/detail?id=5142
2016-06-28 15:54:40 -07:00
jugglinmike be19aaa18e Add tests ensuring iterator is not closed (#702)
A subtle aspect of the for-of iteration protocol concerns abrupt
completions that do *not* trigger iterator closing. Although this detail
is implicit in the current structure of the specification text, some
hosts may violate the protocol by closing the iterator because later
steps *do* specify that behavior.

The V8 engine is one such host--as of this writing, it incorrectly
closes the iterator when accessing the `value` property of the iterator
result produces an abrupt completion.

Add tests verifying that the iterator protocol is not violated in this
way for abrupt completions during the semantics of for-of evaluation.
2016-06-28 10:55:18 -04:00
Leonardo Balter f3bfaa692d Expand tests for Math.log1p 2016-06-27 16:04:17 -04:00
Leonardo Balter 080afac906 Update tests for Math.{sign,sin,trunc} 2016-06-27 16:04:17 -04:00