Commit Graph

12 Commits

Author SHA1 Message Date
Ioanna M Dimitriou H c63d53ad9c
Builtin boilerplate tests from PR #3866 (#4236)
Includes some proto-from-ctor-realm.js tests that look like standard tests for prototypes.

Co-authored-by: Ron Buckton <ron.buckton@microsoft.com>
Co-authored-by: Philip Chimento <philip.chimento@gmail.com>
2024-09-24 14:04:28 +02:00
SUZUKI Sosuke 8cbcc309e6
Add tests for `%WrapForValidIteratorPrototype%.return()` from Iterator Helpers Proposal (#4214)
* Add tests for `%WrapForValidIteratorPrototype%.return()`

* Address review

- Remove unused `flags
- Do not use `deepEqual.js`
- Assert `return` never got when `this` value is invalid
- Use `TemporalHelpers` to observer get / call
2024-09-13 11:41:43 -07:00
Ioanna M. Dimitriou H 435a89b702 Address review comments and fixes some more descriptions
- Fixes to two tests testing Map.prototype.size
- Description fixes
2024-07-29 16:31:26 -07:00
Ron Buckton c916d81d85 Adds .length property descriptor tests for explicit resource management
These are all the length.js tests from @rbuckton's PR #3866 to make reviewing easier.
2024-07-29 16:31:26 -07:00
Ron Buckton 59657217f1 Adds .name property descriptor tests for explicit resource management
These are all the name.js tests from @rbuckton's PR #3866 to make reviewing easier.
2024-07-29 16:31:26 -07:00
Ron Buckton 3a615a0c0e Adds property descriptor tests for explicit resource management objects
These are all the prop-desc.js tests from @rbuckton's PR #3866 to make reviewing easier.
2024-07-29 16:31:26 -07:00
Michael Ficarra e4f91b6381
fix broken Iterator.prototype constructor/Symbol.toStringTag tests (#3996)
* fix broken Iterator.prototype constructor/Symbol.toStringTag tests

* fix lint: unused includes
2024-01-24 17:37:28 -08:00
Michael Ficarra 17ba9aea47
update constructor and Symbol.toStringTag properties on Iterator.prototype (#3970)
* update constructor and toStringTag properties on Iterator.prototype

* includes cannot be empty for some reason

* update description

* add esid

* updates

* freeze Iterator.prototype

* don't try to use real GeneratorPrototype for these tests
2024-01-15 15:40:01 -08:00
Michael Ficarra 9efb4f8e53 update iterator helpers tests that passed even in noncompliant impls 2023-08-24 13:09:05 -07:00
André Bargull e273cd470a Add tests for recursively calling IteratorHelper generators 2023-08-24 12:44:04 -07:00
Michael Ficarra 550c11163e
add tests for tc39/proposal-iterator-helpers#281 (#3869)
Co-authored-by: Ms2ger <Ms2ger@igalia.com>
2023-07-13 16:04:33 +02:00
Rick Waldron dfc7ce4c28
Iterator Helpers (#2818)
drop:

property descriptor
name
length
[[Prototype]]
is a function
is not constructible
result instanceof Iterator
limit is given a non-primitive that needs to be converted to a number
  through valueOf
  through toString (array)
limit coercion to number throws
limit converts to NaN
  same as limit not supplied
limit behaves properly
  limit < number of values
  limit = number of values
  limit > number of values
gets the next method from the underlying iterator only once
underlying iterator has throwing next getter
underlying iterator next throws when advancing past dropped items
underlying iterator is advanced after calling drop
underlying iterator is closed after calling drop
underlying iterator is already closed
underlying iterator next returns non-object
underlying iterator next returns object with throwing done/value getters
underlying iterator return is never called when result iterator is closed

every:

property descriptor
name
length
[[Prototype]]
is a function
is callable
is not constructible
result is a Boolean
predicate is non-callable
iterator already exhausted
called on non-object
called on object with "next" method
called on object with non-callable "next" method
predicate returns non-Boolean
predicate returns truthy for all iterated values
  returns true
predicate returns truthy for some iterated values but then falsey for at least one iterated value
  returns false
  iteration stops
  iterator is closed
predicate returns falsey immediately
  returns false
  iteration stops
  iterator is closed
predicate throws
  every throws
  iterator is closed
predicate throws then iterator close also throws
predicate this value is undefined
predicate is passed the yielded value as the first parameter and a counter as second parameter
gets the next method from the iterator only once
iterator has throwing next getter
iterator has throwing return getter
iterator next throws
iterator return throws
iterator next returns non-object
iterator next returns object with throwing done/value getters

Co-authored-by: Michael Ficarra <mficarra@shapesecurity.com>
Co-authored-by: Jordan Harband <ljharb@gmail.com>
2023-06-15 17:07:41 +02:00