Commit Graph

1409 Commits

Author SHA1 Message Date
Michael Ficarra a4a1dd551b fix expected raw value for invalid escape sequences in tagged templates (#800) 2016-11-22 11:45:39 -05:00
Kevin Gibbons e6abf652d9 Ensure that tests calling $DONE have the async flag 2016-11-21 10:14:30 -05:00
Dmitry Panov ffd8039386 Replaced tabs with spaces in YAML. 2016-11-19 23:13:26 +00:00
Aleksey Shvayka bef7f988d2 Ensure Proxy [[Get]] and [[Set]] pass correct receiver (#792)
* Ensure Proxy [[Get]] passes correct receiver

* add [[Get]] test for proxy in prototype

* diversify how traps are missing

* ensure [[Set]] passes correct receiver

* rename to match other tests

* remove extra tests

* add esid

* add description
2016-11-17 14:26:34 -08:00
Sathya 84e6ba81d0 Update context-non-object-with-promise.js (#790)
Promise constructor accepts only one executor function
2016-11-15 10:45:03 -08:00
Josh Wolfe 4fd91d8904 fix incorrect tests for trailing commas (#787) 2016-11-11 09:44:38 -08:00
dop251 8982c3c3ab Reformat negative tests metadata (#785) 2016-11-11 09:43:36 -08:00
Henrique Ferreiro d1d91af256 Integer indexed property descriptor must be non-configurable (#786)
* Integer indexed property descriptor must be non-configurable

* Make the configurable key explicitly 'false'
2016-11-11 09:42:01 -08:00
jugglinmike c9569a7e7e Improve coverage for YieldExpression (#681)
* Re-organize coverage for YieldExpression

* Extend test coverge for YieldExpression

* fixup! Extend test coverge for YieldExpression

Remove unused variables
2016-10-24 11:29:56 -07:00
jugglinmike 720c3cc8cc Update for new `eval` restrictions on `super` (#781)
A recent change to the specification [1] introduces parse-time errors
for certain usages of `super` within eval code. Modify all tests that
are affected by this change:

- Update the test bodies to accurately enforce the new semantics
- Rename files to better reflect the section of the specification that
  they enforce
- Update test meta-data
  - Change the `esid` meta-data to reflect the location of the relevant
    specification text
  - Remove the `es6id` meta-data as the behavior is no longer relatable
    to that specification
  - Introduce the `features` meta-data in cases where the test file's
    new location no longer reflects all required language features

[1] "Normative: Clarify rules around super inside eval"
    https://github.com/tc39/ecma262/pull/685
2016-10-24 10:43:44 -07:00
jugglinmike 71e573f7da Add tests for realm interactions (#688)
* Add tests for prototype realm inference

* Add tests for miscellaneous realm concerns

* Add tests for realm of spec-created Errors

In some cases, Error objects produced by the specification are
observable from ECMAScript code. Among these cases, some are further
differentiated in that they occur outside of any built-in function and
may be triggered through syntactic production directly. The current
realm record is commonly interpreted incorrectly under these
circumstances.

Add tests asserting that the expected realm record is used when
constructing such Error objects.

* Add tests for realm use in ArraySpeciesCreate

* Add tests for function realm retrieval

* Add tests for cross-realm behaviors of Symbols

* Add tests for GetValue and PutValue

* Add tests for realm of spec-created Arrays

In some cases, Arrays produced by CreateArrayFromList are observable
from ECMAScript code. Among these cases, two occur outside of any
built-in function and may be triggered through syntactic production
directly. The current realm record is commonly interpreted incorrectly
under these circumstances.

Add tests asserting that the expected realm record is used when
constructing arrays.

* Add test for spec-created object

* fixup! Add tests for realm of spec-created Errors

* fixup! Add tests for realm of spec-created Errors

* fixup! Add tests for prototype realm inference

* fixup! Add tests for miscellaneous realm concerns
2016-10-24 10:43:17 -07:00
Tom Care f39b7cfb7a Merge pull request #701 from bocoup/audit2016-section-25-promises
Extend coverage for Section 25 - Promises
2016-10-20 13:02:49 -07:00
Kevin Gibbons b4c633fc4f Add test for inequality of RegExps created from the same source (#776) 2016-10-20 11:41:31 -07:00
Leo Balter 638c4801e6 Merge pull request #778 from jugglinmike/negative-reform-9
Encode expected error "phase"
2016-10-20 12:59:30 -04:00
Viktor 22f8df2315 Update S15.4.4.11_A7.2.js (#777)
`Array.prototype.sort` should be used instead of `Array.sort`
2016-10-19 14:00:35 -07:00
Mike Pennisi ade6d2e384 Remove "NotEarlyError" object
Because expectations regarding error "phase" are now expressed via test
meta-data, the test runner may now enforce this requirement on negative
tests.

Remove the "NotEarlyError" from the project source. This reduces the
amount of domain knowledge required to author tests and lessens the
potential for inconsistencies between tests.
2016-10-19 15:24:22 -04:00
Mike Pennisi 7d4b1d28ae Re-format tests for SyntaxErrors
Authored via the following command:

   $ find test -type f -print0 | \
       xargs -0 sed \
         -i 's/^\(\s*\)negative:\s*SyntaxError\s*$/\1negative:\n\1  phase: early\n\1  type: SyntaxError/g'
2016-10-19 15:24:21 -04:00
Mike Pennisi cdc62ce0fa Re-generate tests 2016-10-19 15:24:20 -04:00
Mike Pennisi 0c29e6de86 Reformat miscellaneous negative tests
The expected errors in these tests cannot be asserted with the
`assert.throws` helper function for various reasons. Re-format their
meta-data according to the latest design in order to more precisely
describe test expectations.
2016-10-19 15:24:19 -04:00
Mike Pennisi 203b234fc0 Reformat negative SyntaxError tests (runtime)
These tests specifically concern error produced from the global scope,
precluding the use of the `assert.throws` helper function.
2016-10-19 15:24:18 -04:00
Mike Pennisi d5a3a962b2 Reformat negative ReferenceError tests 2016-10-19 15:24:18 -04:00
Mike Pennisi 24e774251a Test runtime errors with assertion utility method
Improve test consistency by using the `assert.throws` helper function to
assert runtime exceptions. Remove superfluous code.
2016-10-18 14:36:14 -04:00
Joseph Pecoraro fb61ab44eb Fix incorrect generator syntax (#761) (#762) 2016-10-14 15:58:46 -07:00
Leo Balter febb11b249 Revert "islamicc should be canonicalized to islamic-civil (#747)" (#774)
This reverts commit da4f4385fd.
2016-10-14 11:05:41 -07:00
jugglinmike b9d6fec9ac Correct name of fixture file (#775)
The file previously named `values-binding-types_.js` is not intended to
be interpreted as a test. Therefor (in accordance with the project's
`INTERPETING.md` file), its name should include `_FIXTURE` as a suffix.
2016-10-14 11:04:47 -07:00
Leo Balter 8c67edab05 Fix invalid yaml on tests for global (#772) 2016-10-07 10:34:11 -07:00
Henrique Ferreiro 0651a7fad1 setPrototypeOf returns 'true' if called with the target's prototype (#768) 2016-10-05 13:25:35 -04:00
Tim Disney 9d8d8b6920 Add tests to handle revised template literals (#764) 2016-10-03 13:59:53 -07:00
Juan Dopazo b77714514e Add tests for non-optional arguments of Date.UTC() 2016-09-29 13:59:23 -07:00
Jakob Gruber 81f66a5a3a Tests for new lastIndex semantics (#760)
* Tests for new lastIndex semantics

Add and update tests for the lastIndex semantic change introduced in
https://github.com/tc39/ecma262/pull/627.

* Address comments
2016-09-29 10:41:37 -07:00
Jordan Harband be16caa4c8 Add `global` tests. (#765)
Closes #605, relates to #567 / https://github.com/tc39/proposal-global/issues/12 / 9c45e2ac68
2016-09-28 10:53:50 -07:00
jungshik da4f4385fd islamicc should be canonicalized to islamic-civil (#747)
Moves ismalicc test out of main.js and creates a new
test, preferred-subtag.js (per RFC 5646 section 4.5 and
http://www.unicode.org/repos/cldr/tags/latest/common/bcp47/calendar.xml
)

Fix #743
2016-09-12 12:54:55 -07:00
Viktor 29c2384449 Update return-values.js (Number#toExponential bug in Firefox) (#751)
Update test cases for Number#toExponential

Includes test cases addressing a known bug on Firefox 48.

Ref https://bugzilla.mozilla.org/show_bug.cgi?id=944846
2016-08-29 17:33:55 -04:00
Anthony Van de Gejuchte 11d7dcc997 Remove duplicate description keys 2016-08-27 18:55:27 -04:00
jugglinmike 4ffee35d89 Add tests for surrogate pairs with RegExp atoms (#722) 2016-08-25 13:29:51 -07:00
Tom Care b2b4254266 Merge pull request #727 from bocoup/audit2016-section-20-date
Improve coverage for section 20
2016-08-25 10:30:43 -07:00
jungshik fb45ed9772 Test that getCanonicalLocales() returns a mutable object. (#746)
Will fix #745

Besides, add additional checks to make sure that getCanonicalLocales()
returns an array.
2016-08-22 14:25:00 -07:00
Zibi Braniecki cac55f2999 NumberFormat.prototype.formatToParts tests, part 1 (#744) 2016-08-15 15:23:34 -07:00
Michael Ficarra 894bbcc747 add PropertyDefinitionList evaluation order test (#739)
This test is being added because the committee is considering changing
this evaluation order (as discussed at the May 2016 Munich meeting). The
consequences of this spec change will be more clear as a test change
than a simple test addition.
2016-08-12 12:01:43 -04:00
jugglinmike c5cbf4122d Improve coverage for section 9 (#726)
* Assert creation of 'arguments' object

Ensure that the 'arguments' object is created in cases where it is not
required by the body but is required by the parameters.

* Add tests for cases that disable "arguments" map

* Add tests for NewTarget override of bound function

* Add test for properties of exotic String objects
2016-08-05 10:07:02 -07:00
Tom Care 8a6d7a49ee Merge pull request #711 from bocoup/audit2016-section-21-regexp
Improve coverage for section 21: RegExp
2016-08-04 16:22:18 -07:00
Yusuke Suzuki dfd1fb3a97 Fix incorrect value retrieving in module-code test (#741)
Fix language/module-code/namespace/internals/get-own-property-str-found-init.js.
2016-08-04 11:19:36 -04:00
Kevin Gibbons d6580e8b66 Add tests for for-in initializers (#735)
These were re-introduced in sloppy mode per
https://github.com/tc39/ecma262/pull/614
2016-08-02 15:47:39 -04:00
Jordan Harband 55cf59c80d `Object.getOwnPropertyDescriptors`: add test to ensure undefined descriptors are not added. (#662)
Per https://github.com/tc39/ecma262/pull/593
2016-08-01 13:54:53 -04:00
Yusuke Suzuki e2fb909a1d Fix importing filename in module-code/instn-star-err-not-found.js test
Fix the incorrect module filename.
2016-07-30 15:08:26 -04:00
Brian Terlson dbf251586e Add tests for async functions
Closes #479
2016-07-28 15:11:28 -07:00
Jeff Morrison b785fdf942 Tests for trailing commas in function arg lists (#733)
Adds tests for the proposal as described here:
http://jeffmo.github.io/es-trailing-function-commas/
2016-07-28 12:32:03 -07:00
Zibi Braniecki 1bf44eb349 Add DateTimeFormat.prototype.formatToParts tests (#734) 2016-07-28 10:22:09 -07:00
Leo Balter 3275f17cd4 Add tests for Number#toExponential (#664)
* Add tests for Number#toExponential
2016-07-21 10:57:05 -07:00
Tom Care 9ec41dfabd Merge pull request #719 from bocoup/audit2016-section-15
Improve coverage for section 15: Scripts and Modules
2016-07-20 14:28:29 -07:00
jugglinmike b9e21138cc Add tests for script interactions (#689)
ECMA262 allows for an arbitrary number of "ScriptJob"s to run in a given realm.
Although there is no standard mechanism for enqueuing these jobs, many
implementations offer this functionality through custom APIs. In those hosts,
the semantics describing script interactions are directly observable.
In order to guarantee conformance to the specification in advance of a
standardized API, Test262 now requires that hosts provide a $.evalScript
function whose behavior is defined in the project's "INTERPRETING.md" file.
Use this host-provided API to ensure that implementations correctly observe the
specification text that dictates script interactions.
(In writing these tests, I noticed some gaps in coverage that are observable
from a single script execution. This patch includes a dedicated commit for
these tests that do not require $.evalScript.)

* Improve coverage of GlobalDeclarationInstantiation

* Add tests for script interactions

Use the host-provied `$.evalScript` method to assert conformance to the
specification text that defines script interactions.

* fixup! Improve coverage of GlobalDeclarationInstantiation
2016-07-19 18:02:05 -07:00
Tom Care e3ae1c88ff Merge pull request #699 from bocoup/685-range-check
Fix range check tests for DataView#set methods
2016-07-19 14:55:14 -07:00
Leo Balter e8e0fb9d34 Update tests for Proxy.[[SetPrototypeOf]] (#716)
* Update tests for Proxy.[[SetPrototypeOf]]

Expand coverage for proxies' [[SetPrototypeOf]] and update tests to
verify that target's [[IsExtensible]] is not called anymore if trap
returns a falsy value.

Ref tc39/ecma262#331
2016-07-19 14:51:02 -07:00
jugglinmike 2c5138a4c7 Add tests for abrupt completions during JSON.parse (#721)
* Add tests for abrupt completions during JSON.parse

Due to the use of the IsArray abstract operation, observing many of the
targeted semantics requires the use of a Proxy exotic object. Mark the
tests that require this unrelated ES2015 feature using a dedicated
"features" flag.
2016-07-19 14:33:27 -07:00
Tom Care 163fae3e68 Merge pull request #715 from bocoup/audit2016-section-13
Improve coverage for section 13, "Statements and Declarations"
2016-07-12 13:51:15 -07:00
jugglinmike 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