Fixes `BigInt` and `Number` comparison, and vice versa. Before we were removing the decimal point of the floating-point number which was causing cases like `0.000001 > 0n` (or `0n < 0.000001`) to fail.
Bumps [test262](https://github.com/tc39/test262) from `f7fb969` to `0bccacd`.
<details>
<summary>Commits</summary>
<ul>
<li><a href="0bccacda69"><code>0bccacd</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/tc39/test262/issues/3429">#3429</a> from Igalia/roundingmode-invalid-string</li>
<li><a href="104e5e8fab"><code>104e5e8</code></a> Test more invalid values for roundingMode.</li>
<li><a href="51ce1fa00f"><code>51ce1fa</code></a> Expand some Duration#toString() tests.</li>
<li><a href="c6c31c8dac"><code>c6c31c8</code></a> Add and expand tests for Duration constructor / from().</li>
<li><a href="d45476b9fd"><code>d45476b</code></a> Add a test for observable calls in Temporal.Duration constructor.</li>
<li><a href="50dc96e59e"><code>50dc96e</code></a> Split Array.prototype.Symbol.unscopables tests for features</li>
<li><a href="d8fb00d741"><code>d8fb00d</code></a> Add missing feature flag array-grouping</li>
<li><a href="5fb0f5b6d2"><code>5fb0f5b</code></a> Remove SPACES before features</li>
<li><a href="bc4af482b0"><code>bc4af48</code></a> Fix features by removing leading space</li>
<li>See full diff in <a href="f7fb969cc4...0bccacda69">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>
It changes the following:
- Refreshes the vm and debugging docs to represent the current state
- Fix some bytecode trace output
- Rename a field in the `CodeBlock`
<!---
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/closes #1784.
There're still a few tests failing, notably:
- `iter-set-elem-prop-non-writable` - we don't have generator functions implemented
- `calling-from-valid-1-noStrict`, `iter-map-fn-this-non-strict` - `thisArg` in non-strict mode, when undefined, should be inherited (that's what I'm guessing, I haven't confirmed this, but strict counterparts do pass with `thisArg` being `undefined`)
- `source-array-boundary`, `elements-deleted-after` - ~~Not sure yet, still investigating, but they also include thisArg, so perhaps function calling has an underlying issue?~~ Failing because `this` on the top level evaluates to an empty object instead of containing everything from the top scope
Co-authored-by: HalidOdat <halidodat@gmail.com>
<!---
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 makes it easier to build the Boa playground in production mode, with a new `build:prod` command.
This fixes a bug with the postfix increment and decrement. Before those operators would return the left-hand-side value, but the spec specifies they should return ToNumeric(left-had-side value).
Bumps [regex](https://github.com/rust-lang/regex) from 1.5.4 to 1.5.5.
<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.5.5 (2022-03-08)</h1>
<p>This releases fixes a security bug in the regex compiler. This bug permits a
vector for a denial-of-service attack in cases where the regex being compiled
is untrusted. There are no known problems where the regex is itself trusted,
including in cases of untrusted haystacks.</p>
<ul>
<li><a href="https://github.com/rust-lang/regex/security/advisories/GHSA-m5pq-gvj9-9vr8">SECURITY #GHSA-m5pq-gvj9-9vr8</a>:
Fixes a bug in the regex compiler where empty sub-expressions subverted the
existing mitigations in place to enforce a size limit on compiled regexes.
The Rust Security Response WG published an advisory about this:
<a href="https://groups.google.com/g/rustlang-security-announcements/c/NcNNL1Jq7Yw">https://groups.google.com/g/rustlang-security-announcements/c/NcNNL1Jq7Yw</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="d130381b15"><code>d130381</code></a> 1.5.5</li>
<li><a href="ae70b41d4f"><code>ae70b41</code></a> security: fix denial-of-service bug in compiler</li>
<li><a href="b92ffd5471"><code>b92ffd5</code></a> cargo: use SPDX license format</li>
<li><a href="f6e52dafde"><code>f6e52da</code></a> syntax: fix 'unused' warnings</li>
<li><a href="5197f21287"><code>5197f21</code></a> fuzz: do not use inherits in Cargo.toml</li>
<li><a href="3662851482"><code>3662851</code></a> doc: fix typo</li>
<li><a href="63ee6699a2"><code>63ee669</code></a> syntax/doc: fix 'their' typo</li>
<li><a href="d6bc7a4c3b"><code>d6bc7a4</code></a> readme: remove broken badge</li>
<li><a href="bd7466034f"><code>bd74660</code></a> fuzz: try to fix build issue</li>
<li><a href="bd0a14231b"><code>bd0a142</code></a> readme: fix badges</li>
<li>Additional commits viewable in <a href="https://github.com/rust-lang/regex/compare/1.5.4...1.5.5">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.5.4&new-version=1.5.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 fixes an issue with 262 negative tests, that should produce a syntax errors. Currently we only parse the test code is such cases. If the parsing does not return an error, we do not compile the code further. This caused some panics. Most of them are fixed by now, the last ones will be fixed with #1860.
Added boa examples as per issue #446
Overtaken https://github.com/boa-dev/boa/pull/634
Somehow screwed that branch up by rebasing it and losing access
pings @elasmojs
This Pull Request fixes/closes #446 .
Co-authored-by: Jason Williams <jase.williams@gmail.com>
Co-authored-by: Iban Eguia (Razican) <razican@protonmail.ch>
Co-authored-by: jasonwilliams <jase.williams@gmail.com>
Co-authored-by: jedel1043 <jedel0124@gmail.com>
<!---
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 some bugs related to try blocks:
- Fixes a panic when a finally block contained variable declarations. (Thanks to @VTCAKAVSMoACE for the report!)
- Fixes a bug where try blocks in the last position of a statement list didn't return its inner last value as the result of the evaluation.
- Add tests for both cases and two other common cases.
- Extract and cleanup some code.
<!---
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/closes #1897.
It changes the following:
- Rejects uninitialized const declarations inside the init value of a for loop statement.
- Adds test for the case.
Bumps [test262](https://github.com/tc39/test262) from `18ce639` to `f7fb969`.
<details>
<summary>Commits</summary>
<ul>
<li><a href="f7fb969cc4"><code>f7fb969</code></a> Add tests for T time designator prefix not allowing space</li>
<li><a href="131c396b6a"><code>131c396</code></a> Remove number test (yields a different error, not an exception)</li>
<li><a href="8ff1e510b9"><code>8ff1e51</code></a> Add a couple more types</li>
<li><a href="9c6e3aff38"><code>9c6e3af</code></a> Move to more sensible location</li>
<li><a href="10f9a69295"><code>10f9a69</code></a> Move test to a more sensible location</li>
<li><a href="ecd24faa82"><code>ecd24fa</code></a> Fix buggy error message</li>
<li><a href="918cefcd09"><code>918cefc</code></a> Check <code>formatRange</code> on many pairs of invalid arguments</li>
<li><a href="2f592de0aa"><code>2f592de</code></a> Port tests for PlainTime.</li>
<li>See full diff in <a href="18ce639a4c...f7fb969cc4">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 PR changes the following:
- Fixes the panics induced by incorrect continues.
- Adds tests which demonstrate the various panics induced.
- Actually rustfmts correctly?
This PR changes the following:
- More elegantly handles illegal access statements in compile_access
- Adds a slew of previously unhandled illegal access test cases
### Caveats
It is very, very likely that you will want to simply restrict unary and assignment operations in the AST. However, this prevents crashes in the meantime with a error that is just slightly less detailed than if it were implemented in AST.
Building up to #186, this PR extracts an `Intrinsics` struct from `Context`, facilitating a lot the extraction of a `Realm` struct.
Also, it adapts the `BuiltIn` trait to be useful for builtins that don't expose a global property on initialization (`Generator`, `TypedArray`, etc.)
It changes the following:
- Creates an `Intrinsics` struct and refactors `Context` to transfer its intrinsic related fields to `Intrinsics`.
- Renames some methods and parameters to better describe their functionality.
- Makes `BuiltIn::init` return `Option<JsValue>` to skip global property initialization if the builtin initialization returns `None`
This PR add `Number.parseInt` and `Number.parseFloat` which according to spec are clones of the global objects `parseInt` and `parseFloat`.
It also fixes the last failing test of the `NativeError` feature with this we get 100% spec complaint `NativeError`s 🎉
It changes the following:
- Add `Number.parseInt()`
- Add `Number.parseFloat()`
- Fix length of `AggregateError`
- Fix length of `Reflect.setPrototypeOf`
Bumps [webpack](https://github.com/webpack/webpack) from 5.69.1 to 5.70.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.70.0</h2>
<h1>Features</h1>
<ul>
<li>update node.js version constraints for ESM support</li>
<li>add <code>baseUri</code> to <code>entry</code> options to configure a static base uri (the base of <code>new URL()</code>)</li>
<li>alphabetically sort exports in namespace objects when possible</li>
<li>add <code>__webpack_exports_info__.name.canMangle</code></li>
<li>add proxy support to <code>experiments.buildHttp</code></li>
<li><code>import.meta.webpackContext</code> as ESM alternative to <code>require.context</code></li>
<li>handle multiple alternative directories (e. g. due to resolve.alias or resolve.modules) when creating an context module</li>
</ul>
<h1>Bugfixes</h1>
<ul>
<li>fix problem when assigning <code>global</code> to a variable</li>
<li>fix crash when using <code>experiments.outputModule</code> and <code>loaderContext.importModule</code> with multiple chunks</li>
<li>avoid generating progress output before the compilation has started (ProgressPlugin)</li>
<li>fix handling of non-static-ESM dependencies with using TLA and HMR in the same module</li>
<li>include the asset module filename in hashing</li>
<li><code>output.clean</code> will keep HMR assets for at least 10s to allow HMR to access them even when compilation is faster then the browser</li>
</ul>
<h1>Performance</h1>
<ul>
<li>fix asset caching when using the BannerPlugin</li>
</ul>
<h1>Developer Experience</h1>
<ul>
<li>improve typings</li>
</ul>
<h1>Contributing</h1>
<ul>
<li>capture caching errors when running the test suite</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="5a26b7c4a9"><code>5a26b7c</code></a> 5.70.0</li>
<li><a href="870fcadfd0"><code>870fcad</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15423">#15423</a> from webpack/fix/issue-15409</li>
<li><a href="cbfea7605d"><code>cbfea76</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15463">#15463</a> from webpack/fix/add-missing-option</li>
<li><a href="f51e099a2d"><code>f51e099</code></a> add parserOptions.importMetaContext option</li>
<li><a href="75383c93d2"><code>75383c9</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15454">#15454</a> from webpack/fix/issue-15447</li>
<li><a href="b53fe2f630"><code>b53fe2f</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/webpack/webpack/issues/15446">#15446</a> from webpack/feature/import-meta-webpack-context</li>
<li><a href="0fe44700f7"><code>0fe4470</code></a> up enhanced-resolve version</li>
<li><a href="12ecab44fc"><code>12ecab4</code></a> use cache in BannerPlugin</li>
<li><a href="d3c5d357cc"><code>d3c5d35</code></a> add ImportMetaContextPlugin</li>
<li><a href="b89f397e3c"><code>b89f397</code></a> handle more options</li>
<li>Additional commits viewable in <a href="https://github.com/webpack/webpack/compare/v5.69.1...v5.70.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.69.1&new-version=5.70.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 [once_cell](https://github.com/matklad/once_cell) from 1.9.0 to 1.10.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/matklad/once_cell/blob/master/CHANGELOG.md">once_cell's changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h2>1.11</h2>
<ul>
<li>Add <code>OnceCell::with_value</code> to create initialized <code>OnceCell</code> at compile time.</li>
<li>Improve <code>Clone</code> implementation for <code>OnceCell</code>.</li>
</ul>
<h2>1.10</h2>
<ul>
<li>upgrade <code>parking_lot</code> to <code>0.12.0</code> (note that this bumps MSRV with <code>parking_lot</code> feature enabled to <code>1.49.0</code>).</li>
</ul>
<h2>1.9</h2>
<ul>
<li>Added an <code>atomic-polyfill</code> optional dependency to compile <code>race</code> on platforms without atomics</li>
</ul>
<h2>1.8.0</h2>
<ul>
<li>Add <code>try_insert</code> API -- a version of <code>set</code> that returns a reference.</li>
</ul>
<h2>1.7.2</h2>
<ul>
<li>Improve code size when using parking_lot feature.</li>
</ul>
<h2>1.7.1</h2>
<ul>
<li>Fix <code>race::OnceBox<T></code> to also impl <code>Default</code> even if <code>T</code> doesn't impl <code>Default</code>.</li>
</ul>
<h2>1.7.0</h2>
<ul>
<li>Hide the <code>race</code> module behind (default) <code>race</code> feature.
Turns out that adding <code>race</code> by default was a breaking change on some platforms without atomics.
In this release, we make the module opt-out.
Technically, this is a breaking change for those who use <code>race</code> with <code>no_default_features</code>.
Given that the <code>race</code> module itself only several days old, the breakage is deemed acceptable.</li>
</ul>
<h2>1.6.0</h2>
<ul>
<li>Add <code>Lazy::into_value</code></li>
<li>Stabilize <code>once_cell::race</code> module for "first one wins" no_std-compatible initialization flavor.</li>
<li>Migrate from deprecated <code>compare_and_swap</code> to <code>compare_exchange</code>.</li>
</ul>
<h2>1.5.2</h2>
<ul>
<li><code>OnceBox</code> API uses <code>Box<T></code>.
This a breaking change to unstable API.</li>
</ul>
<h2>1.5.1</h2>
<ul>
<li>MSRV is increased to <code>1.36.0</code>.</li>
<li>document <code>once_cell::race</code> module.</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="c3a3ede16d"><code>c3a3ede</code></a> Merge <a href="https://github-redirect.dependabot.com/matklad/once_cell/issues/174">#174</a></li>
<li><a href="c3f11bb8bc"><code>c3f11bb</code></a> Bump version and add a changelog entry for parking_lot upgrade.</li>
<li><a href="8737ec3713"><code>8737ec3</code></a> Upgrade parking_lot.</li>
<li><a href="64ef4a0f32"><code>64ef4a0</code></a> Merge <a href="https://github-redirect.dependabot.com/matklad/once_cell/issues/172">#172</a></li>
<li><a href="99cc25cb93"><code>99cc25c</code></a> Switch badge to GitHub Actions and remove outdated file references</li>
<li><a href="68b2d76703"><code>68b2d76</code></a> Merge <a href="https://github-redirect.dependabot.com/matklad/once_cell/issues/169">#169</a></li>
<li><a href="abd4c788df"><code>abd4c78</code></a> Fix typo</li>
<li><a href="dd8ff8aeff"><code>dd8ff8a</code></a> Merge <a href="https://github-redirect.dependabot.com/matklad/once_cell/issues/168">#168</a></li>
<li><a href="7a5fca7b54"><code>7a5fca7</code></a> doc: fix a typo</li>
<li>See full diff in <a href="https://github.com/matklad/once_cell/compare/v1.9.0...v1.10.0">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=once_cell&package-manager=cargo&previous-version=1.9.0&new-version=1.10.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 is also related to #577
Changes:
- Implements `IteratorValue` (`IteratorResult::value()`)
- Implements `IteratorComplete` (`IteratorResult::complete()`)
- Implements `IteratorStep` (`IteratorRecord::step()`)
- Makes `IteratorNext` (`IteratorRecord::next()`) spec compliant
- Deprecates/removes `JsValue::get_field()`.
The ECMAScript 2022 specification removes the `toInteger` method, and replaces it with `toIntegerOrInfinity`, which is arguably better for us since the `JsValue::toInteger` returns an `f64`, which is pretty confusing at times.
This pull request removes the `JsValue::to_integer` method, replaces all its calls by `JsValue::to_integer_or_infinity` or others per the spec and documents several methods from the `string` builtin.
We store string `PropertyKey`s with two enums `String` and `Index` for performance reasons, but the spec does not differentiate between string and index property keys so before conversion to `JsValue` we have to convert to a string.
This was failing tests like `Reflect.ownKeys([true, "", 1])` because it was returning (integer numbers) `[1, 2, 3]` instead of `['1', '2', '3']`
Before the `%NativeError%` objects (like `TypeError`, `ReferenceError`, etc) `[[prototype]]` field was set to `Function.prototype` but this is wrong it should be the `Error` constructor object itself.
This makes the `%NativeError%`s 100% spec compliant :)
(except `AggregateError` because its not implemented)
This cleans up the vm stack on a function return. This is needed because when errors are thrown, there may be still values on the stack that cannot be cleaned up via regular control flow. The change should have little performance impact, because the `Vec::truncate` function does not alter the capacity of the vector.
This PR fixes the bug when passing `undefined` as radix in `Number.prototype.toString()` which was throwing a range error, instead of setting the radix to `10`
[spec](https://tc39.es/ecma262/#sec-number.prototype.tostring):
> **Note**
>
> The optional radix should be an [integral Number](https://tc39.es/ecma262/#integral-number) value in the inclusive range 2𝔽 to 36𝔽. If radix is undefined then 10𝔽 is used as the value of radix.
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.14.0 to 0.14.1.
<details>
<summary>Commits</summary>
<ul>
<li><a href="d7757f170d"><code>d7757f1</code></a> Bump versions</li>
<li><a href="a56acdc68a"><code>a56acdc</code></a> Fix dangling pointer in format_email.</li>
<li><a href="f6e90a79f6"><code>f6e90a7</code></a> Add support for zlib-ng</li>
<li><a href="c2a2613373"><code>c2a2613</code></a> Use cc 1.0.43 or later (<a href="https://github-redirect.dependabot.com/rust-lang/git2-rs/issues/608">#608</a>)</li>
<li><a href="97a855443f"><code>97a8554</code></a> Make the calls to <code>crate::init()</code> consistent (<a href="https://github-redirect.dependabot.com/rust-lang/git2-rs/issues/604">#604</a>)</li>
<li><a href="a9d86f4702"><code>a9d86f4</code></a> Add bindings for <code>git_index_version()</code> and <code>git_index_set_version()</code> (<a href="https://github-redirect.dependabot.com/rust-lang/git2-rs/issues/597">#597</a>)</li>
<li><a href="892dc1a9a1"><code>892dc1a</code></a> Bump versions</li>
<li><a href="e245130e5a"><code>e245130</code></a> Re-update libgit2 to master branch</li>
<li><a href="c19cc75de9"><code>c19cc75</code></a> Depend on latest libgit2-sys</li>
<li><a href="f89075b297"><code>f89075b</code></a> Bump versions</li>
<li>Additional commits viewable in <a href="https://github.com/rust-lang/git2-rs/compare/git2-curl-0.14.0...git2-curl-0.14.1">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=git2&package-manager=cargo&previous-version=0.14.0&new-version=0.14.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 Pull Request fixes/closes #1864.
It changes the following:
- Removed `JsBigInt` from `Const` nodes, using a boxed `BigInt` instead.
- Modifies the `JsObject` variant so that it has a similar structure to other variants, where the internal structure is private.
The size of `JsValue` stays in 2 64-bit words (in a 64-bit system at least), and the size of `Const` also stays the same.
I have noticed that we clone tokens too much in the parser, so I was thinking that we should implement a by-value getter for `kind()`. Something like `kind_unwrap()`.
This Pull Request is related to #1873.
It changes the following:
- Removes the panic in case a label is not found. I think this should be an early syntax error, but at least we shouldn't panic while we fix the issue with the labels.
I think we should solve the issue with labeled statements for 0.15.