Commit Graph

1531 Commits

Author SHA1 Message Date
Leo Balter c4086508db Merge pull request #555 from bocoup/fix-example
Correct example in contribution guidelines
2016-03-29 15:19:02 -07: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 70c7375be8 Add harness/detachArrayBuffer.js 2016-03-22 17:00:01 -04:00
Mike Pennisi 3a3ced170e Correct example in contribution guidelines
As written, the example for asserting runtime errors is written with an
early error. Because the error is expected to be reported prior to
program execution, the `assert.throws` function cannot be used to detect
it.

Demonstrate the usage of the helper function with a runtime error.
2016-03-22 09:53:56 -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
Mike Pennisi c5b9716144 Introduce test generation tool 2016-03-16 14:39:44 -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
Leo Balter b1c979d391 Merge pull request #539 from bocoup/id-to-esid
Update meta data: `id` to `esid`
2016-03-11 11:42:29 -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
Gorkem Yakin e9c7608f6f Merge pull request #517 from bocoup/typedarray-prototype 2016-03-02 13:16:03 -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 a5e8ac18c4 Merge pull request #513 from bocoup/runner-deprecate
Console Runner: Revert Parallelization and Formally Deprecate
2016-02-25 13:50:26 -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