* Close active iterators when returning from async generator
* Fix remaining async generator tests
* Fix remaining async generator tests
* Replace some reserved opcodes
* Fix for await of loop flag
* Add tests for fix
* Remove whitespace
* Fix test display and improve test
* Change `usize` to `u32`
* Fix typo
* Refactor prompt highlighting into RLHelper
By moving the prompt coloring to be done in
Highlighter::highlight_prompt, we sidestep the issue on Windows where
the prompt width is calculated post-coloring AND without ignoring escape
codes.
By including it in the implementation of Highlighter, Editor::readline
now operates on a plain-text prompt, so width calculation is correct.
This commit also re-arranges the trait impl order to match the
definition.
* Remove redundant `num_bindings` field from `CodeBlock`
* Remove redundant num_bindings parameter from push_function_inherits
* Remove redundant num_bindings operand from environment opcodes
* Make pop_compile_environment() return an index
* Move boolean `CodeBlock` flags to bitflags
* Fix ci
* Add doc
Bumps [clap](https://github.com/clap-rs/clap) from 4.2.4 to 4.2.5.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p>
<blockquote>
<h2>v4.2.5</h2>
<h2>[4.2.5] - 2023-04-27</h2>
<h3>Fixes</h3>
<ul>
<li>Improve panic when a group requires a non-existent ID</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p>
<blockquote>
<h2>[4.2.5] - 2023-04-27</h2>
<h3>Fixes</h3>
<ul>
<li>Improve panic when a group requires a non-existent ID</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="fa57ed3123"><code>fa57ed3</code></a> chore: Release</li>
<li><a href="9f6067f644"><code>9f6067f</code></a> docs: Update changelog</li>
<li><a href="9eaf8996a4"><code>9eaf899</code></a> Merge pull request <a href="https://redirect.github.com/clap-rs/clap/issues/4867">#4867</a> from epage/panic</li>
<li><a href="6b23edc36a"><code>6b23edc</code></a> Merge pull request <a href="https://redirect.github.com/clap-rs/clap/issues/4864">#4864</a> from mattmadeofpasta/remove-redundant-test</li>
<li><a href="185729a7dc"><code>185729a</code></a> fix(builder): Assert earlier on bad requires/conflicts</li>
<li><a href="e02644b9c2"><code>e02644b</code></a> fix(usage): Provide more context in panic</li>
<li><a href="296fec9186"><code>296fec9</code></a> test(help): Remove redundant test</li>
<li><a href="43591bc1ee"><code>43591bc</code></a> chore: Release</li>
<li><a href="9bda2ac8a0"><code>9bda2ac</code></a> docs: Update changelog</li>
<li><a href="c38b8ca66d"><code>c38b8ca</code></a> Merge pull request <a href="https://redirect.github.com/clap-rs/clap/issues/4851">#4851</a> from ClementTsang/update_mut_arg_docs</li>
<li>Additional commits viewable in <a href="https://github.com/clap-rs/clap/compare/v4.2.4...v4.2.5">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=clap&package-manager=cargo&previous-version=4.2.4&new-version=4.2.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
This PR implements `Hidden Classes`, I named them as `Shapes` (like Spidermonkey does), calling them maps like v8 seems confusing because there already is a JS builtin, likewise with `Hidden classes` since there are already classes in JS.
There are two types of shapes: `shared` shapes that create the transition tree, and are shared between objects, this is mainly intended for user defined objects this makes more sense because shapes can create transitions trees, doing that for the builtins seems wasteful (unless users wanted to creating an object with the same property names and the same property attributes in the same order... which seems unlikely). That's why I added `unique` shapes, only one object has it. This is similar to previous solution, but this architecture enables us to use inline caching.
There will probably be a performance hit until we implement inline caching.
There still a lot of work that needs to be done, on this:
- [x] Move Property Attributes to shape
- [x] Move Prototype to shape
- [x] ~~Move extensible flag to shape~~, On further evaluation this doesn't give any benefit (at least right now), since it isn't used by inline caching also adding one more transition.
- [x] Implement delete for unique shapes.
- [x] If the chain is too long we should probably convert it into a `unique` shape
- [x] Figure out threshold ~~(maybe more that 256 properties ?)~~ curently set to an arbitrary number (`1024`)
- [x] Implement shared property table between shared shapes
- [x] Add code Document
- [x] Varying size storage for properties (get+set = 2, data = 1)
- [x] Add shapes to more object:
- [x] ordinary object
- [x] Arrays
- [x] Functions
- [x] Other builtins
- [x] Add `shapes.md` doc explaining shapes in depth with mermaid diagrams :)
- [x] Add `$boa.shape` module
- [x] `$boa.shape.id(o)`
- [x] `$boa.shape.type(o)`
- [x] `$boa.shape.same(o1, o2)`
- [x] add doc to `boa_object.md`
This Pull Request fixes/closes #718.
It changes the following:
- Adds a new `boa_runtime` crate, that will only include `console` for now
- Changes the `boa_cli` crate to use the new `boa_runtime` crate for the console, instead of the `console` feature of `boa_engine`
- Removes the `console` feature in `boa_engine`
- Adds a new `boa_testing` helper crate with some useful functions for testing `boa`. This part duplicates the code from `boa_engine`, but I could not make `boa_engine` work with this crate as a dependency due to circular dependencies. Maybe doing it a bit generic could work, but didn't have enough time to check it.
To be checked: wether the WASM example works as expected with the console.
This Pull Request implements [Initializers in ForIn Statement Heads](https://tc39.es/ecma262/#sec-initializers-in-forin-statement-heads) from the Annex B. This also cleans up the "annex-b" feature to be able to disable it with `--no-default-features`, since I couldn't test the error messages when the feature is disabled.