Commit Graph

898 Commits

Author SHA1 Message Date
André Bargull 2bc08d0b0b Fix some strict mode errors in built-ins/Object
- Add missing "var" declarations and noStrict flags
- Remove invalid noStrict flags
- ietestcenter tests need fixed, require updates to use propertyHelper.js

Part of issue #35.
2015-04-29 17:41:42 +02:00
André Bargull 81a7177ff1 Fix strict mode errors in built-ins/Number
Add missing "var" declarations and noStrict flags.

Part of issue #35.
2015-04-29 17:41:08 +02:00
André Bargull 76a7c8107b Fix strict mode errors in built-ins/Math
Add missing "var" declarations.

Part of issue #35.
2015-04-29 17:40:30 +02:00
André Bargull 0952011501 Fix strict mode errors in built-ins/Function
Add missing "var" declarations and noStrict flags.

Part of issue #35.
2015-04-29 17:39:10 +02:00
André Bargull a5e793f7f3 Fix strict mode errors in built-ins/Error
Add missing "var" declarations and noStrict flags.

Part of issue #35.
2015-04-29 17:38:38 +02:00
André Bargull 07fa78d677 Fix strict mode errors in built-ins/Date
Add missing "var" declarations and noStrict flags.

Part of issue #35.
2015-04-29 17:37:58 +02:00
André Bargull 9cb5292c71 Fix strict mode errors in built-ins/Boolean
Add missing "var" declarations and noStrict flags.

Part of issue #35.
2015-04-29 17:37:09 +02:00
André Bargull 74dde3e483 Fix strict mode errors in built-ins/Array
- Add missing "var" declarations and noStrict flags
- Move code which requires non-strict semantics from Array.prototype.find_this-arg.js to Array.prototype.find_this-arg-receiver-primitive.js
- Remove duplicate code from Array.prototype.findIndex_this-arg.js, already present in Array.prototype.findIndex_this-arg-receiver-primitive.js
- Remove test code from Array.of_assignment-to-new-object-length.js, does not work in strict mode

Part of issue #35
2015-04-29 17:36:28 +02:00
Brian Terlson 87fd4e5699 Merge pull request #240 from anba/es2015-compat-updates
Update remaining tests for ES2015 compatibility (rev38)
2015-04-27 12:55:26 -07:00
André Bargull ef8f056a76 Update remaining tests for ES2015 compatibility (rev38)
- Duplicate properties are allowed in object literals: test/language/expressions/object/*.js
- RegExpBuiltinExec was changed to use ToLength(lastIndex): test/built-ins/RegExp/prototype/exec/S15.10.6.2_A5_T3.js
- Non-undefined flags arguments allowed in RegExp constructor call: test/built-ins/RegExp/*.js
- Array.prototype.push throws TypeError if new length exceeds Number.MAX_SAFE_INTEGER: test/built-ins/Array/prototype/push/S15.4.4.7_A2_T2.js
- .length property of bound functions is configurable: test/built-ins/Function/prototype/bind/15.3.4.5-15-2.js
- Array.prototype changed back to exotic Array object: test/built-ins/Array/prototype/*.js, test/built-ins/Array/isArray/15.4.3.2-0-5.js
2015-04-27 18:21:34 +02:00
André Bargull e31ae1ad9f Invalid language tests
- in-statement-position-label-statement.js is an Annex-B test (B.3.2 Labelled Function Declarations), moved to annexB directory
- identifier-let-allowed-as-lefthandside-expression-strict.js needs to check for a SyntaxError (ES6, 12.1.1)
- Remove sort() calls in test/built-ins/Object/getOwnPropertyNames/*.js
- Remove sort() calls in test/language/block-scope/syntax/for-in/acquire-properties-from-*.js
- verifyConfigurable() needs to called last in test/built-ins/Object/is/length.js
- All productions within ClassBody are implicitly strict, update test/language/class/method-definition/yield-as-*.js accordingly
- Remove unnecessary noStrict flag in test/language/class/method-definition/yield-as-generator-method-binding-identifier.js
- Check own symbols are returned in property creation order from Object.getOwnPropertySymbols():
  - test/language/computed-property-names/basics/symbol.js
  - test/language/computed-property-names/class/method/symbol.js
  - test/language/computed-property-names/class/static/method-symbol.js
  - test/language/computed-property-names/object/method/symbol.js
- Fix copy-paste error in test/language/expressions/object/method-definition/yield-as-function-expression-binding-identifier.js
2015-04-27 16:56:19 +02:00
unknown 81476bb910 fixing a typo 2015-04-24 12:32:17 -07:00
Rick Waldron b3cbeaacb7 19.1.2.10 Object.is
7.2.9 SameValue(x, y)
2015-04-21 14:25:53 -04:00
Mike Pennisi e8cc40a0a8 Import tests from Google V8 (native iterators)
These tests are derived from the following files within the Google V8
project:

    test/mjsunit/es6/typed-array-iterator.js
    test/mjsunit/es6/arguments-iterator.js
    test/mjsunit/es6/string-iterator.js
    test/mjsunit/es6/collection-iterator.js
2015-04-20 19:15:34 -04:00
Brian Terlson 5eb76070cb Merge pull request #219 from Yaffle/patch-1
More tests for Math.round
2015-04-18 15:58:11 -07:00
Brian Terlson 43a238bc0b Merge pull request #197 from bocoup/harmony-symbols
Import tests from Google V8 (Symbol)
2015-04-18 15:49:46 -07:00
Brian Terlson a6ca558d46 Merge pull request #218 from bocoup/templates
Import tests from Google V8 (templates)
2015-04-18 15:46:34 -07:00
Caitlin Potter f398421ee7 Add tests for %FunctionPrototype% restricted properties 2015-04-11 20:46:27 -04:00
Brian Terlson 01bdfa6dd3 Merge pull request #209 from anba/issue-185,186/annexb-extensions
Don't use Annex B extensions in main test suite
2015-04-08 16:08:04 -07:00
Brian Terlson 3f04481646 Merge pull request #208 from anba/issue-103/array-find-update
Array.prototype.find does not skip holes
2015-04-08 16:07:24 -07:00
Brian Terlson 193605524e Merge pull request #205 from caitp/patch-1
Add a test for String.prototype.concat() with single Object argument
2015-04-07 17:31:53 -07:00
Rick Waldron 59e2a7ac57 Import tests from Google V8 (Symbol)
These tests are derived from the following files within the Google V8 project:

	test/mjsunit/harmony/private.js
2015-04-07 16:53:18 -04:00
Rick Waldron d797bb979e Import tests from Google V8 (Array.prototype.{fill, find, findIndex}, Array.{from, of})
These tests are derived from the following files within the Google V8 project:

    	test/mjsunit/harmony/array-fill.js
    	test/mjsunit/harmony/array-find.js
    	test/mjsunit/harmony/array-findindex.js
    	test/mjsunit/harmony/array-from.js
    	test/mjsunit/harmony/array-of.js
2015-04-07 09:53:17 -04:00
Viktor b7bfcb4bd2 More tests for Math.round
Seems, Math.round(x) is implemented as `Math.floor(x + 0.5)` in some JavaScript engines.
The "Note 2 for Math.round"  was fixed for ES6 (see http://es5.github.io/#x15.8.2.15 and https://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.round )
2015-04-04 11:36:57 +05:00
Mike Pennisi 1f22932d69 Import tests from Google V8 (templates)
These tests are derived from the following files within the Google V8
project:

    test/mjsunit/es6/templates.js

Some of these tests include non-printable characters, causing git to
infer that they are binary files. Introduce a `.gitattributes` file to
configure git to consistently display the source text of all JavaScript
files.
2015-04-02 12:13:51 -04:00
André Bargull a7192a9ea5 Don't use Annex B extensions in main test suite
Fixes #185
Fixes #186
2015-03-23 19:29:25 +01:00
André Bargull 73a8a7dcf9 Array.prototype.find does not skip holes
Fixes #103
2015-03-23 19:15:16 +01:00
⭐caitp⭐ 9a37120014 Add a test for String.prototype.concat() with single Object argument
v8 would fail this test, so it would be nice to have it
2015-03-23 10:15:09 -04:00
Brian Terlson fb6eb7ce18 Merge pull request #154 from bocoup/harmony-array-concat
Import tests from Google V8 (Array isConcatSpreadable)
2015-03-18 16:07:34 -07:00
Brian Terlson 2e1813622f Merge pull request #188 from smikes/Symbol-species
Symbol.species tests
2015-03-18 10:59:48 -07:00
smikes e1f3ffce2c Symbol.species tests
Initial tests for property existence
move getter name test to builtin-getter-name
initial cut at extends test
incorporate line notes, thanks @anba
2015-03-09 15:48:52 -06:00
Brian Terlson 42dc0f6b35 Merge pull request #165 from bocoup/iterators
Add Array Iteration Tests
2015-03-06 13:31:56 -08:00
Mike Pennisi 6565c89de2 Import tests from Google V8
These tests are derived from the following files within the Google V8
project:

    test/mjsunit/es6/array-iterator.js
2015-03-06 14:13:36 -05:00
Rick Waldron 1182adb9bc Import tests from Google V8 (Array isConcatSpreadable)
These tests are derived from the following files within the Google V8 project:

    	test/mjsunit/harmony/array-concat.js
2015-03-04 20:01:21 -05:00
smikes cc18dd2d79 2 new tests re: foreign thenables 2015-02-17 18:27:34 -07:00
Brian Terlson 8eb0bd1279 Merge pull request #162 from bocoup/146
Move test/built-ins/Promise/prototype/resolve/ to test/built-ins/Promise...
2015-02-17 12:30:50 -08:00
Brian Terlson 3e45af7d72 Merge pull request #163 from bocoup/145
Move test/built-ins/Promise/prototype/race/ to test/built-ins/Promise/ra...
2015-02-17 12:30:42 -08:00
Rick Waldron 849cea38a5 Move test/built-ins/Promise/prototype/reject/ to test/built-ins/Promise/reject/ Closes gh-161 2015-02-17 13:34:48 -05:00
Rick Waldron d9554f9fca Move test/built-ins/Promise/prototype/race/ to test/built-ins/Promise/race/. Closes gh-145 2015-02-17 13:33:34 -05:00
Rick Waldron 4e5be1f257 Move test/built-ins/Promise/prototype/resolve/ to test/built-ins/Promise/resolve. Closes gh-146 2015-02-17 13:31:28 -05:00
Rick Waldron cda3ec74a1 ES6-specific tests: es5id=>es6id, new es6id entries. Closes gh-144 2015-02-12 16:36:13 -05:00
André Bargull e12917af66 Update comments in Object.defineProperties tests (Fixes #138)
The expected values were already changed in a previous commit (@49abae4f5e6b38931d86dc9b9d34ae30d9ced2ca),
only the test descriptions still needed to be updated. (Fixes #138)
2014-12-11 19:00:15 +01:00
smikes 49abae4f5e rework: remove *PropertyAttributes fns
- this change hits all files that use
dataPropertyAttributesAreCorrect or
acccessorPropertyAttributesAreCorrect

Major changes:
- remove include of runTestCase.js,
dataPropertyAttributesAreCorrect.js and
acccessorPropertyAttributesAreCorrect.js
- add include of propertyHelper.js
- remove function testCase() and call to
function runTestCase()
- instead of collecting test state into booleans,
which are eventually returned from runTestCase,
test conditions and throw errors immediately
- use negative: to check error types instead of
using `instanceof` in a catch() block

Selected commit logs follow:

manual conversion of accessorPropertyAttributesAreCorrect() test
 - remove runTestCase
 - remove wrapping testCase function
 - unindent
 - remove includes of runTestCase & accessor...
 - add include of propertyHelper.js
 - unpack final two args 'true, false' to explicit inline
   tests of isEnumerable and isConfigurable
 - unpack setter test into inline logic
 - unpack getter test into inline logic

used script to replace includes: frontmatter
with propertyHelper.js ; manually added back
references to fnGlobalObject() where needed

additional helper functions

add helper functions for get and writable
duplicate runTestCase so can remove runTestCase.js from
includes of all tests in batch

use keyboard macros to simplify repetitive conversions
remove auto-save file accidentaly committed

minor changes, manually remove runTestCase from remaining files
lint etc. fixes

remove now-obsolete harness files

make strict/nonstrict variants

tests where behavior is different in strict/nonstrict
need two variants

- strict mode throws on assign to read-only element (no setter fn)
- strict mode separates named arguments from arguments[]

fix indentation

cleanup minor issues

reviewing 15.2.3.7-9 tests, found some minor issues

- indentation/spacing
- duplicate test (eg, direct test of value and dataProp...)
- remove needless try/finally
- use assert.. helpers in place of if(is..
- rename some assertions to 'e'

rename assertX to verifyX
new helper fn sameValue
test "set" as well as get
reverse order of checks
restore test of desc2
restore test of length
restore test of ownProperty
incorporate suggestions re order of ops, Object.prototype
add test of sameValue helper
restore return value in getter
restore second defineProperty call
restore check of explicit "false"
restore explicit test of TypeError
set noStrict flag on arguments changes
rename catch var to "e"	b4ad0e6
remove dataPropertyAttributesAreCorrect from tests	0d83ff2
remove accessorPropertyAttributesAreCorrect from tests	bb926f3
remove {data,accessor}Property... fns from harness

fix writable check on array.length

call $ERROR if expected exception not thrown
fix Epected => Expected typo

use assert._isSamevalue
2014-12-10 17:39:16 -08:00
smikes 5318ee7b1f minor fixes to Array.protoype.find tests
split "this" tests into strict/nonstrict branches
split callable into separate test cases

metadata: rename es6 to features
2014-12-10 16:53:12 -08:00
Sam Mikes 485059c46d initial tests of Array.prototpe.splice requiring settable "length"
add test of object with only "length" getter
*fix typo

per comments from @anba, thanks!
 * remove needless checks
 * add "splice" method

fix es5id
2014-12-10 15:18:42 -08:00
Mathias Bynens e2aa196a93 Rename `String.prototype.contains` to `String.prototype.includes` 2014-12-10 13:27:42 -08:00
Juan Ignacio Dopazo d863423d1a Array.prototype.find no longer skips holes 2014-12-09 18:37:41 -08:00
Brian Terlson 2a74f0ec1b Reorganize ./test 2014-12-07 15:33:09 -08:00