This Pull Request closes#1693.
It changes the following:
- It adds a fallible conversion from `serde_json::Value` to `JsValue`, which requires a context.
- It adds a fallible conversion from `JsValue` to `serde_json::Value`, which requires a context.
- Added examples to the documentation of both methods.
- Removed some duplicate and non-needed code that I found while doing this.
Co-authored-by: RageKnify <RageKnify@gmail.com>
Bumps [test262](https://github.com/tc39/test262) from `281c781` to `18ce639`.
<details>
<summary>Commits</summary>
<ul>
<li><a href="18ce639a4c"><code>18ce639</code></a> Port tests for PlainTime.</li>
<li><a href="1fe9bd3951"><code>1fe9bd3</code></a> Add a basic test for PlainDateTime#toPlainTime.</li>
<li><a href="615a2eb9a1"><code>615a2eb</code></a> Fix tests for private reference with logical assignment</li>
<li><a href="ec39db5877"><code>ec39db5</code></a> Test array grouping Symbol.unscopables values</li>
<li><a href="1b1097dbf6"><code>1b1097d</code></a> Add tests for compound assignment to private reference</li>
<li><a href="0b0fbdb04b"><code>0b0fbdb</code></a> Fix path example in generated test instructions</li>
<li><a href="08937278f1"><code>0893727</code></a> Add .case and .template files to .editorconfig</li>
<li><a href="0370240141"><code>0370240</code></a> Port tests for PlainTime.</li>
<li><a href="8851f084b6"><code>8851f08</code></a> Use ECMAScript 6</li>
<li><a href="df873eed1a"><code>df873ee</code></a> Port tests for PlainYearMonth#{add,subtract}.</li>
<li>Additional commits viewable in <a href="281c781ee4...18ce639a4c">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>
This Pull Request fixes/closes the incorrect message thrown for the following code:
```javascript
"use strict";
foo = "bar";
```
Which would throw the following before the change (incorrect):
`Uncaught "ReferenceError": "binding already exists: foo"`
And would throw the following after the change (correct):
`Uncaught "ReferenceError": "assignment to undeclared variable foo"`
This PR changes the following:
- Adds a check at compile time for the existence of a break label (this should be a syntax error in the future; refactor from panics to results in compile should be a separate PR)
- Adds a test for break label existence in boa/tests
262 misses some fairly important JS parity issues and not performing this check eagerly can lead to other more severe issues during VM execution.
This PR introduces a new API for JavaScript builtin objects in Rust (such as `Array`, `Map`, `Proxy`, etc). Rather than just expose the raw builtin functions as discussed here #1692 (though having raw API exposed may be nice as well), In this PR we introduce a very light wrapper around the raw API, for a more pleasant user experience. The wrapper implements functions that are specific to the wrapper type (for `Array` this would be methods like `pop`, `push`, etc) as well as implementing `Deref<Target = JsObject>` so we can call `JsObject` functions without converting to `JsObject` and `Into<JsValue>` for easy to `JsValue` conversions.
Please check `jsarray.rs` in the `examples`
This refactors the representation of the `[[ParameterMap]]` internal slot on the `Arguments` exotic object to be faster at runtime.
Previously `[[ParameterMap]]` was a `JsObject` like the spec describes. This can be pretty slow a runtime, because the argument getters and setters must be represented as function objects on the `[[ParameterMap]]` object. In addition to the time spend on creation and calling of those functions, every getter/setter needs a cloned gc reference to the function environment to access the bindings. This adds to the gc overhead.
The spec states that the `[[ParameterMap]]` internal slot doesn't have to be a `JsObject`. See NOTE 3 here: https://tc39.es/ecma262/#sec-arguments-exotic-objects
Leveraging this freedom, we can use a more optimized representation, that avoids any `JsObject` usage and only needs one clone of the function environment.
This Pull Request fixes/closes #1670.
It changes the following:
- Removes the "js" feature by default from getrandom for wasm (still there for boa_wasm)
- Updates dependencies
Note that this change was introduced in #1521, after #1475. We must make sure that the issue doesn't come back.
Fixes#1847 by wrapping the `std::alloc::alloc()` call in `try_alloc()`, which checks that the returned pointer is non-null and handles allocation errors that way. It will now abort the process instead of executing UB in the error path
This is an attempt to refactor the environments to be more performant at runtime. The idea is, to shift the dynamic hashmap environment lookups from runtime to compile time.
Currently the environments hold hashmaps that contain binding identifiers, values and additional information that is needed to identify some errors. Because bindings in outer environments are accessible from inner environments, this can lead to a traversal through all environments (in the worst case to the global environment).
This change to the environment structure pushes most of the work that is needed to access bindings to the compile time. At compile time, environments and bindings in the environments are being assigned indices. These indices are then stored instead of the `Sym` that is currently used to access bindings. At runtime, the indices are used to access bindings in a fixed size `Vec` per environment. This brings multiple benefits:
- No hashmap access needed at runtime
- The number of bindings per environment is known at compile time. Environments only need a single allocation, as their size is constant.
- Potential for optimizations with `unsafe` https://doc.rust-lang.org/std/vec/struct.Vec.html#method.get_unchecked
Additionally, this changes the global object to have it's bindings directly stored on the `Realm`. This should reduce some overhead from access trough gc objects and makes some optimizations for the global object possible.
The benchmarks look not that great on the first sight. But if you look closer, I think it is apparent, that this is a positive change. The difference is most apparent on Mini and Clean as they are longer (still not near any real life js but less specific that most other benchmarks):
| Test | Base | PR | % |
|------|--------------|------------------|---|
| Clean js (Compiler) | **1929.1±5.37ns** | 4.1±0.02µs | **+112.53%** |
| Clean js (Execution) | 1487.4±7.50µs | **987.3±3.78µs** | **-33.62%** |
The compile time is up in all benchmarks, as expected. The percentage is huge, but if we look at the real numbers, we can see that this is an issue of orders of magnitude. While compile is up `112.53%`, the real change is `~+2µs`. Execution is only down `33.62%`, but the real time changed by `~-500µs`.
Co-authored-by: Iban Eguia <razican@protonmail.ch>
Bumps [webpack](https://github.com/webpack/webpack) from 5.69.0 to 5.69.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/webpack/webpack/releases">webpack's releases</a>.</em></p>
<blockquote>
<h2>v5.69.1</h2>
<h1>Revert</h1>
<ul>
<li>revert "handle multiple alternative directories (e. g. due to resolve.alias or resolve.modules) when creating an context module"</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="dfdc8b133d"><code>dfdc8b1</code></a> 5.69.1</li>
<li><a href="dd53923cd0"><code>dd53923</code></a> Revert "Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15332">#15332</a> from webpack/fix/context-resolve-issue-11335"</li>
<li>See full diff in <a href="https://github.com/webpack/webpack/compare/v5.69.0...v5.69.1">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=webpack&package-manager=npm_and_yarn&previous-version=5.69.0&new-version=5.69.1)](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 removes all the calls to `unwrap()` in the codebase, which made me found a couple of places where it wasn't needed, and could be improved. I also noticed we don't have dependabot updates for the test262 submodule and the interner dependencies, so I added those.
I added lints so that no new unwraps are added.
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.78 to 1.0.79.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/serde-rs/json/releases">serde_json's releases</a>.</em></p>
<blockquote>
<h2>v1.0.79</h2>
<ul>
<li>Allow <code>RawValue</code> deserialization to propagate <code>\u</code> escapes for unmatched surrogates, which can later by deserialized to Vec<u8> (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/830">#830</a>, thanks <a href="https://github.com/lucacasonato"><code>@lucacasonato</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="7025523603"><code>7025523</code></a> Release 1.0.79</li>
<li><a href="7e56a406e5"><code>7e56a40</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/serde-rs/json/issues/830">#830</a> from lucacasonato/support_lone_surrogates_in_raw_value</li>
<li><a href="977975ee65"><code>977975e</code></a> Ignore buggy ptr_arg clippy lint</li>
<li><a href="aa78d6ca4e"><code>aa78d6c</code></a> Resolve needless_borrow clippy lint</li>
<li>See full diff in <a href="https://github.com/serde-rs/json/compare/v1.0.78...v1.0.79">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.78&new-version=1.0.79)](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>
With the implementation of `String.fromCodePoint` in #1123 some `RegExp` tests are now running for a long time. These tests check every unicode codepoint for all regexp property escape/character classes.
This not only makes the developer experience significantly worse, but also wastes cpu resources for the benefit of "completeness". I think these tests are completely useless. Ironically the unicode tables in the tests are generated - from the same data, that the unicode tables in the regex engine are also generated.
262 suite runtime:
Before: ~03:30 https://github.com/boa-dev/boa/runs/5191567446?check_suite_focus=true
After: ~31:00 https://github.com/boa-dev/boa/runs/5196405437?check_suite_focus=true
This Pull Request fixes/closes #1819.
It changes the following:
- Move the bitflags from `boa/src/syntax/lexer/regex.rs` to `boa/src/builtins/regexp/mod.rs`
- Replace the booleans in the RegExp struct to include the bitflags struct
- Update match expressions to make use of the bitflags struct
Co-authored-by: Aäron Munsters <45006406+aaronmunsters@users.noreply.github.com>
Bumps [webpack](https://github.com/webpack/webpack) from 5.68.0 to 5.69.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/webpack/webpack/releases">webpack's releases</a>.</em></p>
<blockquote>
<h2>v5.69.0</h2>
<h1>Features</h1>
<ul>
<li>automatically switch to an ESM compatible environment when enabling ESM output mode</li>
<li>handle multiple alternative directories (e. g. due to <code>resolve.alias</code> or <code>resolve.modules</code>) when creating an context module</li>
<li>add <code>util/types</code> to node.js built-in modules</li>
<li>add <code>__webpack_exports_info__.<name>.canMangle</code> api</li>
</ul>
<h1>Bugfixes</h1>
<ul>
<li>fix bug in chunk graph generation which leads to modules being included in chunk desprite them being already included in parent chunks</li>
<li>avoid writing more than 2GB at once during cache serialization (as workaround for node.js/libuv bug on MacOS)</li>
<li>fix handling of whitespaces in semver ranges when using Module Federation</li>
<li>avoid generating hashes which contain only numbers as they likely conflict with module ids</li>
<li>fix resource name based placeholders for data uris</li>
<li>fix cache serialization for context elements</li>
<li>fix passing of <code>stage</code> option when instrumenting plugins for the ProfilingPlugin</li>
<li>fix tracking of declarations in concatenated modules to avoid conflicts</li>
<li>fix unstable mangling of exports</li>
<li>fix handling of <code>#</code> in paths of loaders</li>
<li>avoid unnecessary cache update when using <code>experiments.buildHttp</code></li>
</ul>
<h1>Contributing</h1>
<ul>
<li>update typescript and jest</li>
</ul>
<h1>Developer Experience</h1>
<ul>
<li>expose some additional typings for usage in webpack-cli</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="9d21401151"><code>9d21401</code></a> 5.69.0</li>
<li><a href="ba4e83c3a9"><code>ba4e83c</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15373">#15373</a> from webpack/fix/issue-14907</li>
<li><a href="7badefda01"><code>7badefd</code></a> remove big assets case from allowlist</li>
<li><a href="06c8b81531"><code>06c8b81</code></a> Merge remote-tracking branch 'origin/main' into fix/issue-14907</li>
<li><a href="4a53e9af65"><code>4a53e9a</code></a> limit writes to</li>
<li><a href="18c3590b28"><code>18c3590</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15315">#15315</a> from webpack/fix/issue-13022</li>
<li><a href="4edf949da3"><code>4edf949</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15370">#15370</a> from webpack/fix/partial-15366</li>
<li><a href="02332b9c3d"><code>02332b9</code></a> Merge branch 'main' into fix/partial-15366</li>
<li><a href="f52b8c572c"><code>f52b8c5</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/14757">#14757</a> from webpack/fix-14755</li>
<li><a href="896efde07d"><code>896efde</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15367">#15367</a> from webpack/fix/issues-15214</li>
<li>Additional commits viewable in <a href="https://github.com/webpack/webpack/compare/v5.68.0...v5.69.0">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=webpack&package-manager=npm_and_yarn&previous-version=5.68.0&new-version=5.69.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 neccesary.
--->
This Pull Request fixes existing string prototype methods in #13 and adds static methods.
It changes the following:
- Fix bugs in existing string prototype methods and improve readability (e.g. rename variables to match the names in spec)
- Add static methods `String.raw`, `String.fromCharCode`, `String.fromCodePoint`
- Fix broken unit tests
Co-authored-by: RageKnify <RageKnify@gmail.com>
With this change an arrow function name is correctly set to the name of the variable:
```javascript
const myFunction = () => {};
console.log(myFunction.name); // Prints "myFunction"
```
_Note:_ I'm still getting familiar with the codebase and am pretty new to Rust so I won't be offended if this isn't merged. I am actually surprised I had to make so many changes to give the right code the name it needed. Maybe there is a better way? I'm all ears :)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
<details>
<summary>Commits</summary>
<ul>
<li><a href="3d81dc3237"><code>3d81dc3</code></a> Release version 1.14.8 of the npm package.</li>
<li><a href="62e546a99c"><code>62e546a</code></a> Drop confidential headers across schemes.</li>
<li>See full diff in <a href="https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=follow-redirects&package-manager=npm_and_yarn&previous-version=1.14.7&new-version=1.14.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)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/boa-dev/boa/network/alerts).
</details>
Bumps [boa-dev/criterion-compare-action](https://github.com/boa-dev/criterion-compare-action) from 3.0.2 to 3.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/boa-dev/criterion-compare-action/releases">boa-dev/criterion-compare-action's releases</a>.</em></p>
<blockquote>
<h2>v3.1.0</h2>
<p>Added the possibility to add feature flags for a benchmark (<a href="https://github-redirect.dependabot.com/boa-dev/criterion-compare-action/pull/32">boa-dev/criterion-compare-action#32</a>)</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="36f48c2715"><code>36f48c2</code></a> Bumped version number</li>
<li><a href="4a46bfae1d"><code>4a46bfa</code></a> Add the possibility to add feature flags for a benchmark (<a href="https://github-redirect.dependabot.com/boa-dev/criterion-compare-action/issues/32">#32</a>)</li>
<li>See full diff in <a href="https://github.com/boa-dev/criterion-compare-action/compare/v3.0.2...v3.1.0">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=boa-dev/criterion-compare-action&package-manager=github_actions&previous-version=3.0.2&new-version=3.1.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>
This PR boxes the `Try` and `TaggedTemplate` nodes reducing the size of the `Node` structure from 88 to 56 bytes. This should improve performance in most cases, by adding another indirection with code with `try` and templates.
This Pull Request fixes/closes #1768.
It adds one extra peeked token in the buffered lexer, since it didn't take into account that the stream might end just after the last peeked token. The panic was only happening in debug mode, but still, this was wrong.
This commit selects the production build (instead of development) for the WebAssembly compilation with Webpack, used in our playground. This might make things a bit faster and smaller.
I also took the opportunity to update all the dependencies and the Test262 suite, but unfortunately this doesn't solve #1824.
Bumps [webpack](https://github.com/webpack/webpack) from 5.67.0 to 5.68.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/webpack/webpack/releases">webpack's releases</a>.</em></p>
<blockquote>
<h2>v5.68.0</h2>
<h1>Features</h1>
<ul>
<li>allow to disable compile time evaluation of import.meta.url</li>
<li>add <code>__webpack_module__</code> and <code>__webpack_module__.id</code> to the api</li>
</ul>
<h1>Bugfixes</h1>
<ul>
<li>fix handling of errors thrown in async modules</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f593d98453"><code>f593d98</code></a> 5.68.0</li>
<li><a href="6f3735c548"><code>6f3735c</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15279">#15279</a> from taranek/docs/array-helpers-docs</li>
<li><a href="04039ca99c"><code>04039ca</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15284">#15284</a> from webpack/feature/<strong>webpack_module</strong></li>
<li><a href="d7a87ab5bc"><code>d7a87ab</code></a> change <strong>webpack_module_id</strong> to <strong>webpack_module</strong>.id</li>
<li><a href="612de998f1"><code>612de99</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15282">#15282</a> from webpack/feature/<strong>webpack_module</strong></li>
<li><a href="a962d2cedd"><code>a962d2c</code></a> add <strong>webpack_module</strong> and <strong>webpack_module_id</strong> to the api</li>
<li><a href="5a3760e6d4"><code>5a3760e</code></a> docs(util): added jsdoc annotations for ArrayHelpers.js</li>
<li><a href="46e8639a6a"><code>46e8639</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15246">#15246</a> from pavelsavara/import_meta_url</li>
<li><a href="1e73ca79c4"><code>1e73ca7</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15266">#15266</a> from webpack/bugfix/throwing-in-async-modules</li>
<li><a href="232403c5e8"><code>232403c</code></a> fix discussions</li>
<li>Additional commits viewable in <a href="https://github.com/webpack/webpack/compare/v5.67.0...v5.68.0">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=webpack&package-manager=npm_and_yarn&previous-version=5.67.0&new-version=5.68.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>
This PR adds some Clippy lints. Mainly, it adds the list of pedantic lints excluding some lints that were causing too many warnings. I also denied some useful restriction and pedantic lints, to make sure we use `Self` all the possible times (for better maintainability), and that we pass elements by reference where possible, for example, or that the documentation is properly written.
This might even have some small performance gains.
I also added a perfect hash function for the CLI keywords, which should be more efficient than a `HashSet`. This is something we could use elsewhere too.
Bumps [copy-webpack-plugin](https://github.com/webpack-contrib/copy-webpack-plugin) from 10.2.2 to 10.2.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/webpack-contrib/copy-webpack-plugin/releases">copy-webpack-plugin's releases</a>.</em></p>
<blockquote>
<h2>v10.2.3</h2>
<h3><a href="https://github.com/webpack-contrib/copy-webpack-plugin/compare/v10.2.2...v10.2.3">10.2.3</a> (2022-01-29)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>async <code>to</code> support (<a href="fd095fb793">fd095fb</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/webpack-contrib/copy-webpack-plugin/blob/master/CHANGELOG.md">copy-webpack-plugin's changelog</a>.</em></p>
<blockquote>
<h3><a href="https://github.com/webpack-contrib/copy-webpack-plugin/compare/v10.2.2...v10.2.3">10.2.3</a> (2022-01-29)</h3>
<h3>Bug Fixes</h3>
<ul>
<li>async <code>to</code> support (<a href="fd095fb793">fd095fb</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="9a5a4c44ef"><code>9a5a4c4</code></a> chore(release): 10.2.3</li>
<li><a href="fd095fb793"><code>fd095fb</code></a> fix: async <code>to</code> support</li>
<li>See full diff in <a href="https://github.com/webpack-contrib/copy-webpack-plugin/compare/v10.2.2...v10.2.3">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=copy-webpack-plugin&package-manager=npm_and_yarn&previous-version=10.2.2&new-version=10.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>
The main idea behind this is to upgrade the Unicode version from 13 to 14. I also upgraded the rest of the dependencies, so this closes#1802, #1800 and #1799.
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.134 to 1.0.135.
<details>
<summary>Commits</summary>
<ul>
<li><a href="8932c852a5"><code>8932c85</code></a> Release 1.0.135</li>
<li><a href="9f3dd3c7c4"><code>9f3dd3c</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2163">#2163</a> from serde-rs/discord</li>
<li><a href="dd9b415ff9"><code>dd9b415</code></a> Add discord invite links</li>
<li>See full diff in <a href="https://github.com/serde-rs/serde/compare/v1.0.134...v1.0.135">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde&package-manager=cargo&previous-version=1.0.134&new-version=1.0.135)](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 [serde_json](https://github.com/serde-rs/json) from 1.0.76 to 1.0.78.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/serde-rs/json/releases">serde_json's releases</a>.</em></p>
<blockquote>
<h2>v1.0.78</h2>
<ul>
<li>Support deserializing as <code>&RawValue</code> in map key position, which would previously fail with <em>"invalid type: newtype struct"</em> (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/851">#851</a>)</li>
</ul>
<h2>v1.0.77</h2>
<ul>
<li>Include discord invite links in the published readme</li>
<li>Improve compile error on compiling with neither <code>std</code> nor <code>alloc</code> feature enabled</li>
<li>Include integration tests in published package (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/578">#578</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="98cafacefe"><code>98cafac</code></a> Release 1.0.78</li>
<li><a href="2d81cbd113"><code>2d81cbd</code></a> Move raw_value test imports to block of imports</li>
<li><a href="cbb0342ba0"><code>cbb0342</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/serde-rs/json/issues/851">#851</a> from serde-rs/rawkey</li>
<li><a href="e5cdfcc7ee"><code>e5cdfcc</code></a> Support deserializing map key as &RawValue</li>
<li><a href="6a3fb68979"><code>6a3fb68</code></a> Add test of deserializing a &RawValue in map key position</li>
<li><a href="d8512af496"><code>d8512af</code></a> Release 1.0.77</li>
<li><a href="5fe9bdd356"><code>5fe9bdd</code></a> Improve error on compiling with neither std nor alloc</li>
<li><a href="4c15649318"><code>4c15649</code></a> Include integration tests in published package</li>
<li><a href="71257c5667"><code>71257c5</code></a> Add discord invite links</li>
<li>See full diff in <a href="https://github.com/serde-rs/json/compare/v1.0.76...v1.0.78">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.76&new-version=1.0.78)](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 builds on top of #1758 to try to bring #1763 to life.
Something that should probably be done here would be to convert `JsString` to a `Sym` internally. Then, further optimizations could be done adding common strings to a custom interner type (those that we know statically).
This is definitely work in progress, but I would like to have feedback on the API, and feel free to contribute.
Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
It changes the following:
- Adjust the `context` methods `compile` and `execute` to avoid clones on `StatementList` and `CodeBlock`
Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
This Pull Request is part of #279.
It adds a string interner to Boa, which allows many types to not contain heap-allocated strings, and just contain a `NonZeroUsize` instead. This can move types to the stack (hopefully I'll be able to move `Token`, for example, maybe some `Node` types too.
Note that the internet is for now only available in the lexer. Next steps (in this PR or future ones) would include also using interning in the parser, and finally in execution. The idea is that strings should be represented with a `Sym` until they are displayed.
Talking about display. I have changed the `ParseError` type in order to not contain anything that could contain a `Sym` (basically tokens), which might be a bit faster, but what is important is that we don't depend on the interner when displaying errors.
The issue I have now is in order to display tokens. This requires the interner if we want to know identifiers, for example. The issue here is that Rust doesn't allow using a `fmt::Formatter` (only in nightly), which is making my head hurt. Maybe someone of you can find a better way of doing this.
Then, about `cursor.expect()`, this is the only place where we don't have the expected token type as a static string, so it's failing to compile. We have the option of changing the type definition of `ParseError` to contain an owned string, but maybe we can avoid this by having a `&'static str` come from a `TokenKind` with the default values, such as "identifier" for an identifier. I wanted for you to think about it and maybe we can just add that and avoid allocations there.
Oh, and this depends on the VM-only branch, so that has to be merged before :)
Another thing to check: should the interner be in its own module?
(Really small self-explanatory change - maybe the commit message could be better)
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel neccesary.
--->
It changes the following:
When calling `new Proxy(undefined, {})` the error message now refers to the target `undefined` instead of the handler `{}`
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.25 to 0.3.26.
<details>
<summary>Commits</summary>
<ul>
<li><a href="97e92a3755"><code>97e92a3</code></a> v0.3.26</li>
<li><a href="2bdd6b49ad"><code>2bdd6b4</code></a> Clarification on maintenance since clap v3 is out</li>
<li><a href="2736281a64"><code>2736281</code></a> Upgrade heck</li>
<li><a href="358cccf9af"><code>358cccf</code></a> [docs] Add output to all examples</li>
<li><a href="4c1a8fcb2f"><code>4c1a8fc</code></a> Link to the clap API in the documentation that says all clap methods can be used</li>
<li><a href="ffd4772156"><code>ffd4772</code></a> Typo</li>
<li>See full diff in <a href="https://github.com/TeXitoi/structopt/compare/v0.3.25...v0.3.26">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=structopt&package-manager=cargo&previous-version=0.3.25&new-version=0.3.26)](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 [serde_json](https://github.com/serde-rs/json) from 1.0.73 to 1.0.75.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/serde-rs/json/releases">serde_json's releases</a>.</em></p>
<blockquote>
<h2>v1.0.74</h2>
<ul>
<li>Allow creating RawValues from references to unsized values (<a href="https://github-redirect.dependabot.com/serde-rs/json/issues/841">#841</a>, thanks <a href="https://github.com/EFanZh"><code>@EFanZh</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="a22b686f49"><code>a22b686</code></a> Release 1.0.75</li>
<li><a href="36c43bfed5"><code>36c43bf</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/serde-rs/json/issues/848">#848</a> from serde-rs/num</li>
<li><a href="d541381455"><code>d541381</code></a> Deserialize small numbers as integers in arbitrary_precision</li>
<li><a href="0ca5a69d73"><code>0ca5a69</code></a> Add regression test for issue 845</li>
<li><a href="66919777d0"><code>6691977</code></a> Disable buggy iter_not_returning_iterator lint</li>
<li><a href="aebe84cb09"><code>aebe84c</code></a> Raise toolchain version for preserve_order to rust 1.46</li>
<li><a href="3f459308f5"><code>3f45930</code></a> Set miriflags once for whole miri job</li>
<li><a href="c79d9ad2e1"><code>c79d9ad</code></a> Run miri also with some features enabled</li>
<li><a href="58d40de6ed"><code>58d40de</code></a> Release 1.0.74</li>
<li><a href="ef7794f87f"><code>ef7794f</code></a> Detect warnings in CI</li>
<li>Additional commits viewable in <a href="https://github.com/serde-rs/json/compare/v1.0.73...v1.0.75">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_json&package-manager=cargo&previous-version=1.0.73&new-version=1.0.75)](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>