132 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
legendecas
ee521159d5 Fix decorator tests 2022-06-23 15:17:43 -04:00
legendecas
6f8e0f67ca Decorators: add initial tests on class 2022-05-18 09:49:49 -04: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 b690cb67be9b487eb10156c03e2c00869e88cc9d, reversing
changes made to 50dd431dffe5cf86e9064a652d6b01dbbe542cf0. 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
Caio Lima
f81c2f5422 Adding test case for super access from class field defined as arrow function 2021-01-18 09:41:23 -05:00
Rick Waldron
0e77b43c9b Split up indirect and direct eval cases 2020-10-14 14:20:46 -04:00
Rick Waldron
bab4da88e3 Remove erroneous test templates and generated files 2020-10-14 14:20:46 -04:00
Rick Waldron
b59bd307a8 Coverage: async arrow in ClassHeritage. Fixes gh-1736 2020-09-22 10:37:57 -04:00
Rick Waldron
dd80cd2ea9 Fixup Class Elements: make templates from custom V8 tests 2020-09-14 13:35:13 -04:00
Alexey Shvayka
9027a803fe Add test cases 2020-08-12 18:58:26 +03:00
Rick Waldron
db618e202b Case: use .then($DONE, $DONE) wherever possible 2020-06-24 15:47:48 -04:00
Rick Waldron
d76701d86d Template: use .then($DONE, $DONE) wherever possible 2020-06-24 15:47:48 -04:00
Adrian Heine né Lang
2f1d28ddca
Fix feature flag in static-private-method-and-instance-method-brand-check (#2307) (#2635) 2020-05-21 14:17:41 -07:00
Adrian Heine né Lang
350ac0dab2
Cover simple declaration of instance fields (#2620) 2020-05-15 12:12:07 -07:00
Adrian Heine né Lang
d2f7d4285c
Fix feature flag in private-method-referenced-from-static-method (#2621) 2020-05-11 16:54:11 -07:00
Adrian Heine né Lang
d5826606a4
Fix features in private method length tests (#2617) 2020-05-11 11:45:01 -07:00
Caio Lima
539c001941 Updating test with 'o?.#field' to be valid program 2020-04-02 12:58:38 -04:00
Caio Lima
6499fa6794 Adding missing cases of instance field without assignment and static field with assignment 2020-03-31 10:39:11 -04:00
Caio Lima
740e157eb0 Adding test to cover case where there is a static field named as 'static' 2020-03-31 10:39:11 -04:00
Caio Lima
432adbb61e Adding case where 'static' is used as a field name 2020-03-28 16:47:44 -04:00
Caio Lima
db6f630e65
Adding test coverage for 'OptionalChain'.PrivateIdentifier case (#2534) 2020-03-23 15:47:51 -07:00
Caio Lima
d89c2cd601 Adding case to test invalid syntax when using PrivateName after '?.' (#2408) 2019-11-01 10:44:07 -04:00
Nicolò Ribaudo
7697d3a1d5 Test specific error in super-private-access-invalid.case (#2355)
Without declaring #x in the class body, the thrown error could have been
about the undeclared private name rather than about the SuperProperty
2019-09-24 13:51:10 -04:00
Nicolò Ribaudo
edafc79523 Add missing feature to prod-private-method-initialize-order.case (#2354) 2019-09-19 11:48:06 -03:00
Caio Lima
a997838e4b Adding missing variations to verify private method name setup (#2323)
* Added missing cases for name into variations of private method definition

* Generated tests

* Fixing broken case 'private-async-generator-method-name'
2019-09-04 11:43:25 -03:00
Caio Lima
5848f4f39d Adding case to verify private methods length proeprty 2019-08-30 13:31:45 -03:00
Caio Lima
7b1f479c8b Added case file to intercalated static/non-static computed fields (#2318)
* Added case file to intercalated static/non-static computed fields.

* Fixing error into tests to properly call 'C' instead of 'c'.
2019-08-29 16:02:21 -03:00
Shu-yu Guo
a31961f7ea Add tests for nested private fields (#2317)
This came up with a V8 bug where private fields weren't resolved
properly from nested classes where both the inner and the outer class
had private fields.
2019-08-29 11:19:47 -03:00
Qiming Ma
407103728c Add tests for duplicate private methods (early-error) (#2308)
* Add tests for duplicate private methods

* Add generated js test files

* Fix indentation

* Add more features to tests

* Fix feature list format
2019-08-29 11:17:37 -03:00
Leo Balter
230ab42698
Merge pull request #2296 from caiolima/private-static-members-inner-class
Private static members inner class
2019-08-28 16:04:17 -03:00
Leo Balter
8d41122c2b
Merge pull request #2310 from mkubilayk/static-private-from-instance
Add tests covering static private methods used from instance methods
2019-08-28 14:19:00 -03:00
Leo Balter
3daa5e46fc
Merge pull request #2304 from caiolima/private-static-accessor
Private static accessor declaration and usage
2019-08-28 12:45:58 -03:00
Kubilay Kahveci
b2f1d9bb4f Add tests covering static private methods used from instance methods
and vice versa
2019-08-23 13:50:16 +01:00
Caio Lima
46c542c14f Adding case with private static method and instance method 2019-08-20 15:27:59 -03:00
Caio Lima
01e89a8a0a Generated tests 2019-08-19 18:10:23 -03:00
Caio Lima
6a5d125dcd Added cases with declaration and usage of private static accessors 2019-08-19 17:35:12 -03:00
Caio Lima
2401cc678b Fixing flags in some tests 2019-08-14 19:21:00 -03:00
Caio Lima
d135093259 Fixing flags and adding cases where private static method is shadowed on inner class. 2019-08-14 18:18:24 -03:00
Caio Lima
fe2672d8d6 Added cases where private static fields are shadowed on inner class 2019-08-14 17:40:16 -03:00
Caio Lima
65fd8d30a3 Adding tests to verify if '.name' of static members are configured properly (#2293) 2019-08-14 13:33:41 -04:00
Caio Lima
51b3953d61 Added cases to cover public static field initializer operations with 'this' biding. (#2283)
* Added cases to cover public static field initializer operations with 'this' biding.

* Added initializer that throws.

* Adding missing ';'

* Fixing broken test static-field-initializer-error.js. 'function' keyword
was missing.
2019-08-13 00:21:27 -04:00
Caio Lima
aced1f265f Tests to cover simple declaration of static fields. 2019-08-12 15:01:17 -03:00
Kubilay Kahveci
458a35e78a Add tests for static private method access inside nested functions 2019-08-02 11:25:00 +01:00
Caio Lima
aeff2b0048 Adding case where PrivateName is used inside computed property. (#2241)
* Adding case where PrivateName is used inside computed property.

* Adding proper description to early errors on usage of undeclared private names inside computed property.
2019-07-30 14:53:56 -04:00
André Bargull
64b6b844eb Remove invalid template file
The template file violated the conventions from "src/class-elements/conventions.md".

Specifically there must be a global `C` variable, but default exports don't
create a global variable binding. There is no easy way to refer to the current
module and by that retrieve the default export, therefore the template was
removed.
2019-07-22 02:12:23 -07:00
Leo Balter
b3b0e8e190
Merge pull request #2235 from mkubilayk/static-subclass-receiver
Check static private methods on super class are called with correct receiver
2019-07-19 14:01:51 -04:00
Leo Balter
5549fd0022
Merge pull request #2197 from jbhoosreddy/class-decl-module
Add more class declaration formations
2019-07-16 19:30:17 -04:00
Kubilay Kahveci
e2d9794092 Check static private methods on super class are called with correct receiver 2019-07-12 13:33:18 +01:00