Commit Graph

23 Commits

Author SHA1 Message Date
Philip Chimento d87a7da6e1 Replace Object.hasOwnProperty.call with Object.prototype.hasOwnProperty.call
While we're at it, use assert() instead of assert.sameValue() for brevity,
if we are not specifically testing that the return value of hasOwnProperty
is the value true or false; and add more informative assertion messages to
help with debugging.

In some cases, the Object.hasOwnProperty.call could be replaced with
verifyProperty(), if the property descriptor was also being verified at
the same time.

This fixes some tests that were faulty to begin with: a common mistake was
Object.hasOwnProperty(obj, prop) which is probably going to return false
when that's not what you want.

The only instances left of `Object.hasOwnProperty` are one regression test
in implementation-contributed which I can't tell if it was intentionally
needed to trigger the regression, and a few instances of
`Object.hasOwnProperty('prototype')` which would defeat the purpose to
convert into `Object.prototype.hasOwnProperty.call(Object, 'prototype')`
form.

Closes: #3524
2022-11-30 16:04:02 -08:00
rwaldron e6b47d7738 chore: update src/**/*.case to use assert.compareArray wherever applicable 2021-10-01 16:38:56 -04:00
Mike Pennisi d9ddf80479 Revert "Merge pull request #3219 from tc39/rwaldron/migrate-comparearray"
This reverts commit b690cb67be, reversing
changes made to 50dd431dff. This is
necessary because the reverted changeset reduced coverage by an unknown
extent.
2021-10-01 10:18:47 -04:00
rwaldron d7414a8d8e chore: update src/**/*.case to use assert.compareArray wherever applicable 2021-09-24 11:21:44 -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
Leo Balter 0304c66440 Make the folder names consistent 2018-12-21 15:47:01 -05:00
Leo Balter b8d43a3982 More reorganization for the class folder 2018-12-21 15:47:01 -05:00
Mathias Bynens b9daa57dcb Rename to $DONOTEVALUATE per @leobalter's suggestion 2018-10-23 13:51:17 +02:00
Mathias Bynens e3feffb01e Move `throw "…"` for negative parsing errors to a helper function
Closes #1634.
2018-10-23 13:51:16 +02:00
Leo Balter 54bf16f91e Fix template path 2018-10-04 10:32:01 -04:00
Leo Balter 0958bbbede small fixes for feature tags and trailing space 2018-09-04 12:40:30 -04:00
jbhoosreddy 807f62b59b add generators async-generators syntax 2018-09-04 00:23:22 -04:00
jbhoosreddy 57fea22f70 add async function syntax 2018-09-04 00:09:35 -04:00
jbhoosreddy 057cd9935d @leobalter's comments 2018-09-03 23:41:14 -04:00
jbhoosreddy dd3d13a7a8 test: Add private generator method tests (#1343) 2018-08-29 21:12:18 -04:00
Mike Pennisi 136110378b Rename negative test "phase" for parsing
Early errors may result from parsing the source text of a test file, but
they may also result from parsing some other source text as referenced
through the ES2015 module syntax. The latter form of early error is not
necessarily detectable by ECMAScript parsers, however. Because of this,
the label "early" is not sufficiently precise for all Test262 consumers
to correctly interpret all tests.

Update the "phase" name of "early" to "parse" for all those negative
tests that describe errors resulting from parsing of the file's source
text directly. A forthcoming commit will update the remaining tests to
use a "phase" name that is more specific to module resolution.
2018-01-05 15:17:50 -05:00
Leo Balter b3092c61b6 Add generators flags for tests depending on generators features (#1259)
* Add missing generators feature flags

* Generate files

* Add generators flags

* fixup! Add generators flags
2017-10-04 16:12:34 -04:00
Leo Balter c41faf1aca Add missing Symbol features flags 2017-09-07 15:51:13 -04:00
Mike Pennisi 81d00def42 Force "early error" tests to fail if evaluated
This pattern makes expectations more explicit by making test files more
literal.
2017-06-28 11:24:36 -04:00
André Bargull 36a8672ae6 Add templates for escaped and unescaped 'yield' and 'await' as identifiers 2017-05-02 12:09:31 -07:00
Leonardo Balter e34a56774e
Improve some yield cases based on feedback 2017-03-27 13:07:09 -04:00
Leonardo Balter 76001a503f
Fix current generator templates 2017-03-27 13:07:05 -04:00
Leonardo Balter 77fbf1cada
Additional coverage for computed yield values
Ref #865
Ref https://github.com/tc39/test262/pull/890#issuecomment-284600429
2017-03-09 10:23:08 -05:00