+
Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Conversation

MichaReiser
Copy link
Contributor

Fix the last and size_hint implementations of the SyntaxSlots iterator.

  • size_hint should return the count of the remaining items in the iterator and not the total count of the underlying list.
  • last should return the last element remaining in the iterator, ignoring previously returned elements from calling next_back

Tests

I added new tests that verified the incorrect behaviour and then fixed the implementation

Fix the `last` and `size_hint` implementations of the `SyntaxSlots` iterator.

* `size_hint` should return the remaining items count in the iterator and not the total count of the underlying list.
* `last` should return the last element remaining in the iterator, ignoring previously returned elements from calling `next_back`

## Tests

I added new tests that verified the incorrect behaviour and then fixed the implementation
@MichaReiser MichaReiser requested a review from a team July 28, 2022 10:00
@MichaReiser MichaReiser temporarily deployed to aws July 28, 2022 10:00 Inactive
@github-actions
Copy link

@github-actions
Copy link

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 45878 45878 0
Passed 44938 44938 0
Failed 940 940 0
Panics 0 0 0
Coverage 97.95% 97.95% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 39 39 0
Passed 36 36 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.31% 92.31% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5946 5946 0
Passed 395 395 0
Failed 5551 5551 0
Panics 0 0 0
Coverage 6.64% 6.64% 0.00%

ts/babel

Test result main count This PR count Difference
Total 588 588 0
Passed 519 519 0
Failed 69 69 0
Panics 0 0 0
Coverage 88.27% 88.27% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16257 16257 0
Passed 12393 12393 0
Failed 3864 3864 0
Panics 0 0 0
Coverage 76.23% 76.23% 0.00%

@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: e93bdfb
Status: ✅  Deploy successful!
Preview URL: https://58306964.tools-8rn.pages.dev
Branch Preview URL: https://fix-syntax-slots.tools-8rn.pages.dev

View logs

@MichaReiser MichaReiser merged commit 5bf5891 into main Jul 28, 2022
@MichaReiser MichaReiser deleted the fix/syntax-slots branch July 28, 2022 11:28
IWANABETHATGUY pushed a commit to IWANABETHATGUY/tools that referenced this pull request Aug 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载