Commit Graph

38 Commits

Author SHA1 Message Date
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
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
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
Mike Pennisi 655a880852
Add tests for arguments obj with dflt parameters 2016-06-21 12:22:49 -04:00
Mike Pennisi 7e3019e382
Add tests for function length with dflt parameters 2016-06-21 12:22:49 -04:00
Mike Pennisi 7dcccfcca6
Add tests for use of `yield` in default parameters 2016-06-21 12:22:48 -04:00
Mike Pennisi e5f1740411
Generate tests 2016-06-21 12:22:48 -04:00
Mike Pennisi a969e853e7
Generate tests 2016-06-21 12:20:36 -04:00
Leo Balter 8f23cd6775 Merge pull request #607 from bocoup/envs
Add tests for Lexical Environment management
2016-05-30 16:13:33 -04:00
Mike Pennisi d4b263ccbb Generate tests 2016-05-10 11:57:37 -04:00
Mike Pennisi 74d0c1d124 Add equivalent tests for fn param-body boundary
These tests are based on the files introduced in the commit titled, "Add
tests for Lexical Environment management."
2016-04-28 09:47:18 -04:00
Mike Pennisi c9a93c1d1c Add equivalent tests for non-strict fn parameters
These tests are based on the files introduced in the commit titled, "Add
tests for Lexical Environment management."
2016-04-28 09:47:08 -04:00
Mike Pennisi 9c3ff83c00 Add equivalent tests for non-strict fn bodies
These tests are based on the files introduced in the commit titled, "Add
tests for Lexical Environment management."
2016-04-28 09:46:03 -04:00
Mike Pennisi 73a7e23061 Re-generate tests 2016-04-26 16:13:32 -04:00
Mike Pennisi 74bff6b3d5 Add initial set of generated test sources 2016-03-16 15:29:30 -04:00
Leonardo Balter bf782c8421 s/id/esid
Fixes #477
2016-02-22 09:47:42 -05:00
Gorkem Yakin dbcc8cadf3 Merge pull request #507 from bocoup/remove-unused-file
Remove unused harness file
2016-02-12 17:16:01 -08:00
Leonardo Balter ebda746e6a Replace es7id tags with id 2016-02-12 16:22:56 -08:00
Mike Pennisi 071b5f03c6 Remove unused harness file
The harness file `Test262Error.js` has not contained executable code since it
was introduced in this project [1]. The definition of the `Test262Error`
function has consistently been located in the `sta.js` harness file which test
runners are expected to inject into the test environment.

Remove the file and all references to it.

[1] See commit c33bf0e043
2016-02-12 13:44:18 -05:00
André Bargull b62dccf1dc Add test cases for recent ES2016 fixes
- lastIndex in RegExp.prototype[Symbol.split]: tc39/ecma262@08b4756747
- Missing number conversion in DataView.prototype.setXXX: tc39/ecma262@4f875fe96d
- Negative zero byteoffset in TypedArray: tc39/ecma262@2d1ed20db7
- EvalDeclarationInstantiation throws TypeError: tc39/ecma262@2be6968715
- BindingRestElement allows BindingPattern: tc39/ecma262@d322357e6b
- Eval in parameters with computed property keys: tc39/ecma262@04e2e9b719
- Use strict with non-simple parameters: tc39/ecma262@15b0db41ed
- __proto__ in strict mode: tc39/ecma262@5c1984334d
2015-12-15 17:33:49 +01:00
Rick Waldron 9ccc663936 Merge pull request #415 from anba/remove-runTestCase-finally
Replace runTestCase when used with try-finally
2015-09-04 15:20:26 -04:00
André Bargull bd603294cb Replace runTestCase with assert, try-finally 2015-08-13 17:43:11 +02:00
André Bargull ee8a222125 Replace runTestCase with assert helpers [test/language/statements] 2015-08-13 17:33:42 +02:00
André Bargull 7f55f60b5f Replace runTestCase with assert.throws [test/language/statements] 2015-08-11 17:43:01 +02:00
André Bargull 3c3e0a6adb Replace runTestCase with assert helpers [test/language/statements/] 2015-08-06 18:33:10 +02:00
Mike Pennisi 2fe074134a Add tests for function `name` attribute
This change set includes tests for most invocations of the
SetFunctionName abstract operation in the ES2015 specification.
Practical testing considerations preclude the introduction of tests for
certain invocations:

- The project is still vetting methods to sustainably test the semantics
  of the Destructuring Binding pattern across all valid productions.
  - 13.3.3.6 Runtime Semantics: IteratorBindingInitialization
  - 13.3.3.7 Runtime Semantics: KeyedBindingInitialization
- Without a loader, there is no way to access a function object declared
  in an ExportDeclaration, so `name` assignment cannot be tested in
  these cases
  - 14.1.19 Runtime Semantics: InstantiateFunctionObject
  - 14.4.12 Runtime Semantics: InstantiateFunctionObject
  - 14.5.15 Runtime Semantics: BindingClassDeclarationEvaluation
  - 15.2.3.11 Runtime Semantics: Evaluation
2015-07-21 20:05:34 -04:00
André Bargull a85f5039e0 Remove links to hg.ecmascript.org 2015-07-17 17:43:09 +02:00
Mike Pennisi 10e0d977ec Prefer explicit error checking where possible
The `negative` frontmatter tag expresses an expectation for the behavior
of the test file as a whole. The `assert.throws` helper function offers
more fine-grained control over expectations because it may be applied to
specific statements and expressions. This makes it preferable in cases
where it may be used (i.e. when the test body does not describe a syntax
error or early error).

Re-implement assertions for errors to use the `assert.throws` helper
function wherever possible.
2015-07-10 14:12:57 -04:00
Mike Pennisi 29ecced632 Update handling of directive prologues
Some tests specifically concern the application of the `use strict`
directive as it appears in JavaScript source code. These tests should
*not* be run with the `onlyStrict` flag because relying on the test
runner to enable strict mode makes the semantics of the source code
irrelevant. Update these tests to use the `noStrict` flag.

Other tests concern language semantics that are only valid in strict
mode, but the mechanism for enabling strictness is inconseqential.
Update these tests to use the `onlyStrict` flag and remove any redundant
`use strict` directive prologues contained within.

Still other tests are valid both within and outside of strict mode.
In keeping with the majority of other tests, do not specify any
restrictions on the environments in which these tests may be run.
2015-06-18 17:38:34 -04:00
Brian Terlson 7eb27329b3 Merge pull request #307 from bocoup/remove-fail
Remove `$FAIL` function
2015-06-09 16:59:13 -07:00
Mike Pennisi 92890e6723 Remove `$FAIL` function
This function is equivalent to `$ERROR` (which is automatically included
in test environments). Remove the harness file that defines the
function, remove references to the file from test `includes` lists, and
update scripts to instead invoke the `$ERROR` function.
2015-06-09 19:44:25 -04:00
Mike Pennisi f2cc736d94 Remove remaining includes for `assert.js` helper 2015-06-09 15:00:00 -04:00
André Bargull 3987990563 Additional tests with incorrect for-in context
- Add missing ".prototype" lookup in Array.prototype tests (Follow-up of #280)
- Add noStrict flag in global/S10.2.3_A2.2_*.js (implicit this-binding is part of the test)
- Provide correct this-binding in function/13.2-*.js
- Add missing assert.throws in "set-iterator-close-after-add-failure.js"
2015-05-26 17:52:52 +02:00
Caitlin Potter f398421ee7 Add tests for %FunctionPrototype% restricted properties 2015-04-11 20:46:27 -04:00
André Bargull 15cc639131 Strict eval variable declarations are lexically scoped, assign expected result value to a previously declared global (issue #35)
Add missing variable declarations (issue #35)

Split S12.6.3_A10 and S12.6.3_A10.1 because both files seem to test implicit global variables (issue #35)

Changes (issue #35)

- Add missing noStrict flags.
- Change 13.2-15-1 and 13.2-18-1 to use assert.js and propertyHelper.js (simplifies writable and configurable checks while in strict mode).
- Add variable declarations for globals.
- Create copies of S13.2.1_A6_T1 and S13.2.1_A6_T2 instead of adding variable declarations, because both files seem to test implicit global variables.
- Split S13_A14 and S13_A16 to work in strict mode.
- Remove assignment to .name property.

Add missing noStrict flags (issue #35)

Add missing noStrict flags and variable declarations (issue #35)

Add missing noStrict flags (issue #35)
2015-04-08 15:54:58 -07:00
André Bargull 0dbafac5a6 Add 'var' declarations for strict mode
This change adds 'var' declarations for global variables to allow the tests to run in strict mode (see issue #35).
Extra care was taken to ensure the changes do not alter the test behavior, for example when implicit creation of global variables are part of the test.
Note: The change does not fix all strict mode errors due to missing 'var' declarations.
2014-12-10 16:37:05 -08:00
Brian Terlson 2a74f0ec1b Reorganize ./test 2014-12-07 15:33:09 -08:00