Commit Graph

195 Commits

Author SHA1 Message Date
Leonardo Balter 368d483490
Generate tests 2017-03-14 17:42:04 -04:00
Leonardo Balter aa2c69960d
Generate tests 2017-03-14 15:13:10 -04:00
Leonardo Balter 7522a29f31
Generate tests 2017-03-14 14:58:33 -04:00
Leonardo Balter c37a242057
Move tests for params trailing comma to the test gen tool 2017-03-14 14:58:32 -04:00
Leonardo Balter c017b4280b
Generate tests 2017-03-14 13:30:35 -04:00
Rick Waldron b0e9db8856
Remove invalid tests on parameters vs arguments list
Ref #822
2017-03-14 13:20:10 -04:00
Leonardo Balter e54c471809
Generate tests 2017-03-09 10:30:09 -05:00
Leonardo Balter 0cc55bb44d
Generate tests 2017-03-06 16:25:14 -05:00
Mike Pennisi f03c2c244c Procedurally generate related tests
Take advantage of a recent extension to the test generation tool in
order to limit duplication.
2017-03-04 12:17:35 -05:00
Shu-yu Guo e262dcd021 Test that @@unscopables is looked up once for inc/dec. (#869) 2017-03-02 13:15:56 -05:00
André Bargull 6b09ad0459 Update YAML frontmatter of some tests to be compatible with monkeyYaml (#862) 2017-03-01 16:35:37 -05:00
Leo Balter 4546006977 Merge pull request #855 from anba/fix-async-sab-class-tests
Change tests for `extends null` and Intl legacy constructor semantics

Ref tc39/ecma262#781
Ref tc39/ecma402#84
2017-03-01 15:56:41 -05:00
Mike Pennisi 37d5f8e5ef
Re-generate tests 2017-03-01 11:38:11 -05:00
Mike Pennisi 228851fbe4
Add tests for accessor names 2017-03-01 11:38:10 -05:00
arai-a d93bee595e Add some tests for execution order for yield* in async generator (#844) 2017-02-27 15:40:19 -08:00
André Bargull 7e94b8b7ac Fix executor arguments validation in Promise subclass test 2017-02-22 18:05:08 +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
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
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 3b9953d65c remove last usage of arguments.caller (#812) 2016-12-28 10:54:02 -08:00
Kevin Gibbons fcc9e07265 Add test for extending a constructor with null .prototype (#806) 2016-12-21 01:30:06 -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
Josh Wolfe 4fd91d8904 fix incorrect tests for trailing commas (#787) 2016-11-11 09:44:38 -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
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 d5a3a962b2 Reformat negative ReferenceError tests 2016-10-19 15:24:18 -04:00
Joseph Pecoraro fb61ab44eb Fix incorrect generator syntax (#761) (#762) 2016-10-14 15:58:46 -07: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
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
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 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
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
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
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 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
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
Mike Pennisi 6a3837fc0f
Add test for abrupt completion from HasBinding
Ensure that when HasBinding of an Object environment record returns an
abrupt completion, that same completion is returned to the runtime.
Update the meta-data of related tests for consistency with this new
test.
2016-06-21 12:14:53 -04:00
jugglinmike dee1526ca7 Update tests concerning null-extending classes (#658)
The latest revision of ECMA262 makes special provisions for classes
which extend the `null` value [1]. Update the relevant tests
accordingly.

[1] https://github.com/tc39/ecma262/issues/543
2016-06-10 15:10:32 -04:00
Leo Balter 2cf968cfad Merge pull request #651 from bocoup/generation-dstr-assign
Re-format destructuring assignment tests
2016-06-01 14:00:09 -04:00
Leo Balter 1e75730d5f Merge pull request #587 from bocoup/generation-annexb-fns
Add tests for Annex B "function in block" semantics (procedurally generated)
2016-05-31 17:45:48 -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 88879de735 Generate tests 2016-05-25 17:29:27 -04:00
jugglinmike a0ddf7bfe4 Add tests for generator intrinsic default proto (#636) 2016-05-19 12:54:49 -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 3b3bd06819 Add tests for Lexical Environment management
Add tests that assert the management of the running execution context's
LexicalEnvironment and VariableEnvironment components, as created by the
following abstract operations:

- NewDeclarativeEnvironment
- NewObjectEnvironment
- NewFunctionEnvironment

Many tests require the use of non-strict direct eval, meaning they may
not be run in strict mode. This does not effect coverage because the
semantics in these cases are not observable from strict mode code.

Some situations require the creation of a binding, but this binding has
no relevance to the test itself. In these cases, use names consisting
solely of the underscore character (`_`).

Avoid the use of Block statements wherever possible, as these trigger
the creation of additional environments which may interfere with the
behavior under test.
2016-04-28 09:44:41 -04:00
Mike Pennisi 73a7e23061 Re-generate tests 2016-04-26 16:13:32 -04:00
Mike Pennisi eb644bb2da Reduce reliance on `fnGlobalObject.js`
This harness function is not necessary in the majority of cases in which
it is used. Remove its usage to simplify tests and decrease the amount
of domain-specific knowledge necessary to contribute to the test suite.

Persist the harness function itself for use by future tests for ES2015
modules (such a helper is necessary for tests that are interpreted as
module code).
2016-04-25 11:09:21 -07:00
jugglinmike 38329a7038 Add tests for TryStatement binding restrictions (#577)
This changeset includes tests for early errors and those generated
dynamically by eval. It also accounts for relevant AnnexB extensions.
2016-04-21 15:54:25 -04:00
Mike Pennisi 4766365dc6 Add tests for Annex B.3.3/B.3.4
These tests ensure that the annex B extensions for function declarations
are *not* observed in strict mode code.
2016-04-18 16:18:54 -04:00
Leo Balter 3723e7caeb Merge pull request #545 from bocoup/generation
Introduce test generation tool
2016-04-15 17:56:36 -04:00
Leo Balter ba26b7f2dc Merge pull request #541 from bocoup/statement-decl
Add syntax tests for declaration restrictions
2016-03-18 15:48:44 -04:00
Leo Balter 5b06fab039 Merge pull request #531 from bocoup/debugger
Add tests for `debugger` statement
2016-03-17 17:29:59 -04:00
Mike Pennisi 74bff6b3d5 Add initial set of generated test sources 2016-03-16 15:29:30 -04:00
Mike Pennisi 021ed85d97 Add syntax tests for declaration restrictions
Assert that declarations are not permitted in positions reserved for
statements only.
2016-03-11 12:23:15 -05:00
Mike Pennisi 4f5a8674c2 Add tests for `debugger` statement
The runtime semantics of this statement are host-defined and therefore
untestable, but the statement's affect on the formal grammar should be
consistent across all implementations.
2016-03-09 11:12:56 -05:00
André Bargull 2acbd3e98e Improve coverage for default class constructors 2016-03-01 19:15:21 +01:00
Gorkem Yakin 5a77ac86a9 Merge branch 'bocoup/for-restrictions' 2016-02-25 14:22:09 -08:00
Mike Pennisi 4dd2d9b7ee Add tests for IterationStatement early errors 2016-02-25 14:21:08 -08:00
Leonardo Balter d9a277aa7c Fix location based return value for Date on subclassing tests
Fixes #489
2016-02-22 13:53:43 -05:00
Leonardo Balter bf782c8421 s/id/esid
Fixes #477
2016-02-22 09:47:42 -05:00
Mike Pennisi 62857dcba7 Rename IterationStatement tests
- Prefix file names to explicitly describe the "head" position
- Remove statement name suffix as this information is reflected by each
  file's location within the file hierarchy
2016-02-16 12:03:21 -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
Mike Pennisi 4dc81d3788 Add tests for tail-call optimization
ECMAScript 2015 introduced tail call optimization for function calls
occuring in a number of positions in the grammar. Assert expected
behavior by triggering a large (but configurable) number of recursive
function calls in these positions. Compliant runtimes will execute such
programs without error; non-compliant runtimes are expected to fail
these tests by throwing an error or crashing when system resources are
exhausted.
2016-02-01 13:20:17 -05:00
Mike Pennisi e62d43c815 Update tests according to ES2016 draft semantics
The ES2016 draft further refines the completion values for `if` and
`with` statements. Two tests must be removed outright because the
completion value in those cases is no longer accessible from the
runtime.
2016-01-22 15:00:54 -05:00
Mike Pennisi 407b8964ce Add tests for ES2015 completion reform
In order to facilitate proper tail calls, ES2015 modified the completion
value of a number of statements.

These tests use `eval` to verify the new values.
2016-01-22 15:00:03 -05:00
Mike Pennisi 19762b927a Add tests for iterator expression in ForIn/Of head
Although the `for..in` statement allows Expressions to define the
iterator, only an AssignmentExpression may occupy this position in the
`for..of` statement.
2016-01-19 12:27:33 -05:00
Leonardo Balter 42d1a10d6d fixup! Add tests for Array - calling super with a single argument 2016-01-13 13:28:00 -05:00
Leonardo Balter c99ace29d7 Move subclass tests to test/language/statements/class/subclass/builtin-objects 2016-01-12 16:45:03 -05:00
Jeff Walden 78ca60e6cf Add tests verifying that ASI can't occur after the leading let/const in |let let|, |let let = "...";|, and |const let = "...";|. Each matches the LexicalDeclaration production, then triggers an early error before evaluation because it attempts to bind "let". 2015-12-18 15:03:04 -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
André Bargull bd8c91e250 Updates for ES2016 Draft 2015-12-01
- RegExp.prototype[Symbol.split] calls ToUint32 (https://github.com/tc39/ecma262/issues/92)
- Species lookup removed from Promise.all and Promise.race (https://github.com/tc39/ecma262/issues/151)
- Generator functions are no longer constructors (https://github.com/tc39/ecma262/pull/171)

Fixes #444
2015-12-02 18:07:06 +01:00
André Bargull 56d6eefb69 Fix expected completion value
- if-statement completion value semantics was not properly updated in ES2015
2015-11-11 17:47:15 +01:00
Mike Pennisi e39f8d88c5 Add tests for well-known Symbol: @@unscopables 2015-10-05 11:57:31 -04:00
André Bargull ffec41b7af Improve compatibility for engines without support for Annex B 2015-09-07 20:40:09 +02: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