* Update to primary docs to account for console update
* fix intra-doc link
* Forgot a period
* Fixing the errors on runtime docs
* Add hidden panic to example
* Make update operations reuse the last found binding locator
* Rename opcode
* Reword opcode comments
* Change capacity of `bindings_stack`
* Use the callframe stack to store the current binding
* Fix typo
* Reuse locators on assignment deletions
* Fix binding bug
* Remove leftover comment
It was reported that the `dbg!` output of native errors was too long. This PR skips printing the `Realm` of a `JsNativeError`. It also improves the `dbg!` output of `Realm` by skipping printing `Inner` and only printing the inner fields of `Inner`.
Noticed we were using this pattern on a couple of places, so I abstracted it behind a `ContextCleanupGuard` struct.
Let me know if you remember another place where this pattern would apply.
Bumps [test262](https://github.com/tc39/test262) from `2df6c7d` to `72c0c5e`.
<details>
<summary>Commits</summary>
<ul>
<li><a href="72c0c5e163"><code>72c0c5e</code></a> Added new tests to reflect the change that daysInMonth is the count of days i...</li>
<li><a href="d7fa398364"><code>d7fa398</code></a> Updated tests to reflect that daysInMonth are the count of days in a month</li>
<li><a href="1a352aac50"><code>1a352aa</code></a> Avoid excessive <code>U+</code> in error messages</li>
<li><a href="63e0986803"><code>63e0986</code></a> Improve printing of property key names in observer helpers</li>
<li><a href="dd47e4e248"><code>dd47e4e</code></a> Improve comments and assertion messages</li>
<li><a href="c03a58ba35"><code>c03a58b</code></a> Temporal: More baseline order-of-operations tests</li>
<li><a href="56fe761577"><code>56fe761</code></a> Temporal: Fix .slice() in test leftover from debugging</li>
<li>See full diff in <a href="2df6c7d29a...72c0c5e163">compare view</a></li>
</ul>
</details>
<br />
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 [regress](https://github.com/ridiculousfish/regress) from 0.5.0 to 0.6.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/ridiculousfish/regress/releases">regress's releases</a>.</em></p>
<blockquote>
<h2>v0.6.0</h2>
<p>Version 0.6.0 of regress, REGex in Rust with EmcaScript Syntax.</p>
<ul>
<li>Unpaired surrogates are now properly handled in accordance with the EcmaScript spec (<a href="https://github.com/jedel1043"><code>@jedel1043</code></a> in <a href="https://redirect.github.com/ridiculousfish/regress/pull/60">ridiculousfish/regress#60</a>)</li>
<li>Invalid ranges like <code>[a-\s]</code> are now permitted in non-Unicode mode, in accordance with Annex B of EcmaScript spec (<a href="https://github.com/HalidOdat"><code>@HalidOdat</code></a> in <a href="https://redirect.github.com/ridiculousfish/regress/pull/62">ridiculousfish/regress#62</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="b0814a7435"><code>b0814a7</code></a> Release regress 0.6.0</li>
<li><a href="dcc8ab63c8"><code>dcc8ab6</code></a> Fix valid character sets in Annex-B</li>
<li><a href="e724b5c04c"><code>e724b5c</code></a> Run <code>cargo clippy</code></li>
<li><a href="701e366172"><code>701e366</code></a> Expand comments further</li>
<li><a href="79890137f8"><code>7989013</code></a> Fix surrogates parsing on regex</li>
<li>See full diff in <a href="https://github.com/ridiculousfish/regress/compare/v0.5.0...v0.6.0">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=regress&package-manager=cargo&previous-version=0.5.0&new-version=0.6.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>
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel necessary.
--->
This Pull Request fixes/closes #2793.
It changes the following:
- Added a condition to the boa_parser/src/parser/expression/left_hand_side/member.rs parse function match operation for the new token that allows for the operation to continue evaluating more tokens when the TARGET keyword follows it.
- Added a test to validate the fix. (Could not figure out the structure of the test suite so it's commented for now). All other tests pass.
Please let me know if there's anything else I can do to improve the fix.
Co-authored-by: jedel1043 <jedel0124@gmail.com>
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`
We have currently some bugs related to binding assignments on arithmetic operations (`+=`, `++`, `?=`, etc.), but fixing those was getting a bit complex with our current bindings APIs.
This PR refactors our binding handling APIs to be a bit easier to use.
Most of the time that we have a `ByValue` ( `[ value ]` syntax ) it is for arrays and the value is usually an index. This PR adds a fast path to the instructions (without calling `.borrow()` on the object to check if its an array)
For example, this code:
```js
let a = [1, 2, 3]
for (let i = 0 ; i < 10000000; ++i) {
a[i % 3] += a[ (i + 1) % 3 ]
}
```
Using `hyperfine`, it ran `1.38` times faster on this PR.
```bash
Benchmark 1: ./boa_main test.js
Time (mean ± σ): 16.504 s ± 0.192 s [User: 16.440 s, System: 0.020 s]
Range (min … max): 16.328 s … 16.938 s 10 runs
Benchmark 2: ./boa_direct_array_access test.js
Time (mean ± σ): 11.982 s ± 0.038 s [User: 11.939 s, System: 0.013 s]
Range (min … max): 11.914 s … 12.035 s 10 runs
Summary
'./boa_direct_array_access test.js' ran
1.38 ± 0.02 times faster than './boa_main test.js'
```
Bumps [prettier](https://github.com/prettier/prettier) from 2.8.7 to 2.8.8.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/prettier/prettier/releases">prettier's releases</a>.</em></p>
<blockquote>
<h2>2.8.8</h2>
<p>This version is a republished version of v2.8.7.
A bad version was accidentally published and <a href="https://redirect.github.com/npm/cli/issues/1686">it can't be unpublished</a>, apologies for the churn.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/prettier/prettier/blob/main/CHANGELOG.md">prettier's changelog</a>.</em></p>
<blockquote>
<h1>2.8.8</h1>
<p>This version is a republished version of v2.8.7.
A bad version was accidentally published and <a href="https://redirect.github.com/npm/cli/issues/1686">it can't be unpublished</a>, apologies for the churn.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="1b7fad5255"><code>1b7fad5</code></a> Release 2.8.8</li>
<li>See full diff in <a href="https://github.com/prettier/prettier/compare/2.8.7...2.8.8">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=prettier&package-manager=npm_and_yarn&previous-version=2.8.7&new-version=2.8.8)](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>
As mentioned in https://github.com/boa-dev/boa/pull/2848#issuecomment-1518909512, this uses our new default ICU4X data to replace `char::is_start` and `char::is_continue` from the `boa_unicode` crate with the [`icu_properties`](https://crates.io/crates/icu_properties) crate.
Note that this doesn't deprecate `boa_unicode` yet, since that'll require some discussion about how to proceed with a now unused sub-crate.
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 fixes/closes #2717 and related to #2479
This was caused by an incorrect to digit conversion.
Here are two examples that always cause a panic. They have been added as a test in `number/test.rs`
```js
(0.1600057092765239).toString(36)
(0.23046743672210102).toString(36)
```
Part of ES5.
This PR allows `Date` objects to store an invalid `NativeDateTime` as a `i64` and check when `getMinutes` (or other methods) call and check if it's valid, like in the spec
This was failing some `Date` tests, when calling `new Date(8.64e15)` then calling `getTime()` it was returning `NaN` when it should return the passed value `8640000000000000` (as node does)
Part of ES5.
This was the last failing test on `Date.prototype[Symbol.primitive]` test suite :)
It changes the following:
- Fix `Date.prototype[Symbol.primitive]` incorrect attributes