* 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.
Bumps [regex](https://github.com/rust-lang/regex) from 1.7.3 to 1.8.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/rust-lang/regex/blob/master/CHANGELOG.md">regex's changelog</a>.</em></p>
<blockquote>
<h1>1.8.0 (2023-04-20)</h1>
<p>This is a sizeable release that will be soon followed by another sizeable
release. Both of them will combined close over 40 existing issues and PRs.</p>
<p>This first release, despite its size, essentially represent preparatory work
for the second release, which will be even bigger. Namely, this release:</p>
<ul>
<li>Increases the MSRV to Rust 1.60.0, which was released about 1 year ago.</li>
<li>Upgrades its dependency on <code>aho-corasick</code> to the recently release 1.0
version.</li>
<li>Upgrades its dependency on <code>regex-syntax</code> to the simultaneously released
<code>0.7</code> version. The changes to <code>regex-syntax</code> principally revolve around a
rewrite of its literal extraction code and a number of simplifications and
optimizations to its high-level intermediate representation (HIR).</li>
</ul>
<p>The second release, which will follow ~shortly after the release above, will
contain a soup-to-nuts rewrite of every regex engine. This will be done by
bringing <a href="https://github.com/BurntSushi/regex-automata"><code>regex-automata</code></a> into
this repository, and then changing the <code>regex</code> crate to be nothing but an API
shim layer on top of <code>regex-automata</code>'s API.</p>
<p>These tandem releases are the culmination of about 3
years of on-and-off work that <a href="https://redirect.github.com/rust-lang/regex/issues/656">began in earnest in March
2020</a>.</p>
<p>Because of the scale of changes involved in these releases, I would love to
hear about your experience. Especially if you notice undocumented changes in
behavior or performance changes (positive <em>or</em> negative).</p>
<p>Most changes in the first release are listed below. For more details, please
see the commit log, which reflects a linear and decently documented history
of all changes.</p>
<p>New features:</p>
<ul>
<li>[FEATURE <a href="https://redirect.github.com/rust-lang/regex/issues/501">#501</a>](<a href="https://redirect.github.com/rust-lang/regex/issues/501">rust-lang/regex#501</a>):
Permit many more characters to be escaped, even if they have no significance.
More specifically, any ASCII character except for <code>[0-9A-Za-z<>]</code> can now be
escaped. Also, a new routine, <code>is_escapeable_character</code>, has been added to
<code>regex-syntax</code> to query whether a character is escapeable or not.</li>
<li>[FEATURE <a href="https://redirect.github.com/rust-lang/regex/issues/547">#547</a>](<a href="https://redirect.github.com/rust-lang/regex/issues/547">rust-lang/regex#547</a>):
Add <code>Regex::captures_at</code>. This filles a hole in the API, but doesn't otherwise
introduce any new expressive power.</li>
<li>[FEATURE <a href="https://redirect.github.com/rust-lang/regex/issues/595">#595</a>](<a href="https://redirect.github.com/rust-lang/regex/issues/595">rust-lang/regex#595</a>):
Capture group names are now Unicode-aware. They can now begin with either a <code>_</code>
or any "alphabetic" codepoint. After the first codepoint, subsequent codepoints
can be any sequence of alpha-numeric codepoints, along with <code>_</code>, <code>.</code>, <code>[</code> and
<code>]</code>. Note that replacement syntax has not changed.</li>
<li>[FEATURE <a href="https://redirect.github.com/rust-lang/regex/issues/810">#810</a>](<a href="https://redirect.github.com/rust-lang/regex/issues/810">rust-lang/regex#810</a>):</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/rust-lang/regex/commits">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=regex&package-manager=cargo&previous-version=1.7.3&new-version=1.8.0)](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>
Bumps [clap](https://github.com/clap-rs/clap) from 4.2.3 to 4.2.4.
<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.4</h2>
<h2>[4.2.4] - 2023-04-19</h2>
<h3>Documentation</h3>
<ul>
<li>Corrected docs for <code>Command::style</code></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.4] - 2023-04-19</h2>
<h3>Documentation</h3>
<ul>
<li>Corrected docs for <code>Command::style</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="60c8c3fc31"><code>60c8c3f</code></a> chore: Release</li>
<li><a href="e9b4c4769e"><code>e9b4c47</code></a> docs: Update changelog</li>
<li><a href="e429a9e98b"><code>e429a9e</code></a> Merge pull request <a href="https://redirect.github.com/clap-rs/clap/issues/4845">#4845</a> from epage/color</li>
<li><a href="1ca073f212"><code>1ca073f</code></a> docs(help): Fill in styles docs</li>
<li><a href="6d5aaae5a9"><code>6d5aaae</code></a> feat(help): Allow access to current Styles</li>
<li>See full diff in <a href="https://github.com/clap-rs/clap/compare/v4.2.3...v4.2.4">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.3&new-version=4.2.4)](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>
Bumps [clap](https://github.com/clap-rs/clap) from 4.2.2 to 4.2.3.
<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.3</h2>
<h2>[4.2.3] - 2023-04-18</h2>
<h3>Features</h3>
<ul>
<li><code>Command::styles</code> for theming help/errors (behind <code>unstable-styles</code>)</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.3] - 2023-04-18</h2>
<h3>Features</h3>
<ul>
<li><code>Command::styles</code> for theming help/errors (behind <code>unstable-styles</code>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="b99c50f7e9"><code>b99c50f</code></a> chore: Release</li>
<li><a href="3f46258b45"><code>3f46258</code></a> docs: Update changelog</li>
<li><a href="b0e0c596fe"><code>b0e0c59</code></a> Merge pull request <a href="https://redirect.github.com/clap-rs/clap/issues/4843">#4843</a> from epage/style</li>
<li><a href="cbea23e3fc"><code>cbea23e</code></a> style: Make clippy happy</li>
<li><a href="5ca3b2fc5f"><code>5ca3b2f</code></a> refactor(help): Shrink binary size</li>
<li><a href="ec7040e8ba"><code>ec7040e</code></a> style: Make clippy happy</li>
<li><a href="57974bed7b"><code>57974be</code></a> refactor(help): Future proof styling</li>
<li><a href="e10e2ad249"><code>e10e2ad</code></a> refactor(help): Split out separate usage style</li>
<li><a href="8fd0a93bdc"><code>8fd0a93</code></a> refactor(help): Clarify style meaning</li>
<li><a href="7cf08e63cd"><code>7cf08e6</code></a> refactor(help): Remove unused hint</li>
<li>Additional commits viewable in <a href="https://github.com/clap-rs/clap/compare/v4.2.2...v4.2.3">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.2&new-version=4.2.3)](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>