Commit Graph

180 Commits

Author SHA1 Message Date
André Bargull c5e18d561c Assignment with left-hand side property accessor
The assignment operator evaluates its operands from left to right. When
the left-hand side expression is a property accessor, RequireObjectCoercible
and ToPropertyKey are called on the property accessor before the right-hand
side expression is evaluated.
2015-05-18 18:12:25 +02:00
Brian Terlson ab44f59d1b Merge pull request #265 from anba/issue-35/language-eval
Fix strict mode errors in language/{identifiers, line-terminators, wh…
2015-05-13 14:43:30 -07:00
André Bargull 9a602905d7 Fix strict mode errors in language/{identifiers, line-terminators, white-space}
Make tests strict mode compatible by assigning result value to a separate variable.

Part of issue #35.
2015-05-08 17:33:33 +02:00
André Bargull 89a4bb5ae4 Fix strict mode errors in language
- Add missing "var" declarations and noStrict flags
- Add strict mode tests for:
 - arguments-object/10.6-6-3 -> arguments-object/10.6-6-3-s
 - arguments-object/10.6-6-4 -> arguments-object/10.6-6-4-s
- Remove try-finally clean-up code
- Add strict mode compatible tests for eval-code/S10.4.2_A1.1_T*
  - No strict mode compatible files added for eval-code/S10.4.2_A1.2_T*, because it doesn't really make sense in this context.
  - (S10.4.2_A1.1 and S10.4.2_A1.2 should probably be removed, because the tested behaviour is not required by the spec.)
- Split S8.5_A10, S8.5_A4 and S8.1_A3 into declaration (both modes) and assignment tests (non-strict only)

Part of issue #35.
2015-05-08 17:27:52 +02:00
Mike Pennisi 7b969ce65b Add analogous tests
Introduce additional tests to increase parity in coverage between
generator expressions and generator statements.
2015-05-07 19:11:47 -04:00
Mike Pennisi 779a59f30c Import tests from Google V8 (generators semantics)
These tests are derived from the following files within the Google V8
project:

    test/mjsunit/es6/generators-iteration.js
    test/mjsunit/es6/generators-objects.js
    test/mjsunit/es6/generators-runtime.js
    test/mjsunit/es6/generators-states.js
2015-05-07 19:11:47 -04:00
Rick Waldron 29e2990d9b 14.5 Class Definitions
- 14.5.1 Static Semantics: Early Errors
- 14.5.3 Static Semantics: ConstructorMethod
- 14.5.14 Runtime Semantics: ClassDefinitionEvaluation
2015-05-02 14:06:57 -04:00
Brian Terlson 87fd4e5699 Merge pull request #240 from anba/es2015-compat-updates
Update remaining tests for ES2015 compatibility (rev38)
2015-04-27 12:55:26 -07:00
André Bargull ef8f056a76 Update remaining tests for ES2015 compatibility (rev38)
- Duplicate properties are allowed in object literals: test/language/expressions/object/*.js
- RegExpBuiltinExec was changed to use ToLength(lastIndex): test/built-ins/RegExp/prototype/exec/S15.10.6.2_A5_T3.js
- Non-undefined flags arguments allowed in RegExp constructor call: test/built-ins/RegExp/*.js
- Array.prototype.push throws TypeError if new length exceeds Number.MAX_SAFE_INTEGER: test/built-ins/Array/prototype/push/S15.4.4.7_A2_T2.js
- .length property of bound functions is configurable: test/built-ins/Function/prototype/bind/15.3.4.5-15-2.js
- Array.prototype changed back to exotic Array object: test/built-ins/Array/prototype/*.js, test/built-ins/Array/isArray/15.4.3.2-0-5.js
2015-04-27 18:21:34 +02:00
André Bargull e31ae1ad9f Invalid language tests
- in-statement-position-label-statement.js is an Annex-B test (B.3.2 Labelled Function Declarations), moved to annexB directory
- identifier-let-allowed-as-lefthandside-expression-strict.js needs to check for a SyntaxError (ES6, 12.1.1)
- Remove sort() calls in test/built-ins/Object/getOwnPropertyNames/*.js
- Remove sort() calls in test/language/block-scope/syntax/for-in/acquire-properties-from-*.js
- verifyConfigurable() needs to called last in test/built-ins/Object/is/length.js
- All productions within ClassBody are implicitly strict, update test/language/class/method-definition/yield-as-*.js accordingly
- Remove unnecessary noStrict flag in test/language/class/method-definition/yield-as-generator-method-binding-identifier.js
- Check own symbols are returned in property creation order from Object.getOwnPropertySymbols():
  - test/language/computed-property-names/basics/symbol.js
  - test/language/computed-property-names/class/method/symbol.js
  - test/language/computed-property-names/class/static/method-symbol.js
  - test/language/computed-property-names/object/method/symbol.js
- Fix copy-paste error in test/language/expressions/object/method-definition/yield-as-function-expression-binding-identifier.js
2015-04-27 16:56:19 +02:00
Brian Terlson d25eca4184 Merge pull request #213 from bocoup/block-scope-additions
Import tests from Google V8 (Block Scope Additions)
2015-04-21 15:24:54 -07:00
Brian Terlson e9593a3d65 Merge pull request #220 from bocoup/for-of-more-control-flow
Additional control flow tests for `for..of` statements
2015-04-21 10:55:42 -07:00
Mike Pennisi 3bf5652774 Improve `for..of` control flow tests
- Expand ambiguous assertion messages and assert execution paths more
  finely.
- Improve variable names in `for..of` tests
  While the object created by a GeneratorFunction may be considered an
  "iterable", it is being used as an iterator in these tests. Naming the
  variable according to the way it is used improves the readability of
  the test body.
- Add 'features' attribute to test frontmatter
- Move tests
- Introduce additional `for..of` control flow tests
2015-04-21 12:55:27 -04:00
Brian Terlson f1900713aa Merge pull request #210 from bocoup/native-iterators
Import tests from Google V8 (native iterators)
2015-04-21 09:52:35 -07:00
Brian Terlson 8980d3f929 Merge pull request #228 from bocoup/arrow-functions
14.2 Arrow Function Definitions
2015-04-21 09:48:07 -07:00
Rick Waldron 93e9da29a0 14.2 Arrow Function Definitions 2015-04-20 19:53:06 -04:00
Mike Pennisi e8cc40a0a8 Import tests from Google V8 (native iterators)
These tests are derived from the following files within the Google V8
project:

    test/mjsunit/es6/typed-array-iterator.js
    test/mjsunit/es6/arguments-iterator.js
    test/mjsunit/es6/string-iterator.js
    test/mjsunit/es6/collection-iterator.js
2015-04-20 19:15:34 -04:00
Brian Terlson b8711eb803 Merge pull request #229 from bocoup/restructure-generator-tests-2
Restructure generator tests 2
2015-04-18 15:50:23 -07:00
Brian Terlson 43a238bc0b Merge pull request #197 from bocoup/harmony-symbols
Import tests from Google V8 (Symbol)
2015-04-18 15:49:46 -07:00
Brian Terlson a6ca558d46 Merge pull request #218 from bocoup/templates
Import tests from Google V8 (templates)
2015-04-18 15:46:34 -07:00
Mike Pennisi 909156c61f Add "features" metadata to existing tests 2015-04-15 18:47:34 -04:00
Mike Pennisi 5eb977a7c7 Move tests for generator method definitions
The project has recently changed the preferred location for generators
created via the MethodDefinition syntactic form.
2015-04-15 18:44:02 -04:00
Mike Pennisi 14cb6ca88e Extend tests for LineTerminatorSequence
Add assertions for the "Line Separtator" and "Paragraph Separator" line
terminator code points.
2015-04-15 10:50:44 -04:00
Mike Pennisi 1c3c0704fd fixup! Reorganize test files 2015-04-15 10:36:09 -04:00
Mike Pennisi 5fc17f9c2d fixup! Remove test for unspecified behavior 2015-04-15 10:20:52 -04:00
Brian Terlson b9e4a43f5e Merge pull request #204 from bocoup/generator-parsing-2
Import tests from Google V8 (generator syntax)
2015-04-14 13:31:53 -07:00
Mike Pennisi 95a78b36d5 Add tests for additional generator function forms 2015-04-14 16:23:16 -04:00
Mike Pennisi e14060bffb Add asertions for Generator Statement syntax tests
Ensure that these forms result in objects that meet basic expectations
about generator functions.
2015-04-14 16:22:12 -04:00
Mike Pennisi 93d994df0f Import tests from Google V8 (generator syntax)
These tests are derived from the following files within the Google V8
project:

    test/mjsunit/es6/generators-parsing.js
2015-04-14 16:22:12 -04:00
André Bargull ffae2ca863 Fix malformed YAML front matter 2015-04-13 20:53:44 +02:00
Caitlin Potter f398421ee7 Add tests for %FunctionPrototype% restricted properties 2015-04-11 20:46:27 -04:00
Brian Terlson afa25f6cdc Merge pull request #221 from bocoup/typeof
Update tests for `typeof` operator
2015-04-11 16:28:37 -07:00
Rick Waldron 44c65fd02a Import tests from Google V8 (Block Scope Additions)
These tests are derived from the following files within the Google V8 project:

    test/mjsunit/es6/regress/regress-2506.js
    test/mjsunit/es6/regress/regress-3426.js
    test/mjsunit/es6/regress/regress-3683.js
2015-04-09 14:21:06 -04:00
Brian Terlson 506f9fe803 Merge pull request #217 from bocoup/rest-params
Import tests from Google V8 (Rest Parameters)
2015-04-08 17:29:49 -07: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
Brian Terlson 47dcfe8cac Merge pull request #223 from bocoup/restructure-generator-tests
Re-structure generator tests
2015-04-08 10:23:28 -07:00
Mike Pennisi c759cdb804 Re-structure generator tests 2015-04-08 11:08:48 -04:00
Rick Waldron dcdc9ba111 block-scope: corrections. Fixes gh-201 2015-04-07 16:58:04 -07:00
Mike Pennisi 29326da2a8 Normalize application of `typeof` operator
Consistently use the `typeof` operator without the grouping operator
(and include one explicit test to ensure the validity of this pattern
generally).
2015-04-07 17:37:45 -04:00
Mike Pennisi 3dce857e32 Update tests to use assertion library 2015-04-07 17:37:45 -04:00
Mike Pennisi 663f6776aa Add ES6 IDs 2015-04-07 17:37:45 -04:00
Mike Pennisi 9c42c10e48 Correct error in test descriptions 2015-04-07 17:37:45 -04:00
Mike Pennisi 5acd66e10a Rename test files
According to the new test organization scheme, specification
identification references should be encoded within the test file itself,
and the file should be named according to the semantics of the test.
2015-04-07 17:37:40 -04:00
Rick Waldron 59e2a7ac57 Import tests from Google V8 (Symbol)
These tests are derived from the following files within the Google V8 project:

	test/mjsunit/harmony/private.js
2015-04-07 16:53:18 -04:00
Brian Terlson 47674610ae Merge pull request #190 from bocoup/harmony-object-literals
Import tests from Google V8 (Object Literal Concise Method and Property Initialization)
2015-04-06 14:49:47 -07:00
Mike Pennisi 57f08522ee fixup! Move tests for Annex B extensions 2015-04-02 18:42:06 -04:00
Mike Pennisi 04cd2f43bb fixup! Catch expected strictmode error 2015-04-02 18:12:18 -04:00
Mike Pennisi 9ed6ca769d fixup! Remove redundant assertion 2015-04-02 17:56:30 -04:00
Mike Pennisi ef899c48fd fixup! Correct typos 2015-04-02 17:56:19 -04:00
Mike Pennisi 1f22932d69 Import tests from Google V8 (templates)
These tests are derived from the following files within the Google V8
project:

    test/mjsunit/es6/templates.js

Some of these tests include non-printable characters, causing git to
infer that they are binary files. Introduce a `.gitattributes` file to
configure git to consistently display the source text of all JavaScript
files.
2015-04-02 12:13:51 -04:00
Rick Waldron c8aabb3664 Import tests from Google V8 (Rest Parameters)
These tests are derived from the following files within the Google V8 project:

    test/mjsunit/harmony/rest-params.js
2015-03-31 16:56:24 -04:00
Rick Waldron 40c07540e7 Fix copyright line 2015-03-30 12:48:02 -04:00
Brian Terlson ceeefa3196 Merge pull request #184 from bocoup/iteration-semantics-2
Import tests from Google V8 (iteration semantics)
2015-03-19 13:39:20 -07:00
Rick Waldron 3ac4b240bb computed-property-names: follow up corrections. Fixes gh-198 2015-03-19 14:54:24 -04:00
Mike Pennisi bd44d30a00 Import tests from Google V8 (iteration semantics)
These tests are derived from the following files within the Google V8
project:

test/mjsunit/es6/iteration-semantics.js
2015-03-18 20:06:12 -04:00
Rick Waldron fc3e2cab05 computed-property-names: corrections. Fixes gh-198 2015-03-18 19:13:11 -04:00
Brian Terlson 538a2a8e83 Merge pull request #183 from bocoup/harmony-block-scope
Import tests from Google V8 (Block Scoping)
2015-03-18 16:09:05 -07:00
Rick Waldron 373b356d33 computed-property-names: corrections. Fixes gh-198 2015-03-18 18:50:05 -04:00
Brian Terlson d24fd10549 Merge pull request #189 from bocoup/harmony-computed-property-names
Import tests from Google V8 (Computed Property Names)
2015-03-06 16:44:57 -08:00
Brian Terlson f6d8dd0f9e Merge pull request #175 from bocoup/harmony-classes
Import tests from Google V8 (Class syntax & semantics)
2015-03-06 13:53:11 -08:00
Brian Terlson 42dc0f6b35 Merge pull request #165 from bocoup/iterators
Add Array Iteration Tests
2015-03-06 13:31:56 -08:00
Mike Pennisi 6565c89de2 Import tests from Google V8
These tests are derived from the following files within the Google V8
project:

    test/mjsunit/es6/array-iterator.js
2015-03-06 14:13:36 -05:00
Rick Waldron 5d11ec4b24 Import tests from Google V8 (Class syntax & semantics)
These tests are derived from the following files within the Google V8 project:

        test/mjsunit/harmony/class-computed-property-names-super.js
        test/mjsunit/harmony/class-property-name-eval-arguments.js
        test/mjsunit/harmony/classes-experimental.js
        test/mjsunit/harmony/classes-lazy-parsing.js
        test/mjsunit/harmony/classes.js
2015-03-06 10:44:37 -05:00
Rick Waldron e7a6c05d36 (Computed Property Names) Re-organize, add assertion messages. 2015-03-05 16:46:11 -05:00
Rick Waldron 4c49047f20 Import tests from Google V8 (Object Literal Concise Method and Property Initialization)
These tests are derived from the following files within the Google V8 project:

        test/mjsunit/harmony/method-name-eval-arguments.js
        test/mjsunit/harmony/object-literals-method.js
        test/mjsunit/harmony/object-literals-property-shorthand.js
        test/mjsunit/harmony/object-literals-super.js
2015-03-05 15:22:13 -05:00
Rick Waldron bd682d8e37 Import tests from Google V8 (Computed Property Names)
These tests are derived from the following files within the Google V8
project:

        test/mjsunit/harmony/computed-property-names-classes.js
        test/mjsunit/harmony/computed-property-names-object-literals-methods.js
        test/mjsunit/harmony/computed-property-names-super.js
        test/mjsunit/harmony/computed-property-names.js
2015-03-05 12:04:46 -05:00
Rick Waldron 3f9587a8ee Import tests from Google V8 (Block Scoping)
These tests are derived from the following files within the Google V8 project:

	test/mjsunit/harmony/block-conflicts.js
	test/mjsunit/harmony/block-for.js
	test/mjsunit/harmony/block-leave.js
	test/mjsunit/harmony/block-let-declaration.js
	test/mjsunit/harmony/block-let-semantics.js
	test/mjsunit/harmony/block-scoping.js
2015-03-04 11:10:46 -05:00
Brian Terlson 1b04b7db08 Merge pull request #180 from smikes/178-generator-super
add () to super call
2015-02-26 16:35:29 -08:00
smikes 3e298dbeed format features correctly 2015-02-25 20:43:23 -07:00
smikes ca47fc46de add () to super call 2015-02-25 20:41:15 -07:00
Brian Terlson 4c510bf078 Merge pull request #167 from smikes/generator-tests
initial set of generator tests
2015-02-19 17:48:11 -08:00
smikes 04f468541e batch of generator tests
fix info, desc

remove dubious test

correct no-name test, add implicit-name test
2015-02-19 18:35:59 -07:00
Rick Waldron 341e31f7d3 Import tests from Google V8 (Arrow Functions)
These tests are derived from the following files within the Google V8
project:

	test/mjsunit/harmony/arrow-functions.js
2015-02-18 12:58:34 -05:00
Rick Waldron cda3ec74a1 ES6-specific tests: es5id=>es6id, new es6id entries. Closes gh-144 2015-02-12 16:36:13 -05:00
Brian Terlson d075338699 Merge pull request #140 from anba/issue-35/expressions
Fix strict mode errors in language/expressions
2014-12-13 11:36:24 -08:00
André Bargull 1a4793926f Fix strict mode errors in language/expressions
- Add missing noStrict flags when tests explicitly require non-strict semantics (e.g. unqualified delete, with statement)
- Change `throw new Exception(...)` to `$ERROR(...)` in call/*
- Replace dynamic strict mode check with noStrict flag in call/11.2.3-3_8
- Align assignment/11.13.1_A3.1 with 11.13.1_A3.2 to avoid creating implicit global variable
- Split test into multiple files when undeclared variable are under test
  - addition/S11.6.1_A2.4_T3
  - division/11.5.2_A2.4_T3
  - does-not-equals/11.9.2_A2.4_T3
  - equals/S11.9.1_A2.4_T3
  - greater-than/S11.8.2_A2.4_T3
  - greater-than-or-equal/S11.8.4_A2.4_T3
  - in/S11.8.7_A2.4_T3
  - instanceof/11.8.6_A2.4_T3
  - left-shift/S11.7.1_A2.4_T3
  - less-than/S11.8.1_A2.4_T3
  - less-than-or-equal/S11.8.3_A2.4_T3
  - modulus/S11.5.3_A2.4_T3
  - multiplication/11.5.1_A2.4_T3
  - right-shift/11.7.2_A2.4_T3
  - strict-does-not-equals/11.9.5_A2.4_T3
  - strict-equals/11.9.4_A2.4_T3
  - subtraction/11.6.2_A2.4_T3
  - unsigned-right-shift/11.7.3_A2.4_T3
- Add declaration when implicit global variable creation not part of the test
  - assignment/11.13.1_A4_T1
  - compound-assignment/S11.13.2_A3.1_T*
  - compound-assignment/S11.13.2_A3.2_T*
  - grouping/11.1.6_A3_T5
  - instanceof/S15.3.5.3_*
- Split test into multiple files when unqualified delete is used
  - delete/S11.4.1_A2.2_T1.js
  - delete/11.4.1_A3.2
  - grouping/S11.1.6_A2
  - grouping/S11.1.6_A3_T6
2014-12-11 19:07:04 +01:00
André Bargull 2903a4c885 Revert 12.14-1 and 12.14-2 (Fixes #120)
Assume tests run with Annex B semantics enabled. (Fixes #120)
2014-12-11 18:45:54 +01: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
André Bargull 0ceb428ec9 Add test coverage for identifier resolution in dynamic scopes
Identifier resolution in dynamic scope context is missing test coverage, resolves https://bugs.ecmascript.org/show_bug.cgi?id=1751 .
2014-12-10 16:05:32 -08:00
Brian Terlson 2a74f0ec1b Reorganize ./test 2014-12-07 15:33:09 -08:00