101 Commits

Author SHA1 Message Date
Csaba Osztrogonác
bd1acb51a4 tools: enforce restriction on YAML includes key
Includes key should use flow notation to be able parsed easier
as suggested in https://github.com/tc39/test262/issues/1997

Added this check to the linting script and updated tests accordingly.
2022-01-05 17:27:58 -05:00
Mike Pennisi
6d5975defc Remove duplicated constructor tests
A number of tests were found to be duplicative based on an analysis of
file contents (included below). Eliminate the duplication by removing
the version of each test with less precise metadata. In cases where this
removal could technically be considered a reduction in coverage,
preserve the verification of additional semantics in the remaining test.

    $ git grep -El 'new\s+\w+.prototype' | sed 's/[^\/]\+$//g' | sort | uniq -c | grep -vE '^\s+1 ' | awk '{print $2}' | xargs grep -Elr 'new\s+\w+.prototype'
    test/built-ins/Array/prototype/join/S15.4.4.5_A6.7.js
    test/built-ins/Array/prototype/join/not-a-constructor.js
    test/built-ins/Array/prototype/pop/not-a-constructor.js
    test/built-ins/Array/prototype/pop/S15.4.4.6_A5.7.js
    test/built-ins/Array/prototype/push/S15.4.4.7_A6.7.js
    test/built-ins/Array/prototype/push/not-a-constructor.js
    test/built-ins/Array/prototype/shift/not-a-constructor.js
    test/built-ins/Array/prototype/shift/S15.4.4.9_A5.7.js
    test/built-ins/Array/prototype/slice/not-a-constructor.js
    test/built-ins/Array/prototype/slice/S15.4.4.10_A5.7.js
    test/built-ins/Array/prototype/sort/not-a-constructor.js
    test/built-ins/Array/prototype/sort/S15.4.4.11_A7.7.js
    test/built-ins/Array/prototype/splice/S15.4.4.12_A5.7.js
    test/built-ins/Array/prototype/splice/not-a-constructor.js
    test/built-ins/Array/prototype/toLocaleString/S15.4.4.3_A4.7.js
    test/built-ins/Array/prototype/toLocaleString/not-a-constructor.js
    test/built-ins/Array/prototype/toString/S15.4.4.2_A4.7.js
    test/built-ins/Array/prototype/toString/not-a-constructor.js
    test/built-ins/Array/prototype/unshift/S15.4.4.13_A5.7.js
    test/built-ins/Array/prototype/unshift/not-a-constructor.js
    test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T1.js
    test/built-ins/Function/prototype/apply/S15.3.4.3_A8_T2.js
    test/built-ins/Function/prototype/apply/not-a-constructor.js
    test/built-ins/Function/prototype/call/not-a-constructor.js
    test/built-ins/Function/prototype/call/S15.3.4.4_A7_T2.js
    test/built-ins/Function/prototype/call/S15.3.4.4_A7_T1.js
    test/built-ins/Function/prototype/toString/S15.3.4.2_A7.js
    test/built-ins/Function/prototype/toString/not-a-constructor.js
    test/built-ins/Object/prototype/hasOwnProperty/S15.2.4.5_A7.js
    test/built-ins/Object/prototype/hasOwnProperty/not-a-constructor.js
    test/built-ins/Object/prototype/propertyIsEnumerable/not-a-constructor.js
    test/built-ins/Object/prototype/propertyIsEnumerable/S15.2.4.7_A7.js
    test/built-ins/Object/prototype/toLocaleString/S15.2.4.3_A7.js
    test/built-ins/Object/prototype/toLocaleString/not-a-constructor.js
    test/built-ins/Object/prototype/toString/not-a-constructor.js
    test/built-ins/Object/prototype/toString/not-ctor.js
    test/built-ins/Object/prototype/valueOf/not-a-constructor.js
    test/built-ins/Object/prototype/valueOf/S15.2.4.4_A7.js
2021-12-14 13:38:51 -05:00
legendecas
619afdeab7 Remove unnecessary eval to access realm globals 2021-10-08 14:40:58 -04:00
rwaldron
35ce309dc7 Transform legacy format to harness assertions: test/built-ins/F*/**/*.js 2021-09-02 11:22:11 -07:00
Rick Waldron
6e2a29417a
chore: migrate $ERROR -> throw new Test262Error in test/built-ins/Function (#3083) 2021-07-22 10:31:45 -07:00
Gus Caplan
516ca9af39 Update tests for ECMA262 #2216
https://github.com/tc39/ecma262/pull/2216
2021-02-26 11:49:49 -05:00
ExE Boss
8f904d8cc8 Set function length and name in CreateBuiltinFunction 2021-01-29 09:45:20 -05:00
Rick Waldron
d576baf73f Info: adds "sec-evaluatenew" step to info for all "not-a-constructor.js" tests. 2020-10-06 12:01:34 -04:00
Rick Waldron
8aacff591c Standardize built-in constructor testing 2020-10-06 12:01:34 -04:00
Rick Waldron
c644ede430 Built-in function objects that are not identified as constructors must throw a TypeError exception when new'ed. Fixes gh-1739 2020-10-06 12:01:34 -04:00
Alexey Shvayka
36f73c6142 Add Function.prototype.length property descriptor test 2020-08-20 12:39:28 -04:00
Alexey Shvayka
51fac5f93b Rename & improve large target function "length" test 2020-08-20 12:38:45 -04:00
Alexey Shvayka
8fbe2f82ef Test default value of bound function "length" property 2020-08-20 12:38:45 -04:00
Alexey Shvayka
53d8d9d394 Merge & improve remaining arguments tests 2020-08-20 12:38:45 -04:00
Alexey Shvayka
233ca721f5 Test ToInteger performed on "length" value of target function 2020-08-20 12:38:45 -04:00
Alexey Shvayka
f80d7e7777 Merge & refactor bound function "length" property descriptor tests 2020-08-20 12:38:45 -04:00
Alexey Shvayka
897a05954f Test "length" property descriptor of Function.prototype.bind 2020-08-20 12:38:45 -04:00
Gus Caplan
5f99d05c6a native function validator for your consideration 2020-08-04 19:44:31 -04:00
Gus Caplan
156186aee2 New NativeFunction tests 2020-08-04 19:44:31 -04:00
QuXing9
91a9abff4e
Add three testcases for test262 suite. (#2692)
* Add tests for escape function when parameter is not a string.

Fixes #2687
Fixes #2637

* Add test for indirect eval calls  when script is a for statement.

When for statement doesn't have a body, it should throw a SyntaxError.

Fixes #2661

* Add tests for Function Constructor when body contains usestrict.

Fixes #2688
Fixes #2638
2020-07-09 09:57:55 -07:00
Alexey Shvayka
43bc9f1465 Add Function test 2020-04-26 16:19:25 -04:00
Alexey Shvayka
fe0d4dc781 Fix bound function tests 2020-04-23 10:31:12 -04:00
Ross Kirsling
df7a0b0c89 Remove errant LF from CR line ending test again. 2020-03-02 13:38:35 -05:00
Gus Caplan
a53f43e1ce
add missing newlines in tests 2019-11-10 20:18:56 -08:00
Leo Balter
e2903e2648
Merge pull request #2366 from bocoup/unnecessary-includes
Remove unnecessary "includes" directives
2019-09-27 16:46:22 -04:00
Mike Pennisi
9cd62ffbd7 Improve coverage: ctor props of the global object
Prior to this commit, the descriptors of the constructor properties of
the global object were verified inconsistently, many independent
assertions occured in the same file, and that file test was poorly
located.

Restructure the relevant tests to improve coverage, follow convention,
and promote discoverability.
2019-09-27 15:39:10 -04:00
Mike Pennisi
f26c2a11bd Remove unnecessary "includes" directives
The values defined by the referenced files are not used by these tests.
This makes their inclusion superfluous, which needlessly increases the
time to execute the tests and may confuse some readers.
2019-09-25 13:59:24 -04:00
Caio Lima
fbbab61b4a Adding cases to check if SyntaxError is thrown if AllPrivateIdentifiersValid returns false. (#2301) 2019-08-28 14:58:43 -03:00
Kubilay Kahveci
9b29709797 Add tests for .toString() of private methods (#2268) 2019-08-05 16:47:19 -04:00
Leo Balter
ff9763729d Remove duplicated es[56]id if esid is present 2019-08-05 10:54:37 -04:00
Alexey Shvayka
df1a1c75b7 Remove trailing spaces from YAML blocks (#2201) 2019-06-19 16:39:21 -04:00
Aleksey Shvayka
6f4c0d96f7 Improve GetFunctionRealm coverage (#2155)
* Fix Function.prototype.bind test

* Simplify Proxy test

* Info tweaks

* Add Function.prototype.bind recursive test

* Add Proxy recursive test
2019-05-22 18:11:49 -04:00
Aleksey Shvayka
5a725fe122 Expect TypeError from correct realm 2019-05-15 21:29:11 +03:00
Aleksey Shvayka
b6cc89c61d Add abrupt completion tests 2019-05-15 03:28:33 +03:00
Aleksey Shvayka
8551382805 Add cross-realm "this not callable" test 2019-05-15 01:37:52 +03:00
Aleksey Shvayka
385848d449 Rename & merge "this not callable" tests 2019-05-15 01:36:22 +03:00
Aleksey Shvayka
9c93e05d90 Unify "length" tests 2019-05-15 00:01:29 +03:00
Aleksey Shvayka
6943b289fc Add cross-realm "argArray not object" test 2019-05-14 23:07:27 +03:00
Aleksey Shvayka
171b3ef083 Rename & merge "argArray not object" tests 2019-05-14 23:07:23 +03:00
Kevin Gibbons
8ed9947df1 add async-iteration flag (#1942) 2018-11-08 15:32:40 -05:00
Adrian Heine né Lang
0475c127c4 Fix some generators feature flags (#1933) 2018-11-07 17:51:23 -05:00
André Bargull
b552dad5cb Various test cases for cross-browser compliance bugs 2018-05-03 09:27:27 -07:00
Rick Waldron
c55d2ab7c3 Extensive Function toString updates for "Function.prototype.toString revision" proposal. (#1510)
Fixes gh-1453
2018-04-19 16:44:52 -04:00
Ross Kirsling
a7b2d07a94 Remove errant LF from CR line ending test. 2018-04-05 23:32:25 -07:00
Michael Ficarra
3207bf74d0 Function.prototype.toString works on symbol-named built-ins 2018-03-07 14:09:45 -05:00
Michael Ficarra
f3b8aff71f Function.prototype.toString works on anonymous well-known intrinsics 2018-03-07 14:09:45 -05:00
Michael Ficarra
7d5a5fef36 add Function.prototype.toString result for callable proxies 2018-03-07 14:09:45 -05:00
Michael Ficarra
83ffb4bbf2 allow any function to report its toString as a NativeFunction
related: https://github.com/tc39/Function-prototype-toString-revision/pull/26
2018-03-07 14:09:45 -05:00
Valerie R Young
d807e8fa96 Update Function/prototype/toString 'esid: pending' frontmatter 2018-02-22 13:34:08 -05:00
Rick Waldron
1b30a976e8 built-ins/Function/*: make all indentation consistent (depth & character) (#1424)
This intentionally skips test/built-ins/Function/prototype/toString/*
2018-02-15 15:49:19 -05:00