Commit Graph

1284 Commits

Author SHA1 Message Date
Gorkem Yakin d5c92d09f0 Merge pull request #562 from bocoup/modules-instn
Module semantics: declaration instantiation
2016-04-29 14:25:54 -07:00
Gorkem Yakin a58ca88b31 Merge pull request #561 from bocoup/modules-early
Module code: early errors
2016-04-29 14:25:49 -07:00
Gorkem Yakin f50cc81ace Merge pull request #560 from bocoup/modules-syntax
Module code: syntax validation
2016-04-29 14:25:43 -07:00
Brian Terlson 3d285da73d Replace duplicate description with info in map test 2016-04-29 10:01:41 -07:00
Leonardo Balter 177b2f6018 Add tests for TypedArrays toLocaleString 2016-04-29 09:39:32 -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
Leonardo Balter 9c45e2ac68 Revert "Add `System.global` tests (#567)"
This reverts commit 45e5fc8889.
2016-04-27 14:25:15 -04:00
Mike Pennisi 73a7e23061 Re-generate tests 2016-04-26 16:13:32 -04:00
Gorkem Yakin 84d95077d0 Merge branch 'bocoup/ta-foreach-map-update' 2016-04-26 09:26:03 -07:00
Leonardo Balter afd44fc87a Update tests for TypedArrays foreach and map
Based on the feedback from gh-593
2016-04-26 09:23:58 -07:00
Gorkem Yakin 85e6ab8e15 Merge branch 'bocoup/species-accessor-values' 2016-04-25 16:59:44 -07:00
Mike Pennisi b8e40a6f3f Add tests for return value of @@species accessors 2016-04-25 16:59:23 -07:00
Gorkem Yakin 851be6108a Merge branch 'bocoup/ta-subarray' 2016-04-25 16:53:20 -07:00
Leonardo Balter 1f9cc0b0c0 Add tests for TypedArrays subarray 2016-04-25 16:52:20 -07:00
Gorkem Yakin f6475d81bf Merge pull request #543 from bocoup/enumerable-helper
Fix verifyEnumerable helper to account for properties with Symbol values
2016-04-25 16:32:53 -07:00
Mike Pennisi 784824895d Extend coverage for eval code
Closes #572

Introduce tests for new semantics for ES2015 features such as
lexically-scoped bindings. Also add tests for semantics defined in prior
editions of the specification but not yet covered in this test suite.
2016-04-25 16:43:48 -04:00
Mike Pennisi 2872537136 Add equivalent tests for eval code
For each test that asserts the behavior of either "direct" or "indirect"
eval (but not both), introduce an equivalent test for the opposite case.
2016-04-25 16:36:41 -04:00
Mike Pennisi 364d6433e2 Refactor tests for eval code
Some tests asserted behavior for both "direct" eval and "indirect" eval.
Split these assertions across files dedicated for each use case.
2016-04-25 16:36:39 -04:00
Mike Pennisi 7630e1763d Re-organize tests for eval
Limit tests in `language/expressions/call/` and `built-ins/eval/` to
only assert details that are directly related to the invocation pattern.
Re-organize all other tests within the `language/eval-code/` directory,
further categorizing each as `direct` or `indirect` as appropriate.
Remove the extraneous "executable" flag from those files which carried
it.
2016-04-25 16:36:36 -04:00
Gorkem Yakin 7f88f29328 Merge branch 'bocoup/global-object' 2016-04-25 11:09:49 -07: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
Gorkem Yakin 562133f4ba Merge branch 'bocoup/symbol-cleanup' 2016-04-25 10:59:48 -07:00
Mike Pennisi 3d68fcc063 Increase coverage for Symbol constructor
Add new tests for invocation requirements; re-organize existing files
according to the language feature under test.
2016-04-25 10:59:22 -07:00
Gorkem Yakin 35c00cab92 Merge branch 'bocoup/ta-every-some' 2016-04-25 10:46:38 -07:00
Leonardo Balter 45ff661f75 Add tests for TypedArrays some 2016-04-25 10:46:22 -07:00
Leonardo Balter 3339406dd7 Add tests for TypedArrays every 2016-04-25 10:46:16 -07:00
Gorkem Yakin a4fd0dc8f4 Merge branch 'bocoup-ta-interoperability' 2016-04-25 10:37:06 -07:00
Leonardo Balter 866626500c Update tests for TypedArrays/DataView non-interoperable get accessor methods
Fixes gh-582
2016-04-25 10:36:50 -07:00
Gorkem Yakin c26ef14ae0 Merge branch 'bocoup/ta-indexof' 2016-04-25 10:32:22 -07:00
Leonardo Balter d1f02d0fb8 Add tests for TypedArrays lastIndexOf 2016-04-25 10:31:42 -07:00
Leonardo Balter d46b0b1860 Add tests for TypedArrays indexOf 2016-04-25 10:31:38 -07:00
Gorkem Yakin a432cde542 Merge pull request #534 from mythrialle/master
Removes special handling for UTC timezone in toISOString/15.9.5.43-0-1…
2016-04-25 10:02:19 -07:00
Mythri 664ec78fcc Moves Date constructor outside of assert, so that it actually tests toISOString 2016-04-25 16:45:03 +01:00
Leonardo Balter bc0a40c51c Add tests for TypedArrays findIndex 2016-04-25 11:43:19 -04:00
Mythri 679d02a6ed Fixed comments 2016-04-25 15:43:55 +01:00
Mike Pennisi a8401b34d8 fixup! Add tests for module namespace objects
Implement suggested modification to naming scheme.
2016-04-22 16:36:06 -04:00
Mike Pennisi 436ad9cdfd fixup! Module semantics: evaluation
Implement suggested modification to naming scheme.
2016-04-22 16:29:26 -04:00
Mike Pennisi 84438a53d0 fixup! Module semantics: declaration instantiation
Implement suggested modification to naming scheme.
2016-04-22 16:21:57 -04:00
Leonardo Balter 9aa4dced8d Add tests for TypedArrays find 2016-04-22 10:34:30 -04:00
Leonardo Balter bc8ae6e0ae Fix test for TypedArray.prototype.forEach 2016-04-21 17:22:55 -04:00
jugglinmike ba3dacbe5a Correct tests for native functions' toString value (#580)
Modify the regular expression for native functions' toString value to
satisfy all test cases. Correct the test file's reference to the harness
file. Re-format the test file's assertions to aid debugging in the event
of failure.
2016-04-21 15:55:54 -04: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
Leonardo Balter 88f390d189 Add tests for TypedArrays copyWithin 2016-04-20 14:08:33 -04:00
Leonardo Balter 5e8b661050 Add tests for TypedArrays fill 2016-04-20 14:05:38 -04:00
jugglinmike cf68c3be91 Correct invalid tests for the Date constructor
The millisecond representation of a given Date instance is dependent on
the local system's time zone settings. In order to pass consistently
across contexts, tests for this value must take the system configuration
into account.

Introduce a test harness utility function to encapsulate these concerns.
Re-use this function across all test files that assert the exact
millisecond representation of Date instances.
2016-04-19 17:00:59 -04:00
Leonardo Balter 04a3c28f7d Add tests for conversion operations on TypedArrays 2016-04-19 12:18:52 -04:00
Mike Pennisi d8c686e310 Generate tests 2016-04-18 16:19:29 -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
Mike Pennisi b698c8b3ab Add tests for Math constants
Closes gh-540

Because the specific value of each constant is specified as a
host-defined approximation, only the value type may be enforced by
Test262.
2016-04-18 14:39:37 -04:00
Mike Pennisi f7aa31b41f Remove over-specified tests
Except for a small set of expected input/output pairs, both ES5 and
ES2015 define the expected return value of these methods in terms of an
"implementation-dependent approximation." This makes it inappropriate to
enforce expectations for specific values, even if expressed imprecisely.
2016-04-18 14:36:49 -04:00
jugglinmike 26676beab5 Add tests for IteratorClose in dstr assignment (#524)
The files in this patch are organized according to the following naming
scheme:

Prefix             | Grammar production
-------------------|-------------------
`array-empty-`     | ArrayAssignmentPattern : [ ]
`array-elision-`   | ArrayAssignmentPattern : [ Elision ]
`array-rest-`      | ArrayAssignmentPattern : [ Elisionopt AssignmentRestElement ]
`array-elem-`      | ArrayAssignmentPattern : [ AssignmentElementList ]
`array-elem-trlg-` | ArrayAssignmentPattern : [ AssignmentElementList , Elisionopt AssignmentRestElementopt ]

Suffix             | Intent
-------------------|-------
`-abpt-close-err`  | The assignment evaluation returns an abrupt completion, and the iterator's `return` method throws an error
`-abpt-close-skip` | The assignment evaluation returns an abrupt completion, but IteratorClose is not invoked
`-abpt-close`      | The assignment evaluation returns an abrupt completion, and IteratorClose is invoked as specified
`-get-err`         | Abrupt completion returned from GetIterator
`-nrml-close-err`  | The assignment evaluation completes, and the iterator's `return` method throws an error
`-nrml-close-null` | The assignment evaluation completes, and the iterator's `return` method returns a non-Object value (there is no corresponding `-abpt-` suffix because the algorithm does not reference the return value in those cases)
`-nrml-close-skip` | The assignment evaluation completes, but IteratorClose is not invoked
`-nrml-close`      | The assignment evaluation completes, and IteratorClose is invoked as specified

Not all suffixes are appropriate for all productions. Suffixes have been
simplified in cases where less specificity is necessary to disambiguate
test cases.
2016-04-18 14:33:21 -04:00
dtig 20d37a6f2f Add SIMD test suite and utility functions (#442) 2016-04-18 14:26:15 -04:00
jugglinmike c230b7f307 Add tests for RegExp literal early errors (#566) 2016-04-18 13:36:43 -04:00
jugglinmike a068f19f06 Streamline redundant `eval` tests (#570)
Some tests for `eval` assert the equality of key enumeration on the
global object, comparing the ordering when the object is referenced
through eval.

Based on the test bodies and the "info" field in their metadata, these
tests appear to have been written under the mistaken impression that
erroneous creation of an environment record would be observable through
the `this` value.

In reality, the value in such cases resolves to the global object. That
renders these tests redundant and overly complex--none of the
distinctions between each test actually demonstrates a different
behavior.

Remove the redundant tests and introduce three new tests asserting the
correct resolution of the `this` keyword for direct eval code from
within the global scope and from within function scope.
2016-04-18 13:35:03 -04:00
Leo Balter 3723e7caeb Merge pull request #545 from bocoup/generation
Introduce test generation tool
2016-04-15 17:56:36 -04:00
Leonardo Balter e7f6cd7f86 assert.throws fails if second argument is not a function 2016-04-15 10:14:54 -04:00
Leonardo Balter e451026965 Fix minor typo on a test for Array#fill 2016-04-12 19:48:54 -04:00
Leonardo Balter f3cc1fb983 Add tests for TypedArrays map 2016-04-12 15:41:38 -04:00
Leonardo Balter e01371e12a Add tests for TypedArrays forEach 2016-04-12 15:41:34 -04:00
Jordan Harband 45e5fc8889 Add `System.global` tests (#567) 2016-04-12 14:37:10 -04:00
Michael Ficarra 6b7cbb5035 add Function.prototype.toString tests, conforming to proposed revision
See the proposal at
https://tc39.github.io/Function-prototype-toString-revision/
2016-04-11 14:39:12 -04:00
Leonardo Balter c15079e741 Remove surface tests for %TypedArray%.prototype.toString
Because Test262 asserts the strict equality of
`Array.prototype.toString` and `TypedArray.prototype.toString`, tests
for properties of the object do not need to be reproduced in both
location.

Ref gh-526
2016-04-07 11:36:15 -04:00
Jordan Harband c95e673feb Add tests for `String#padStart` and `String#padEnd`.
https://github.com/tc39/proposal-string-pad-start-end/issues/23

Closes gh-564
2016-04-06 15:13:52 -04:00
Mike Pennisi e4c062c0eb fixup! Add tests for module namespace objects 2016-04-01 15:42:29 -04:00
Leonardo Balter 755b0d6117 Add tests for typedArrays extensibility
Ref: https://github.com/tc39/test262/pull/536#issuecomment-200455389
2016-04-01 15:34:14 -04:00
Mike Pennisi 3dc6d92970 Add tests for module namespace objects
Assert correct behavior of the own properties of module namespace
objects and the essential internal methods of module namespace exotic
objects.
2016-04-01 13:15:16 -04:00
Mike Pennisi cfd7e1f61d Module code: early errors
Assert that relevant early errors are reported following the parsing of
module code.
2016-03-29 12:55:16 -04:00
Mike Pennisi 91e4e20084 Module semantics: evaluation
Files whose name ends in `_.js` are not themselves valid Test262 tests
and should not be interpreted as such by test runners.

---

The tests for the GetBindingValue method of the module Environment
Record are very minimal. This is because GetBindingValue is necessary to
assert any aspect of binding creation/initialization/mutation. In this
way, GetBindingValue is being implicitly tested by every test that
references a binding value.
2016-03-29 12:38:02 -04:00
Mike Pennisi 4273ad1fa7 Module semantics: declaration instantiation
Files whose name ends in `_.js` are not themselves valid Test262 tests
and should not be interpreted as such by test runners.

---

Because the tests in this patch concern declaration *instantiation*,
care has been taken to avoid asserting binding values following
evaluation. Because a given module's dependencies are evaluated prior to
the module itself, this is only observable in modules which import their
own bindings.

A separate patch dedicated to the evaluation of module code asserts the
behavior of bindings following evaluation.

---

For tests that concern the creation of a module namespace object, this
patch relies on the semantics of the `in` operator. The `in` operator
uses the [[HasProperty]] internal method and avoids testing unrelated
semantics concerning binding resolution. Those semantics should be
explicitly asserted with a separate set of tests dedicated to that
purpose.

---

One test case which is notably missing is error resulting from a cycle
due to an `import` declaration (under the current file naming scheme,
such a test might be named `instn-named-err-circular.js`). Due to the
recursive nature of ModuleDeclarationInstantiation, it is not
technically possible for a circular request to be found in step 12.c.i.
Cycles rely on at least 2 `export` declarations, and because these are
resolved *before* imports, any cycle would trigger failure prior to step
12.c.

---

One aspect of *module* resolution that makes ordering observable is the
fact that resolution can fail in two distinct ways (i.e. with a
SyntaxError or with a ReferenceError). This patch includes tests that
leverage this detail in order to assert that modules are resolved in the
correct sequence.

However, from the perspective of the ECMA-262 specification, the
ordering of *export* (e.g. binding) resolution is not observable. This
is due to restrictions on the grammar, where each export is independent.
When *export* resolution fails, it does so with instances of SyntaxError
alone, precluding the above strategy.

So while ModuleDeclarationInstantiation resolves the exports of the
module's dependencies in the following order:

1. "Indirect" exports, e.g.
   - `export { x } from './y.js';`
   - `export { x as z } from './y.js';`
   - `import { x } from './y.js'; export { x };`
2. "Star" imports
   - `import * as ns from './y.js';`
3. "Named" (my word) imports
   - `import x from './y.js';`
   - `import { x } from './y.js';`
   - `import { x as z } from './y.js';`

Intentional failures cannot be used to discern resolution ordering.
2016-03-29 12:33:42 -04:00
Mike Pennisi f817f10858 Module code: syntax validation
Assert that module code is parsed as specified.
2016-03-29 12:10:49 -04:00
Mike Pennisi 076480fc2d Module code: Rename tests for early errors 2016-03-29 12:00:55 -04:00
Mike Pennisi 355ba1ba83 Module code: Remove redundant test 2016-03-29 12:00:28 -04:00
Mike Pennisi e858f918da Module code: Rename negative parsing tests 2016-03-29 12:00:25 -04:00
Leonardo Balter 3cb20b9df5 Add tests for internal methods of typedArray instances
Test specific behaviour for Integer Indexed exotic objects, WRT the
following internal methods:

- [[GetOwnProperty]]
- [[HasProperty]]
- [[DefineOwnProperty]]
- [[Get]]
- [[Set]]
- [[OwnPropertyKeys]]
2016-03-28 10:38:24 -04:00
Leonardo Balter 887b379421 Add tests for ArrayBuffer.isView 2016-03-24 12:14:26 -04:00
Leo Balter 35b93bb5c2 Merge pull request #548 from bocoup/random-fp
Avoid false positives
2016-03-24 10:49:44 -04:00
Leonardo Balter ce503e638f Add tests for detached buffer validation on TypedArray methods 2016-03-23 12:13:41 -04:00
Leonardo Balter 7499d3c208 Add missing surface tests for %TypedArray%.prototype.includes 2016-03-21 14:28:44 -04:00
Leonardo Balter 83b27c9beb Add validation tests for TypedArray instance methods 2016-03-21 11:04:26 -04:00
Leonardo Balter b26190f1ce Add tests for TypedArray instance iterator methods 2016-03-21 11:04:25 -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 0000bcd78c Merge pull request #533 from bocoup/safe-integers
Add tests for Number.{MAX,MIN}_SAFE_INTEGER
2016-03-17 17:32:38 -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 6e61c27aa5 Avoid false positives
As written, the test for `Math.random` would pass if the runtime
erroneously produced a non-numeric value. Add the necessary assertions
to guard against this case.
2016-03-17 17:12:54 -04:00
Leo Balter 86ff467767 Merge pull request #525 from anba/throw-type-error
Improve coverage %ThrowTypeError% and default class constructors
2016-03-17 16:31:37 -04:00
Leo Balter 5357b1585b Merge pull request #504 from bocoup/explicit-async
Make asynchronous test configuration explicit
2016-03-17 15:28:08 -04:00
Mike Pennisi 74bff6b3d5 Add initial set of generated test sources 2016-03-16 15:29:30 -04:00
Leonardo Balter a93ef42b56 Fix verifyEnumerable helper to account for Symbol properties 2016-03-15 10:13:52 -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 63c1cd3da8 Update meta data: `id` to `esid`
The project's expected frontmatter tag name changed while these files
were under review.
2016-03-10 19:46:46 -05:00
Mythri 6376e4d833 Removes special handling for UTC timezon in toISOString/15.9.5.43-0-13.js 2016-03-10 15:38:33 +00:00
Mike Pennisi cb19235ba4 Add tests for Number.{MAX,MIN}_SAFE_INTEGER 2016-03-09 12:21:29 -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
Dan Ehrenberg 007d3b1eb7 Remove a blank line to stop confusing YAML parsers
V8 ran into an issue where the YAML parser our test setup is using
didn't understand the newline, and failed to parser the negative
test expectation below, causing the test to fail. This patch fixes
the issue.
2016-03-04 15:01:01 -05:00
Gorkem Yakin 6e912b0825 Merge pull request #518 from anba/typedarray_getownpropdesc_fixes
Fix test bugs
2016-03-02 13:22:29 -08:00
Leonardo Balter 7445d77d6d Update descriptor tests for %TypedArray%.prototype properties 2016-03-02 13:15:03 -08:00
Leonardo Balter 02cdfacd31 Add tests for %TypedArray%.prototype get methods
Includes buffer, byteLength, byteOffset, length, and @@toStringTag
2016-03-02 13:15:01 -08:00
Leonardo Balter 6c56658974 Add tests for _TypedArray_.prototype methods 2016-03-01 15:36:34 -05:00
André Bargull 2acbd3e98e Improve coverage for default class constructors 2016-03-01 19:15:21 +01:00
André Bargull c46f5ff4b7 Increase coverage for %ThrowTypeError% 2016-03-01 19:13:43 +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
Gorkem Yakin b35b39c4aa Merge branch 'bocoup/module-code' 2016-02-25 13:51:47 -08:00
Gorkem Yakin 304dbf0569 Merge 'rwaldron/exponentiation-operator' 2016-02-23 14:25:05 -08:00
Gorkem Yakin ed32ae6f4a Convert "info" to "description" 2016-02-23 14:24:08 -08:00
Rick Waldron e0afd42914 descriptions and info 2016-02-23 16:42:11 -05:00
André Bargull 1517615a21 Fix test bugs 2016-02-23 18:55:06 +01:00
Rick Waldron 79dfcf3e85 Restore missing object definitions 2016-02-22 19:17:24 -05:00
Rick Waldron b92e68646d improved info and description 2016-02-22 16:49:00 -05:00
Rick Waldron 104a134bc2 restore "info" 2016-02-22 16:41:45 -05:00
Rick Waldron 2a962f74be id => esid 2016-02-22 14:47:47 -05:00
Rick Waldron 2a112a3190 Exponentiation Operator tests 2016-02-22 14:47:47 -05: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
Gorkem Yakin bd33b2b8e5 Merge pull request #509 from bocoup/typedarray-object-set
Add tests for _TypedArrays_(object) using object properties
2016-02-19 16:33:40 -08:00
Mike Pennisi 82abd59f35 Add test for strict mode of module code 2016-02-19 17:39:41 -05:00
Mike Pennisi 5006055c99 Add tests for `await` as an identifier 2016-02-19 17:39:41 -05:00
Mike Pennisi a6dcd0dcca Add tests for position of module declarations
Assert that ImportDeclaration and ExportDeclaration match only the
ModuleItem symbol.

According to the definition of HostResolveImportedModule, it is
acceptable for an implementation to throw a SyntaxError in the event
that a requested module can neither be found nor created:

> If a Module Record corresponding to the pair referencingModule,
> specifier does not exist or cannot be created, an exception must be
> thrown.

In order to reliably detect a SyntaxError in response to the correct
interpretation of the grammar (and not a SyntaxError from an *incorrect*
interpretation of the grammar followed by a failure to resolve the
requested module), the ModuleSpecifier of ExportDeclarations should
describe a valid resource.
2016-02-19 17:36:17 -05:00
Jordan Harband a6fad62d7c Last minute fixes 2016-02-19 11:27:31 -08:00
Jordan Harband 59dad9172b Make proxy traps helper test a bit more robust.
Per https://github.com/tc39/test262/pull/484#discussion_r53228232
2016-02-17 12:50:26 -08: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
Jordan Harband d530c87b41 Create `proxyTrapsHelper` to throw on all traps by default. 2016-02-13 15:56:47 -08:00
Leonardo Balter c82ab8cdbd Add extra tests for _TypedArrays_(object) using object properties 2016-02-13 03:55:53 -02: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
Gorkem Yakin eeb44cbe09 Merge pull request #500 from bocoup/prms-guard-thenable-opt
Promise: Add tests to disallow faulty optimization
2016-02-12 17:06:34 -08:00
Gorkem Yakin 5de18ae0b6 Merge pull request #501 from bocoup/prms-then-ctor-access-count
Promise: Add test for constructor access count
2016-02-12 16:54:20 -08:00
Gorkem Yakin 147ff7f741 Merge pull request #499 from bocoup/reorg-annex-b
Reorganize tests for Annex B extensions
2016-02-12 16:49:06 -08:00
Gorkem Yakin 428418d5c7 Replace remaining es7id tags with id 2016-02-12 16:27:10 -08:00
Leonardo Balter ebda746e6a Replace es7id tags with id 2016-02-12 16:22:56 -08:00
Leonardo Balter 76080eac08 Reuse %TypedArray%.from and .of tests on each TypedArray constructor 2016-02-12 16:02:36 -08:00
Leonardo Balter 048073a29a Add tests for _TypedArray_.from and of 2016-02-12 16:02:36 -08:00
Leonardo Balter 35dce20ec4 Update tests for %TypedArray%.from and of 2016-02-12 16:02:36 -08:00
Gorkem Yakin 02cbd01bfb Merge pull request #486 from bocoup/object-setprototypeof
Add tests for [[SetPrototypeOf]] on immutable prototype exotic objects
2016-02-12 14:59:25 -08:00
Gorkem Yakin ac7711e95f Merge pull request #485 from bocoup/typedarray-constructor
Add tests for _TypedArray_ constructors
2016-02-12 14:47:48 -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 23d566209a Make asynchronous test configuration explicit
For asynchronous tests, the contract between test file and test runner
is implicit: runners are expected to inspect the source code for
references to a global `$DONE` identifier.

Promote a more explicit contract between test file and test runner by
introducing a new frontmatter "tag", `async`. This brings asynchronous
test configuration in-line with other configuration mechanisms and also
provides a more natural means of test filtering.

The modifications to test files was made programatically using the
`grep` and `sed` utilities:

    $ grep "\$DONE" test/ -r --files-with-match --null | \
        xargs -0 sed -i 's/^\(flags:\s*\)\[/\1[async, /g'
    $ grep "\$DONE" test/ -rl --null | \
        xargs -0 grep -E '^flags:' --files-without-match --null | \
        xargs -0 sed -i 's/^---\*\//flags: [async]\n---*\//'
2016-02-12 13:03:19 -05:00
Leonardo Balter df2d760d60 Add tests for Object.prototype extensibility and its immutable prototype
Object.prototype is extensible and an immutable prototype exotic object,
it's [[Prototype]] value is null

Ref tc39/ecma262#308
2016-02-12 13:10:46 -02:00
Mike Pennisi e3fae6eeb4 Promise: Add test for constructor access count
Assert that the `constructor` property of the "this" value of
`Promise.prototype.then` is accessed exactly once. This guards against
implementations where repeated access is used instead of reference
passing (possibly motivated by convenience).

Repeated access of this kind was demonstrated by V8's implementation of
the specification:

https://bugs.chromium.org/p/v8/issues/detail?id=4539
2016-02-10 13:56:55 -05:00
Mike Pennisi 219bdc6f73 Promise: Add tests to disallow faulty optimization
Add tests that assert behavior when a Promise is resolved with another
Promise whose `then` method has been overridden. Because all objects
with a `then` method are treated equivalently, the presence of a
[[PromiseState]] internal slot should have no effect on program
behavior.

These tests guard against a faulty optimization originally implemented
in V8:

https://bugs.chromium.org/p/v8/issues/detail?id=3641
2016-02-10 13:38:03 -05:00
Mike Pennisi fbce4ea11c Reorganize tests for Annex B extensions
The "mainline" tests in Test262 are converging on a more formal
structure. Files are organized as tests for either either "language"
(e.g. syntax-driven) or "built-in" (e.g. API-driven). "Language" test
locations are themselves structured according to whether the syntactic
form under test is an Expression or a Statement.

To limit ambiguity when locating/adding tests, re-organize the tests for
Annex B extensions to match this structure.
2016-02-10 10:15:35 -05:00
Gorkem Yakin 26aeed1428 Merge pull request #494 from bocoup/indexof-zero
Add tests for zero conversion on Array#indexOf and Array#lastIndexOf
2016-02-05 15:38:45 -08:00
Leonardo Balter 26785d40ca Add tests for zero conversion on Array#indexOf and Array#lastIndexOf
Fixes #435
2016-02-05 19:17:26 -02:00
Gorkem Yakin 7cd2112bf1 Merge pull request #490 from bocoup/reorg-obj
Move tests for object literals
2016-02-05 09:04:40 -08:00
Leonardo Balter 75952beee2 Move test file from TypedArray to TypedArrays folder 2016-02-05 11:58:55 -02:00
Leonardo Balter 0a30413b49 fixup! rename test files + review fixes 2016-02-05 11:53:33 -02:00
Leonardo Balter d033b160cb fixup! Add tests for TypedArrays constructors 2016-02-05 11:53:32 -02:00
Leonardo Balter 7a8120fb63 fixup! Add tests for TypedArrays constructors 2016-02-05 11:53:32 -02:00
Leonardo Balter f8a4229bfd Add tests for TypedArrays constructors 2016-02-05 11:53:32 -02:00
Leonardo Balter 4bdd808d04 Update %TypedArray% function length 2016-02-05 11:53:32 -02:00
Leonardo Balter 7d715a4ef1 Revalidate basic call tests for ES2016 %TypedArray% constructor 2016-02-05 11:53:31 -02:00
Mike Pennisi 700f1469e1 Move tests for object literals
Test262 defines tests for expression-producing syntactic forms within
the `language/expressions/` directory. Most tests for object literals
conform to this structure, but 12 such tests were added to the
`language/object-literal/` directory. Move these tests to the canonical
location for object literals.
2016-02-04 09:58:31 -05:00
Jordan Harband cf83ad5e73 s/esid/id/g 2016-02-01 23:44:48 -08:00
Jordan Harband 940d8698d1 Add test with duplicate keys.
Per https://github.com/tc39/test262/pull/484#issuecomment-178145781
2016-02-01 16:57:31 -08:00
Jordan Harband 0a5e8372aa Review feedback. 2016-02-01 10:44:25 -08: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
Jordan Harband cf578d5190 Add Object.getOwnPropertyDescriptors tests. 2016-02-01 01:45:23 -08:00
Gorkem Yakin 07aafd0c63 Merge pull request #505 from anba/intl_name
Add coverage for 'name' property of Intl built-in functions
2016-02-19 11:04:38 -08:00
Leonardo Balter efced6eb32 Add test to assert Reflect.enumerate is now undefined
Ref #495
2016-02-18 16:40:00 -05:00
Leonardo Balter 65241f1e93 Add test to assert Proxy enumerate trap is not triggered anymore
Ref #495
2016-02-18 16:39:41 -05:00
Leonardo Balter 63c1f1ca88 Remove tests for Reflect.enumerate
Ref #495
2016-02-18 15:57:14 -05:00
Leonardo Balter e223738369 Remove tests for Proxy enumerate
Ref #495
2016-02-18 15:57:14 -05:00
Leonardo Balter a61fca93fa Fix test for TypedArrays.from on callable function
TypedArrays constructors are still callable even if they trigger a
TypeError Exception when a new target is not defined
2016-02-18 13:39:49 -05:00
André Bargull 31a9036e9b Add coverage for 'name' property of Intl built-in functions 2016-02-12 18:58:57 +01:00
Leonardo Balter e3c5f66a40 Fix case sentitive error on test/built-ins/Object folder
Fixes gh-482
2016-01-29 10:02:25 -05:00
Gorkem Yakin 052bf2379b Merge pull request #475 from bocoup/completion-reform
Tests for ES2015/2016 Completion Reform
2016-01-26 12:38:27 -08:00
Tom Schuster 97c61513d8 Stop test262 from hanging Spidermonkey with an unimportant error message 2016-01-23 17:41:59 +01: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
Leonardo Balter 1a64295a0b Replace TypedArray constructor invalid length test for ES2016 specs
Replace a ES2015 test where calling the TypedArray constructor with
a floating number triggered a RangeError. Within the ES2016 specs,
the same call will trigger a TypeError, as the result for
`SameValue(NewTarget, here)` will be checked before.
2016-01-21 10:41:16 -05:00
Mike Pennisi 8f8b663ce7 Add tests for TypedArray intrinsic 2016-01-21 10:41:16 -05:00
Gorkem Yakin e56687f5e9 Merge pull request #473 from bocoup/for-inof-exprs
Add tests for iterator expression in ForIn/Of head
2016-01-19 18:42:11 -08:00
Gorkem Yakin 738a24b109 Merge pull request from jugglinmike/improve-promise-coverage-resolve (closes #463) 2016-01-19 16:33:23 -08:00
Mike Pennisi b1b4f04494 Add tests for Promise Resolve Functions
Remove files that tested both PerformPromiseThen and
PromiseResolveFunction in favor of new tests that test
PromiseResolveFunction more directly and completely.
2016-01-19 16:32:36 -08: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
Gorkem Yakin 4a862fba95 Merge pull request #465 from jugglinmike/improve-promise-coverage-all-race
Improve Promise coverage: PerformPromiseAll & PeformPromiseRace
2016-01-15 16:19:18 -08:00
André Bargull 33395b52f5 Add basic surface tests for NativeErrors 2016-01-15 18:13:36 +01:00
André Bargull 1bac79fbf3 Add basic surface tests for TypedArrays 2016-01-15 18:13:08 +01:00
André Bargull 42edfd6e89 Add missing tests for "length" and "name" properties of %TypedArray% built-in functions 2016-01-15 18:12:42 +01: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
André Bargull bb1bda6dfd Add missing tests for "length" and "name" properties of AnnexB built-in functions 2016-01-15 18:11:38 +01:00
André Bargull 5e3eed63b9 Move Symbol.species and AnnexB tests to new subfolders 2016-01-15 18:11:03 +01:00
Gorkem Yakin 4d418a9fe7 Merge pull request #468 from bocoup/subclassing
Subclassing built-in objects
2016-01-14 11:48:57 -08:00
Gorkem Yakin cd60a6d83a Merge pull request #464 from jugglinmike/improve-promise-coverage-cap
Improve Promise coverage: NewPromiseCapability
2016-01-13 16:49:47 -08:00
Gorkem Yakin 9d48bb0875 Merge pull request #462 from jugglinmike/improve-promise-coverage-reject
Improve Promise coverage: Promise Reject Function
2016-01-13 16:49:21 -08:00
Gorkem Yakin 8e76f6ca62 Merge pull request #461 from jugglinmike/improve-promise-coverage-then
Improve Promise coverage: Promise.prototype.then
2016-01-13 16:49:17 -08:00
Gorkem Yakin c9764dc5b5 Merge pull request #460 from bocoup/destructuring-binding
Destructuring Binding - syntax and simple initialization
2016-01-13 16:03:24 -08:00
Gorkem Yakin e7f4e4324a Merge pull request #455 from anba/instanceof_op
Add tests for instanceof operator when prototype property is primitive or getter
2016-01-13 14:59:17 -08: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
Leonardo Balter 705940d205 Add tests for Subclassing the built-in Proxy Object 2016-01-12 16:40:19 -05:00
Leonardo Balter d30e98df53 Add tests for Subclassing the built-in Promise Objects 2016-01-12 16:39:00 -05:00
Leonardo Balter 85ee704ad7 Add tests for Subclassing the built-in GeneratorFunction Objects 2016-01-12 15:17:59 -05:00
Leonardo Balter 4e079a8cab Add tests for Subclassing the built-in DataView Objects 2016-01-12 14:02:00 -05:00
Leonardo Balter 0c40ed0cf0 Add tests for Subclassing the built-in ArrayBuffer Objects 2016-01-11 17:57:47 -05:00
Leonardo Balter 4ad09e5060 Add tests for Subclassing the built-in WeakSet Objects 2016-01-11 17:57:47 -05:00
Leonardo Balter ff3724fd43 Add tests for Subclassing the built-in WeakMap Objects 2016-01-11 17:57:46 -05:00
Leonardo Balter 194b6b597f Add tests for Subclassing the built-in Set Objects 2016-01-11 17:57:46 -05:00
Leonardo Balter ba1482df8a Add tests for Subclassing the built-in Map Objects 2016-01-11 17:57:46 -05:00
Leonardo Balter 6fdf6dd752 Add tests for Subclassing the built-in TypedArray Objects 2016-01-11 17:57:46 -05:00
Leonardo Balter 27764aa355 Add tests for Subclassing the built-in String Objects 2016-01-11 17:57:45 -05:00
Leonardo Balter fc160c78ad Add tests for Subclassing the built-in RegExp Objects 2016-01-11 17:57:45 -05:00
Leonardo Balter 5be3a8019d Add tests for Subclassing the built-in Date Objects 2016-01-11 17:57:45 -05:00
Leonardo Balter f5b5ad47e5 Add tests for Subclassing the built-in Number Objects 2016-01-11 17:57:45 -05:00
Leonardo Balter 67ec7fbf7b Add tests for Subclassing the built-in NativeError Objects 2016-01-11 17:57:44 -05:00
Leonardo Balter 390c7a7fdb Add tests for Subclassing the built-in Error Object 2016-01-11 17:57:44 -05:00
Leonardo Balter a5b3c84fbd Add tests for Subclassing the built-in Symbol Object 2016-01-11 17:57:43 -05:00
Leonardo Balter 47faa3ec58 Add tests for Subclassing the built-in Boolean Object 2016-01-11 17:57:43 -05:00
Leonardo Balter 1bcc056914 Add tests for Subclassing the built-in Function Object 2016-01-11 17:57:43 -05:00
Leonardo Balter cde62d08d8 Add tests for Subclassing the built-in Object 2016-01-11 17:57:42 -05:00
Leonardo Balter 7a87731d9c Add tests for Subclassing the built-in Array Object 2016-01-11 17:57:42 -05:00
Mike Pennisi 7fab70bb21 Add tests for Promise Reject Functions 2016-01-07 13:24:42 -05:00
Mike Pennisi a5bf19486a Extend coverage for PerformPromiseThen 2016-01-07 13:24:01 -05:00
Mike Pennisi 8e069e918f Extend coverage for PromiseReactionJob
Add tests that assert sequential job execution
2016-01-07 13:24:01 -05:00
Mike Pennisi eded6b269b Extend tests to fully cover invocation concerns
Update test metadata to accurately describe the more complete set of
assertions.
2016-01-07 13:24:00 -05:00
Mike Pennisi 5f2ba2522f Limit semantics under test
Because these tests concern the behavior of the PromiseReactionJob
abstract operation itself, they should avoid assumptions about the
correct implementation of that operation. Specifically: they should not
rely on the behavior of abupt completions returned from "reaction
handler" functions.

Re-implement tests to express control flow expectations using the
`$DONE` function only.
2016-01-07 13:23:54 -05:00
Mike Pennisi 5a8d1fdf77 Re-organize tests according to internal operations
By organizing files according to the structure of the specification,
test coverage can be more methodically evaluated.
2016-01-07 13:01:25 -05:00
Mike Pennisi 29cdc4543f Rename tests for PromiseReactionJob
Use names that describe the behavior (not the location in the
specification) as per the current convention.
2016-01-07 12:55:36 -05:00
Mike Pennisi f01767916a Rename tests for PerformPromiseThen
These tests concern the behavior of PerformPromiseThen for settled
Promises. That abstract operation behaves differently for pending
promises, so the file naming scheme should reflect this distinction in
order to support the future implementation of additional tests.
2016-01-07 12:55:31 -05:00
Mike Pennisi 615f42274d Extend coverage for NewPromiseCapability 2016-01-07 12:42:44 -05:00
Mike Pennisi 6e9d88a293 Extend coverage for PerformPromiseRace 2016-01-07 12:42:21 -05:00
Mike Pennisi bb26beece2 Extend coverage for PerformPromiseAll 2016-01-07 12:42:21 -05:00
Leonardo Balter 5e653f2e6c ObjectBindingPatterns can't end with multiple commas 2015-12-29 16:50:23 -05:00
Leonardo Balter 7e24ed9999 Destructuring Binding - syntax and simple initialization 2015-12-29 16:31:12 -05:00
André Bargull 92423d3c9f Add tests for instanceof operator when prototype property is primitive or getter 2015-12-22 19:05:53 +01:00
Jordan Harband f1d072dec2 Ensure verifyConfigurable is last, because side effects suck 2015-12-22 09:25:33 -08: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
Jordan Harband 17e9f3aa00 Add Proxy tests to ensure observable semantics are maintained 2015-12-14 17:00:33 -08:00
Jordan Harband a9503d5543 Adding keys during enumeration should not result in their appearance.
Per 9bd1954950 and https://github.com/tc39/test262/pull/453#discussion_r47556411
2015-12-14 14:13:01 -08:00
Jordan Harband 3dea218911 Minor review feedback 2015-12-14 12:20:14 -08:00
Jordan Harband bf378352c7 Ensure fakeObject has "entries" and "values" 2015-12-14 12:15:21 -08:00
Gorkem Yakin 07eafc6651 Merge pull request #448 from anba/arraybuffer_coverage
Add tests for ArrayBuffer and ArrayBuffer.prototype.slice
2015-12-10 08:29:49 -08:00
Gorkem Yakin ca0e411870 Merge pull request #447 from anba/promise_coverage
Improve test coverage for various Promise methods
2015-12-10 08:29:38 -08:00
Rick Waldron 59dfae6311 Merge pull request #450 from cscott/promise-improvements
Remove unnecessary ES2015 syntax; add feature flags where appropriate.
2015-12-04 14:50:52 -05:00
André Bargull 4341537ecd Add 'class' features tag 2015-12-04 14:31:01 +01:00
C. Scott Ananian bae004d531 Remove unnecessary ES2015 syntax; add feature flags where appropriate.
This allows these tests to be more easily reused to test Promise
implementations in isolation.
2015-12-03 17:34:17 -05:00
Gorkem Yakin 47d3eb1bfe Merge pull request #446 from anba/es2016_december_update
Updates for ES2016 Draft 2015-12-01
2015-12-03 13:15:34 -08: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 5279bcb174 Improve test coverage for various Promise methods 2015-12-02 18:06:40 +01:00
André Bargull 6fcd24cd47 Add tests for ArrayBuffer and ArrayBuffer.prototype.slice 2015-12-02 18:05:12 +01:00
André Bargull 38c6700cbb Test built-in function requirements of Promise and Proxy helper functions 2015-11-24 20:12:55 +01:00
Jordan Harband 7a5385e2ab Add `es7id: pending` per https://github.com/tc39/test262/pull/95#issuecomment-157790248 2015-11-23 11:04:45 -06:00
Jordan Harband e459048f22 Add Object.values tests 2015-11-22 00:56:43 -06:00
Jordan Harband b517ca7119 Add Object.entries tests 2015-11-22 00:52:49 -06: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
André Bargull 77297535af Interpret date-only forms as UTC
- Don't interpret date-only as local time
2015-11-11 17:46:32 +01:00
André Bargull 1da4c78051 Revert primitive wrapper prototypes and String#split to ES5
- Revert Number, Boolean and String prototypes to ES5 semantics
- Revert String.prototype.split's to ES5 behavior
2015-11-06 18:50:44 +01:00