Commit Graph

1454 Commits

Author SHA1 Message Date
jugglinmike a41b71115b Annex b skip fib (#704)
* Re-generate tests

The test generation tool has been modified in the time since these tests
were first generated and committed to the project. Re-generate the tests
using the latest version of the tool.

* Add test cases for Annex B hoisting disqualifiers

The "variable-like" function hoisting semantics defined in Annex B
extension B.3.3 is only applied if "[...] replacing the
FunctionDeclaration f with a VariableStatement that has F as a
BindingIdentifier would not produce any Early Errors [...]". Test262
previously included tests for this condition when the disqualifying
early error originated from the ScriptBody and FunctionBody productions.

Add test cases to assert the behavior when it is disqualified by all
other relevant early errors: Block statements, `for` statements,
`for-of` statements, `for-in` statements, and Switch statements.

* Generate tests

* fixup! Add test cases for Annex B hoisting disqualifiers

* fixup! Add test cases for Annex B hoisting disqualifiers

Correct test case "info" meta-data.

* fixup! Add test cases for Annex B hoisting disqualifiers

Improve test bodies

* fixup! Generate tests
2016-07-11 16:37:42 -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
Mike Pennisi acebbcaeb2 Add tests for Date.prototype methods 2016-07-09 13:09:15 -04:00
Mike Pennisi 8918e860cc Add tests for Date.UTC 2016-07-09 12:15:17 -04:00
Mike Pennisi 8791771268 Add test for subclassing Date 2016-07-09 12:15:16 -04:00
Mike Pennisi 7ac2aa06ca Add test for `name` property of Date constructor 2016-07-09 12:15:16 -04:00
Mike Pennisi 577a9cac9e Add tests for use of ToPrimitive in Date ctor 2016-07-09 12:15:15 -04: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
jugglinmike 8d78eddcc6 Add test for early error in RegExp literals (#723) 2016-07-08 18:01:35 -07:00
Leonardo Balter 7b1eddf6b0 Update and expand tests for isNaN 2016-07-07 15:55:28 -04:00
Leonardo Balter 81f22800fa Update and expand tests for isFinite 2016-07-07 15:55:27 -04:00
jugglinmike 96c4e7730b Json whitespace (#724)
* Express JSON syntax tests with multiple assertions

When written with a single assertion, this test verifies only that "one
or more" of the Unicode points produces a SyntaxError. Re-factor the
test so that parsing behavior for each code point can be tested in
isolation.

* Re-introduce assertion

ECMAScript edition 2016 relies on the Unicode standard at version 8.0.0.
As part of a larger effort to update Test262 accordingly, the assertion
for the SyntaxError resulting from the use of the Mongolian Vowel
Separator (U+180E) was removed. However, ECMA-401 (The JSON Data
Interchange Format) continues to describe "insignificant whitespace" as
follows:

> Insignificant  whitespace  is  allowed  before  or  after  any  token.
> The  whitespace  characters  are:  character  tabulation  (U+0009),
> line  feed  (U+000A),  carriage  return (U+000D),  and  space
> (U+0020)

And because ECMA262 specifies step 2 of the `JSON.parse` algorithm as
follows:

> 2. Parse JText interpreted as UTF-16 encoded Unicode points (6.1.4) as
>    a JSON text as specified in ECMA-404. Throw a SyntaxError exception
>    if JText is not a valid JSON text as defined in that specification.

...the use of U+180E between JSON tokens should continue to produce a
SyntaxError, regardless of ECMA262's updated Unicode standard.

* fixup! Express JSON syntax tests with multiple assertions
2016-07-06 23:06:58 -07:00
Leo Balter ca7018bc7e Use global values on typeof tests for Number values (#713)
This is a pure miscellaneous change to use global values of NaN and Infinity instead of their namespaced equivalents.
Ref 9ae0567a50 (r69049894)
cc @suwc
2016-07-06 14:41:22 -07:00
Leonardo Balter 5525a64fbb
Update DataView method tests for detached buffer check order 2016-07-06 14:37:34 -03:00
Leonardo Balter 3868f8f765 Update test for distinct NaN replacement on DefineOwnProperty
Fixes gh-683
Ref gh-648
Ref tc39/ecma262#353
2016-07-06 11:30:33 -04:00
Mathias Bynens 3a5a09eba2 Ensure U+180E is no longer considered whitespace
Ref. https://hashseed.blogspot.com/2014/08/in-ecma-262-5.html
Ref. https://github.com/tc39/ecma262/pull/300#issuecomment-181376767
Ref. 9b10d2a597

Fix and add @anba’s U+180E tests
2016-07-06 10:11:32 -04:00
jugglinmike ab4ff914fb Add tests for assignment target validation of new ES2015 forms (#693)
This re-factors some existing Sputnik tests to be more targeted and to use a
pattern that can be generalized to other forms. We could test these all day,
but I've limited myself to forms introduced in ES2015, specifically
YieldExpression and new.target. Note that SpiderMonkey incorrectly throws a
SyntaxError for these.
I thoughtlessly wrote ReferenceError tests for yield = 1 until I realized
that such productions are not actually recognized by the grammar, so the early
errors do not apply. Instead, I've added a negative syntax test for that case.

* Refactor test for valid cover

* Add tests for ValidSimpleAssignmentTarget

Ensure that constructs introduced in ES2015 are disallowed as assignment
targets, with or without a "cover" grammar.

* Add test for grammar precedence of YieldExpression
2016-07-05 15:20:56 -07:00
jugglinmike f554f68ae9 Improve coverage for section 21: String (#712)
This changeset increases coverage for section 21, specifically "21.1 String
Objects".

* Add tests for "this" validation of String methods

* Add tests for ToNumber as used by String methods

* Add test for `length` prop of exotic String objs

* fixup! Add test for `length` prop of exotic String objs
2016-07-05 14:04:31 -07:00
Leonardo Balter 021d44822c Add tests for custom ctor returns on TypedArrays from and of 2016-07-05 16:29:23 -04:00
Leonardo Balter 6fcbfaf0f0 Assert TypedArray iterators inherit from ArrayPrototypeIterator 2016-07-05 16:29:22 -04: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
Leonardo Balter a78cf3de4a Fix tests for DataView#setFloat when no value arg is provided
Fixes gh-686
2016-07-05 16:29:21 -04:00
Leonardo Balter 09be4da196 Fix test for TypedArray(length)
Fixes gh-694
2016-07-05 16:29:21 -04:00
Leonardo Balter 6497c1f5cc Merge tests for TypedArrays#length when this is not object 2016-07-05 16:29:20 -04:00
Leonardo Balter d190e700f3 Add bit-precision tests for TypedArray#copyWithin 2016-07-05 16:20:16 -04:00
Mike Pennisi 14595b47b8 Add tests for restricted grammar productions 2016-07-02 15:46:16 -04:00
Mike Pennisi 24391fb9e8 Add tests for early errors from `super` 2016-07-02 15:46:15 -04:00
jugglinmike fce8b5852d Extend coverage for Section 25 - Generators (#700)
* Improve tests for GeneratorPrototype methods

- Assert return values more consistently
- Expand tests for constraints on `this` value

* Add more tests for dynamic GeneratorFunctions

* Add more tests for GenerationFunction.prototype

* Add more tests for the GeneratorFunction object

* Extend test: GeneratorFunction.prototype.prototype

* Improve precision of tests for generator methods

Extend existing assertions to explicitly verify that execution halts at
the intended location. Correct tests which were previously asserting
this behavior in contexts that did not match their name/description.

* Remove unused variables

* fixup! Improve tests for GeneratorPrototype methods

* fixup! Improve tests for GeneratorPrototype methods
2016-07-01 11:24:27 -07:00
jugglinmike e290a337b8 Improve coverage for section 12, "Expression" (#695)
* Add missing test for early error

* Add missing test for WithBaseObject

* Improve coverage for `new.target`

* Add test for deletion of SuperReference

* Add tests for `in` keyword restrictions

* fixup! Improve coverage for `new.target`
2016-07-01 11:23:43 -07: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 a3fffa754b Improve coverage for "super" keyword (#687)
* Improve test coverage for `super` keyword

Add tests for SuperCall and SuperProperty, organized together in the
`test/language/expressions/super/` directory. For SuperProperty, include
tests for usage from within Object initializers and class bodies because
a different set of semantics are observable from each context.
2016-06-29 16:45:19 -07:00
Mike Pennisi 4e781091f8 Improve tests for RegExp `lastIndex` property
The prior version of this test asserted only the property's
configurability. It was also limited to the RegExp object as returned
from the RegExp constructor.

Extend the test to verify all values of the property descriptor.
Duplicate these assertions in a separate file dedicated to the RegExp
object as created from a RegExp literal.
2016-06-29 17:29:43 -04:00
Mike Pennisi 1d0dbc5726 Assert absense of internal slot on RegExpPrototype
The previous commit removed two invalid tests designed to ensure that
the RegExpPrototype object is not itself a RegExp object. Introduce a
new test to assert this detail in a way that accounts for the
possibility of host extensions.
2016-06-29 17:29:42 -04:00
Mike Pennisi 9c3bb8d69e Remove invalid tests for %RegExpPrototype%
From ECMA262, section 16:

>  Except as restricted in 16.2, an implementation may provide
>  additional types, values, objects, properties, and functions beyond
>  those described in this specification.

Section 16.2 makes no mention of the `lastIndex` property of the
%RegExpPrototype% intrinsic. It is therefor not a violation to define
%such an "own" property.

Remove the tests that assert otherwise.
2016-06-29 17:29:42 -04:00
Mike Pennisi b9587262d4 Add tests for return value: 'get RegExp.p.source' 2016-06-29 17:29:42 -04:00
Mike Pennisi e1cd1e7f85 Update and tests for %RegExpPrototype% methods
A recent web-compatability change to ECMA262 modified the semantics of
the accessor methods on the %RegExpPrototype% intrinsic--the "get"
accessors now include steps dedicated to the case where the "this" value
is the %RegExpPrototype% object itself.

Remove the tests that have been invalidated by this change, introduce
tests asserting the new behavior, and extend coverage for other possible
"this" values.
2016-06-29 17:07:46 -04:00
Mike Pennisi 9114f815a0 Add test for '^' assertion with 'm' flag
The specification contains an explicit informative NOTE explaining that
the 'm' flag does not effect the behavior of the '^' assertion. Add a
test to verify this.
2016-06-29 17:07:45 -04:00
Mike Pennisi 0ba684e312 Assert SyntaxError with lower bound in escape seq.
ES2015 reads:

> RegExpUnicodeEscapeSequence :: u{ HexDigits }
>
> - It is a Syntax Error if the MV of HexDigits > 1114111.

Use the MV 0x110000 to assert the lower boundary of values which are
expected to produce the SyntaxError.
2016-06-29 12:34:17 -04:00
jugglinmike 23efc2c96a Extend test for HTML comments (#684)
Extend test for HTML comments

The V8 engine incorrectly requires a leading newline character for
MultiLineComments which contain the optional trailing HTMLCloseComment
[1]. Extend the current tests to fail when such an invalid restriction
is in place.
[1] https://bugs.chromium.org/p/v8/issues/detail?id=5142
2016-06-28 15:54:40 -07: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
Leonardo Balter f3bfaa692d Expand tests for Math.log1p 2016-06-27 16:04:17 -04:00
Leonardo Balter 080afac906 Update tests for Math.{sign,sin,trunc} 2016-06-27 16:04:17 -04:00
Leonardo Balter e3e7a510ff Expand tests for Math.imul 2016-06-27 16:04:17 -04:00
Leonardo Balter 80c1c46b53 Update tests for Math.hypot 2016-06-27 16:04:16 -04:00
Leonardo Balter f88c93520d Expand tests for Math.fround 2016-06-27 16:04:16 -04:00
Leonardo Balter d6eb13b4b5 Expand tests for Math.clz32 2016-06-27 16:04:15 -04:00
Leonardo Balter 440211e96a Update tests for Math.acosh 2016-06-27 16:04:15 -04:00
Leonardo Balter 561ac9e473 Extend coverage for Math.abs 2016-06-27 16:04:15 -04:00
Leonardo Balter 0f29f57fdc Update Math functions to handle distinct -0 and +0 2016-06-27 16:04:15 -04:00
Leonardo Balter 13e01e4340 Add tests for Math.{max,min} handling zeros 2016-06-27 16:04:14 -04:00
Leonardo Balter ec3a89ebb8 Add test for the Math object 2016-06-27 16:04:14 -04:00
Leonardo Balter 059b7cd4a3 Remove invalid tests
ConversionError and RegExpError tests are methods that existed on
something that preceeded a IE9 Standard. They do not exist in the
specs, at least since ES5.

It's not test262 responsibility to maintain these tests as these
features can be freely implemented by any runtime.
2016-06-27 15:57:56 -04:00
Mike Pennisi 1ec40f349a Re-write tests for Promise.prototype internal slots
The original implementation of the test for the absense of a
[[PromiseState]] internal slot did not actually assert the documented
semantics. Re-implement the test to rely on the IsPromise abstract
operation (via `Promise.prototype.then`) to accurately ensure that the
object does not have a [[PromiseState]] internal slot.

In relying on the semantics of the `instanceof` operator, the original
test for the [[Prototype]] internal slot was imprecise (the assertion
could be satisfied if additional objects were incorrectly defined on the
prototype chain). Re-write the test to assert the value of the
[[Prototype]] internal slot directly.
2016-06-27 15:31:01 -04:00
Mike Pennisi cc7c77b9a1 Add test for Promise prototype property descriptor 2016-06-27 15:31:00 -04:00
Mike Pennisi 23659d6128 Extend coverage for `Promise.prototype.catch` 2016-06-27 15:31:00 -04:00
Mike Pennisi 12902b29c0 Add tests for invocation of Promise capability fns 2016-06-27 15:26:36 -04:00
Mike Pennisi c62700c8ef Assert iterator protocol for Promise methods 2016-06-27 15:26:35 -04:00
Mike Pennisi 2b5efe135c Add test for abrupt completion during Promise.all 2016-06-27 15:19:48 -04:00
Mike Pennisi b458d9bcc4 Add more tests for Promise resolution
Ensure that resolution is ignored for Promises that have already been
rejected.
2016-06-27 15:19:48 -04:00
Mike Pennisi 023ab45cf0 Extend tests for Promise resolve and reject fns
Assert expected return values in all cases.
2016-06-24 20:17:24 -04:00
Leonardo Balter 9ff1cbb50c
Fix range check tests for DataView#set methods
Fixes gh-685
2016-06-23 17:34:58 -04:00
Leonardo Balter 1eaae52eb8 Add prop-desc tests for Number.prototype properties 2016-06-23 14:42:40 -04:00
Leonardo Balter 4dd7e5aa4b Extend Number tests to assert abrupt completions 2016-06-23 14:42:40 -04:00
Leonardo Balter 9223f56344 Update and add basic prop-desc tests for Number
and Number.prototype
2016-06-23 14:42:40 -04:00
Leonardo Balter 8066b9ecaf Add tests for Number.{parseFloat,parseInt} 2016-06-23 14:42:39 -04:00
Leonardo Balter 47f806ecef Update tests for Number.NaN 2016-06-23 14:42:39 -04:00
Leonardo Balter 4492b8032b Add tests for Number.isSafeInteger 2016-06-23 14:42:39 -04:00
Leonardo Balter 3685e6b7b3 Update and add tests for Number.isNaN 2016-06-23 14:42:39 -04:00
Leonardo Balter c246bc7d09 Add tests for Number.isInteger 2016-06-23 14:42:39 -04:00
Leonardo Balter 46d8c3d6b8 Add tests for Number.isFinite 2016-06-23 14:42:39 -04:00
Leonardo Balter 454b8f10b8 Update and add tests for Number.POSITIVE_INFINITY 2016-06-23 14:42:39 -04:00
Leonardo Balter 7e55e54538 Update and add tests for Number.NEGATIVE_INFINITY 2016-06-23 14:42:39 -04:00
Leonardo Balter 36909a0595 Add tests for Number.EPSILON 2016-06-23 14:42:38 -04:00
Tom Care 149cd4ae9a Merge pull request #673 from bocoup/relax-test
Relax test for forbidden extension
2016-06-22 15:41:46 -07:00
Leonardo Balter ac628975a3
Remove unused variables
Fixes gh-597
2016-06-21 13:03:22 -04:00
Mike Pennisi 418386e33e
Remove redundant tests
These tests have been re-factored to expand coverage of the "default
parameter" language feature and to more closely adhere to this project's
preferred file organization.
2016-06-21 12:22:50 -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 1e6cbbf7ba
Add test ensuring withEnvironment flag is honored 2016-06-21 12:14:53 -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
Leonardo Balter 813bb5166c
Remove precision-equivalency tests
Due to specs approximation values, some tests are invalid as the harness
helpers rely on another approximated values as Math.LN2.
2016-06-20 17:44:11 -04:00
Leonardo Balter 91d06f50b5 Update esid for Object.getOwnPropertyDescriptors 2016-06-15 18:09:58 -04:00
Leonardo Balter 60e61a15e0 Add tests for Number#toPrecision 2016-06-15 17:59:12 -04:00
Mike Pennisi c0a3b2db7d Relax test for forbidden extension
According to ES2015, functions created using the FunctionDeclaration
syntax may define "own" properties named "caller" and "arguments" as
long as this is done using the AddRestrictedFunctionProperties abstract
operation.

Remove the assertions that prohibit this extension.
2016-06-14 15:26:12 -04:00
Leo Balter 88bc7fe758 Merge pull request #672 from bocoup/spread-coverage
Improve coverage for "spread" operator
2016-06-14 09:47:35 -04:00
Leonardo Balter cfc77c83e3 Update tests for TypedArrays, DataView and ArrayBuffer
Ref tc39/ecma262#410
2016-06-13 16:17:09 -04:00
Mike Pennisi f91886421d Generate tests 2016-06-11 17:44:14 -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
jugglinmike a2b3370b0b Add tests for additional uses of @@toPrimitive (#666) 2016-06-10 15:08:59 -04:00
jugglinmike ee7496f713 Add tests for usage of IsArray (#667) 2016-06-10 15:07:40 -04:00
jugglinmike 01fe0d331b Add tests for Annex B `Object.prototype` methods (#626) 2016-06-08 12:41:26 -04:00
jugglinmike f1c9cef154 Add test for NaN in OrdinaryDefineOwnProperty (#648)
These semantics are currently contested, but the test reflects the
intended behavior of the latest version of the specification.
2016-06-08 12:40:39 -04:00
Zibi Braniecki aeb88953f0 Add tests for Intl.getCanonicalLocales 2016-06-07 14:52:04 -04:00
jugglinmike 07dcff3e27 Add tests for CreateByeDataBlock (#663)
Ensure that all bytes of newly-created Data Block are initialized to
zero.
2016-06-03 12:38:03 -04:00
jugglinmike 30fa3b36d0 Add tests for object coercion of Reference base (#646)
Occurs that when a PutValue or GetValue operation is applied to a
property reference with a primitive base, the base is first coerced to
an Object.
2016-06-03 10:56:59 -04:00
Leonardo Balter c7f9b12cc4 Add tests for Array.prototype.includes 2016-06-01 15:35:00 -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
jugglinmike 30d4c04182 Improve test coverage for Symbol (#645) 2016-05-30 16:55:45 -04:00
jugglinmike a12e271269 Add tests for RegExp.prototype.compile (#632) 2016-05-30 16:52:04 -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
Leonardo Balter f912927b1f [TypedArrays] Apply code consistency fixes after checks with JSHint 2016-05-27 15:59:14 -04:00
Mike Pennisi 88879de735 Generate tests 2016-05-25 17:29:27 -04:00
Mike Pennisi c24a206511 Re-format destructuring assignment tests
Utilize the test generation tool to increase coverage of destructuring
assignment semantics. Previously, only destructuring assignment in the
AssignmentExpression position was tested. With this change applied, the
same tests will assert expected behavior for destructuring assignment in
`for..of` statements, as well.

A limited number of tests are applied to the `for..in` statement as
well, but due to the iteration protocol observed by that statement, many
destructuring tests are not relevant, and others cannot be automatically
generated from this format.
2016-05-25 13:47:06 -04:00
Leonardo Balter 56b988883e Add tests for %TypedArray%.prototype.includes 2016-05-25 10:31:55 -04:00
Leonardo Balter d3effa125f Add tests for DataView.prototype.setUint32 2016-05-25 10:28:01 -04:00
Leonardo Balter d672cf24ea Add tests for DataView.prototype.setUint16 2016-05-25 10:28:00 -04:00
Leonardo Balter ab494e1e32 Add tests for DataView.prototype.setUint8 2016-05-25 10:28:00 -04:00
Leonardo Balter 88f427b4b9 Add tests for DataView.prototype.setInt32 2016-05-25 10:28:00 -04:00
Leonardo Balter a9b65bdf2d Add tests for DataView.prototype.setInt16 2016-05-25 10:28:00 -04:00
Leonardo Balter 138f8b1fdb Add tests for DataView.prototype.setInt8 2016-05-25 10:27:59 -04:00
Leonardo Balter 1b64789ce0 Add tests for DataView.prototype.setFloat64 2016-05-25 10:27:59 -04:00
Leonardo Balter da67e6b305 Add tests for DataView.prototype.setFloat32 2016-05-25 10:25:05 -04:00
Leonardo Balter bc42c6ab5c Add harness for byte conversion values
Update testTypedArrayConversions to require byteConversionValues
2016-05-25 10:10:50 -04:00
Leo Balter 28e707e367 Merge pull request #631 from bocoup/annex-b-date
Add tests for Annex B extns to Date.prototype
2016-05-19 20:20:36 -04:00
jugglinmike 2c33050732 Add tests for Annex B String.prototype.substr (#628) 2016-05-19 20:18:20 -04:00
jugglinmike c6b0864d2b Extend tests for Annex B String HTML methods (#627)
- Add tests for abrupt completion handling from ToString operations
- Add tests for method property descriptors
- Remove redundant assertion
2016-05-19 20:16:21 -04:00
Leo Balter 230dee1676 Merge pull request #585 from bocoup/generation-spread
Add tests for the spread operator (procedurally generated)
2016-05-19 18:15:48 -04:00
Mike Pennisi 18a2ba862d Generate tests 2016-05-19 15:09:41 -04:00
jugglinmike c6a152558d Add tests for Annex B extn: __proto__ in obj init (#633) 2016-05-19 13:01:07 -04:00
jugglinmike a0ddf7bfe4 Add tests for generator intrinsic default proto (#636) 2016-05-19 12:54:49 -04:00
Leonardo Balter 9565f013ce Add tests for DataView.prototype.getUint8 2016-05-19 12:12:13 -04:00
Leonardo Balter 1567b685e2 Add tests for Dataview.prototype.getInt8 2016-05-19 12:12:12 -04:00
Leonardo Balter 5e767dc2bb Add tests for DataView.prototype.getUint16 2016-05-19 12:12:12 -04:00
Leonardo Balter 673b63e83d Add tests for DataView.prototype.getInt16 2016-05-19 12:12:12 -04:00
Leonardo Balter 7f8e559cda Add tests for DataView.prototype.getUint32 2016-05-19 12:12:11 -04:00
Leonardo Balter 0d5b6ea20c Add tests for DataView.prototype.getInt32 2016-05-19 12:12:10 -04:00
Leonardo Balter c1cdf88281 Add tests for DataView.prototype.getFloat64 2016-05-19 12:12:10 -04:00
Leonardo Balter 47b323cf89 Add tests for DataView.prototype.getFloat32 2016-05-18 19:07:34 -04:00
Leonardo Balter 89c0a952fd Add tests for DataView.prototype.byteOffset 2016-05-18 18:58:04 -04:00
Leonardo Balter 339a3527c9 Add tests for DataView.prototype.byteLength 2016-05-18 18:58:04 -04:00
Leonardo Balter 7b529f00cb Add tests for DataView.prototype.buffer 2016-05-18 18:58:04 -04:00
jugglinmike 332be5b8bc Correct test for NaN canonicalization (#640)
Because implementations are free to select any valid NaN value during
GetValueFromBuffer, tests concerning semantics for consistent NaN value
encoding cannot rely on values returned from that abstract operation.

Update the test for `%TypedArray%.prototype.map` to set the same NaN
values via `map` as set in the "control" array.
2016-05-17 14:30:53 -04:00
jugglinmike d8f1b92cf4 Add tests for Annex B extn: O.p.__proto__ (#625) 2016-05-16 13:53:43 -04:00
jugglinmike cb40133425 Add tests for Annex B extns to global object (#624)
Extend tests for the `escape` and `unescape` built-ins to assert their
behavior. Rely on the latest ECMAScript draft, which specifies that
`escape` returns hexadecimal codes in upper case.
2016-05-16 13:53:30 -04:00
Leonardo Balter ee5356b86a Add tests for the DataView constructor 2016-05-16 09:50:04 -04:00
Leonardo Balter 3af3af3d40 Add tests for ArrayBuffer.prototype.byteLength 2016-05-12 10:30:17 -04:00
Leonardo Balter a0cd3b07fc Add tests for TypedArrays sort 2016-05-12 10:26:42 -04:00
Leonardo Balter 2c7c989439 Add tests for TypedArrays set 2016-05-12 10:19:58 -04:00
jugglinmike b17ffc0298 Add tests for NaN handling with Typed Arrays (#623)
Ensure that NaN values are canonicalized consistently by all invocations
of SetValueInBuffer. Also ensure that `%TypedArray%.prototype.set` and
`%TypedArray%.prototype.slice` preserve the bit-level encoding of the
source data.

Use a set of experimentally-derived expressions known to produce NaN
values with distinct bit patterns in various platforms.
2016-05-12 10:16:03 -04:00
Mike Pennisi 37b3e7c080 Add tests for Date.prototype.getYear 2016-05-11 10:34:23 -04:00
Mike Pennisi 1a66e812c8 Add tests for Date.prototype.setYear 2016-05-11 10:34:22 -04:00
Mike Pennisi 018ad2110d Streamline tests for Date.prototype.toGMTString
Introduce a test that asserts the equality of
`Date.prototype.toGMTString` and `Date.prototype.toUTCString`, rendering
further tests for the former's behavior unnecessary.
2016-05-11 10:16:39 -04:00
Mike Pennisi d4b263ccbb Generate tests 2016-05-10 11:57:37 -04:00
Mike Pennisi 43bce311db Add tests for Annex B extns to RegExp patterns
Remove previously-existing tests in favor of new versions that are more
complete and more appropriately named.
2016-05-10 10:38:04 -04:00
jugglinmike d9d3f7cf4f Update RegExp tests (#614)
The RegExpBuiltinExec internal operation was modified in March of 2016
[1]: instead of referencing the `global` and `sticky` properties of the
"this" value, the algorithm now infers those values from the object's
[[OriginalFlags]] internal slot.

This change invalidated a number of tests. In cases where the change
resulted in an observable behavior, update the tests to assert the
latest specification text. In cases where the change removed a
previously-observable behavior, remove the files completely.

Specification text change set:

>        1. Assert: Type(_S_) is String.
>        1. Let _length_ be the number of code units in _S_.
>        1. Let _lastIndex_ be ? ToLength(? Get(_R_, `"lastIndex"`)).
>      - 1. Let _global_ be ToBoolean(? Get(_R_, `"global"`)).
>      - 1. Let _sticky_ be ToBoolean(? Get(_R_, `"sticky"`)).
>      + 1. Let _flags_ be the value of _R_'s [[OriginalFlags]] internal slot.
>      + 1. If _flags_ contains `"g"`, let _global_ be *true*, else let _global_ be *false*.
>      + 1. If _flags_ contains `"y"`, let _sticky_ be *true*, else let _sticky_ be *false*.
>        1. If _global_ is *false* and _sticky_ is *false*, let _lastIndex_ be 0.
>        1. Let _matcher_ be the value of _R_'s [[RegExpMatcher]] internal slot.
>      - 1. Let _flags_ be the value of _R_'s [[OriginalFlags]] internal slot.
>        1. If _flags_ contains `"u"`, let _fullUnicode_ be *true*, else let _fullUnicode_ be *false*.
>        1. Let _matchSucceeded_ be *false*.
>        1. Repeat, while _matchSucceeded_ is *false*

[1] https://github.com/tc39/ecma262/pull/494
2016-05-09 19:34:52 -04:00
jugglinmike f7a61edc6f Add tests for Annex B extns to numeric literals (#608) 2016-05-09 18:31:23 -04:00
jugglinmike db8ff7cc01 Add tests for Annex B extns to comments (#612) 2016-05-09 18:29:18 -04:00
Leonardo Balter bace781a5b Add tests for TypedArrays slice 2016-05-09 17:27:56 -04:00
Ian Halliday 022888be9e Remove duplicate front matter keys (#621)
Fixes #620
2016-05-06 13:41:33 -04:00
jugglinmike aebf3d63bc Add tests for Annex B extns to string literals (#610)
This change set does not include a test for restrictions relating to
template literals because such a test already exists in the project.

While a form of this test for string literals in strict mode code
existed previously, it is less precise and relies on unrelated
semantics. Remove the previous form and replace with a more direct
version.
2016-05-06 11:19:09 -04:00
Leonardo Balter ba31c4da9c s/interaction/iteration on TypedArray.prototype methods 2016-05-06 09:51:08 -04:00
Leonardo Balter dfbf33b3ac Add tests for TypedArrays reduce and reduceRight 2016-05-06 09:50:51 -04:00
Leonardo Balter 800300e120 Add tests for TypedArrays reverse 2016-05-05 16:59:25 -04:00
Leonardo Balter 19c09e95d9 Add tests for TypedArrays join 2016-05-05 16:59:25 -04:00
Leonardo Balter e6f4b20834 Add tests for TypedArrays filter 2016-05-05 15:16:26 -04:00
jugglinmike 4980fd264e Add tests for ArraySpeciesCreate (#600)
Assert the expected behavior of the ArraySpeciesCreate abstract
operation in the 5 Array instance methods from which it is invoked.

This change set does not include tests for ECMAScript realm
considerations because Test262 does not currently expose a mechanism for
interfacing with realms.
2016-05-03 12:42:38 -04:00
Gorkem Yakin 832365f9c2 Merge pull request #565 from bocoup/modules-namespace
Add tests for module namespace objects
2016-04-29 14:26:05 -07:00
Gorkem Yakin 583a83c202 Merge pull request #563 from bocoup/modules-eval
Module semantics: evaluation
2016-04-29 14:26:01 -07:00
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