2898 Commits

Author SHA1 Message Date
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
Keith Miller
ba93cfa52d Update the toString/proxy.js to test stringifing functions 2016-08-30 14:03:54 -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
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
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
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
Brian Terlson
dbf251586e Add tests for async functions
Closes #479
2016-07-28 15:11:28 -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
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
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
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
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
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
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
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
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
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
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