This PR adds a safe wrapper around JavaScript `JsDate` from `builtins::date`, and is being tracked at #2098.
#### Implements following methods
- [x] `new Date()`
- [x] `Date.prototype.getDate()`
- [x] `Date.prototype.getDay()`
- [x] `Date.prototype.getFullYear()`
- [x] `Date.prototype.getHours()`
- [x] `Date.prototype.getMilliseconds()`
- [x] `Date.prototype.getMinutes()`
- [x] `Date.prototype.getMonth()`
- [x] `Date.prototype.getSeconds()`
- [x] `Date.prototype.getTime()`
- [x] `Date.prototype.getTimezoneOffset()`
- [x] `Date.prototype.getUTCDate()`
- [x] `Date.prototype.getUTCDay()`
- [x] `Date.prototype.getUTCFullYear()`
- [x] `Date.prototype.getUTCHours()`
- [x] `Date.prototype.getUTCMilliseconds()`
- [x] `Date.prototype.getUTCMinutes()`
- [x] `Date.prototype.getUTCMonth()`
- [x] `Date.prototype.getUTCSeconds()`
- [x] `Date.prototype.getYear()`
- [x] `Date.now()`
- [ ] `Date.parse()` Issue 4
- [x] `Date.prototype.setDate()`
- [x] `Date.prototype.setFullYear()`
- [ ] `Date.prototype.setHours()` Issue 3
- [x] `Date.prototype.setMilliseconds()`
- [ ] `Date.prototype.setMinutes()` Issue 3
- [x] `Date.prototype.setMonth()`
- [x] `Date.prototype.setSeconds()`
- [x] `Date.prototype.setTime()`
- [x] `Date.prototype.setUTCDate()`
- [x] `Date.prototype.setUTCFullYear()`
- [x] `Date.prototype.setUTCHours()`
- [x] `Date.prototype.setUTCMilliseconds()`
- [x] `Date.prototype.setUTCMinutes()`
- [x] `Date.prototype.setUTCMonth()`
- [x] `Date.prototype.setUTCSeconds()`
- [x] `Date.prototype.setYear()`
- [ ] `Date.prototype.toDateString()` Issue 5
- [ ] `Date.prototype.toGMTString()` Issue 5
- [ ] `Date.prototype.toISOString()` Issue 5
- [ ] `Date.prototype.toJSON()` Issue 5
- [ ] `Date.prototype.toLocaleDateString()` Issue 5 and 6
- [ ] `Date.prototype.toLocaleString()` Issue 5 and 6
- [ ] `Date.prototype.toLocaleTimeString()` Issue 5 and 6
- [ ] `Date.prototype.toString()` Issue 5
- [ ] `Date.prototype.toTimeString()` Issue 5
- [ ] `Date.prototype.toUTCString()` Issue 5
- [x] `Date.UTC()`
- [x] `Date.prototype.valueOf()`
### Issues
1. ~~`get_*()` and some other methods - They take `&self` as input internally, and internal struct shouldn't be used in a wrapper API. Therefore, these would require input to be `this: &JsValue, args: &[JsValue], context: &mut Context` like others and use `this_time_value()`?~~ Fixed using `this_time_value()`
2. ~~`to_string()`- how can I use `Date::to_string()` rather than `alloc::string::ToString`.~~ My bad it compiles, just `rust-analyzer` was showing it as an issue.
3. `set_hours()` and `set_minutes()` - they subtract local timezones when setting the value, e.g.
- On further look:
```rust
// both function call `builtins:📅:mod.rs#L1038
this.set_data(ObjectData::date(t));
// `ObjectData::date` creates a new `Date` object `object::mods.rs#L423
// | this date is chrono::Date<Tz(TimezoneOffset)> and Tz default is being used here which is GMT+0
pub fn date(date: Date) -> Self {
Self {
kind: ObjectKind::Date(date),
internal_methods: &ORDINARY_INTERNAL_METHODS,
}
}
```
- BTW, in `object::mod.rs`'s `enum ObjectKind` there is `Date(chrono::Date)` and it requires
the generic argument, how is it being bypassed here?
- Also in `set_minutes()` step 6, `LocalTime` should be used.
```rust
// reference date = 2000-01-01T06:26:53.984
date.set_hours(&[23.into(), 23.into(), 23.into(), 23.into()], context)?;
// would add tiemzone(+5:30) to it
// Is 2000-01-01T17:53:23.023
// Should be 2000-01-01T23:23:23.023
```
4. `parse()` - it uses `chrono::parse_from_rfc3339` internally, while es6 spec recommends ISO8601. And it can also parse other formats like from [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse) `04 Dec 1995 00:12:00 GMT` which fails. So what should be done about it.
5. `to_*()` - This is more general, as the internal date object uses `chrono::NaiveDateTime` which doesn't have timezone. It doesn't account for `+4:00` in example below.
```rust
// Creates new `Date` object from given rfc3339 string.
let date = JsDate::new_from_parse(&JsValue::new("2018-01-26T18:30:09.453+04:00"), context);
println!("to_string: {:?}", date2.to_string(context)?);
// IS: Sat Jan 27 2018 00:00:09 GMT+0530
// Should: Fri Jan 26 2018 20:00:09 GMT+0530
```
6. `to_locale_*()` - requires [`ToDateTimeOptions`](https://402.ecma-international.org/9.0/#sec-todatetimeoptions) and localization would require chrono's `unstable-locales` feature, which is available for `DateTime` and not for `NaiveDateTime`.
- I should have looked properly, `to_date_time_options` is already implemented in `builtins::intl`. Anyway, I would still need some tips on how to use it. What would function signature be like in wrapper API, how would `options` be passed to the said API.
- So `to_date_time_options()` takes `options: &JsValue` as an argument and build an object from it and fetch properties through `Object.get()`. If I want `options` to be `{ weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }` what would `JsValue` look like to make it all work.
```rust
date.to_locale_date_string(&[JsValue::new("en_EN"), OPTIONS], context)?;
// OPTIONS need to be a JsValue which when converted into an object
// have these properties { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
```
### Possible improvements
1. Right now, `object::jsdate::set_full_year()` and alike (input is a slice) are like below, `into()` doesn't feel ergonomic.
```rust
#[inline]
pub fn set_full_year(&self, values: &[JsValue], context: &mut Context) -> JsResult<JsValue> {
Date::set_full_year(&self.inner.clone().into(), values, context)
}
// Usage
date.set_full_year(&[2000.into(), 0.into(), 1.into()], context)?;
// How can something like this be made to work
#[inline]
pub fn set_full_year<T>(&self, values: &[T], context: &mut Context) -> JsResult<JsValue>
where
T: Into<JsValue>,
{
| expected reference `&[value::JsValue]`
| found reference `&[T]`
Date::set_full_year(&self.inner.clone().into(), values, context)
}
```
2. Any other suggestion?
Bumps [clap](https://github.com/clap-rs/clap) from 4.0.18 to 4.0.22.
<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.0.22</h2>
<h2>[4.0.22] - 2022-11-07</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> Don't overflow into next-line-help early due to stale (pre-v4) padding calculations</li>
</ul>
<h2>v4.0.21</h2>
<h2>[4.0.21] - 2022-11-07</h2>
<h3>Features</h3>
<ul>
<li><em>(derive)</em> <code>long_about</code> and <code>long_help</code> attributes, without a value, force using doc comment (before it wouldn't be set if there wasn't anything different than the short help)</li>
</ul>
<h2>v4.0.20</h2>
<h2>[4.0.20] - 2022-11-07</h2>
<h3>Fixes</h3>
<ul>
<li><em>(derive)</em> Allow defaulted value parser for '()' fields</li>
</ul>
<h2>v4.0.19</h2>
<h2>[4.0.19] - 2022-11-04</h2>
<h3>Features</h3>
<ul>
<li><code>ColorChoice</code> now implements <code>ValueEnum</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/clap-rs/clap/blob/master/CHANGELOG.md">clap's changelog</a>.</em></p>
<blockquote>
<h2>[4.0.22] - 2022-11-07</h2>
<h3>Fixes</h3>
<ul>
<li><em>(help)</em> Don't overflow into next-line-help early due to stale (pre-v4) padding calculations</li>
</ul>
<h2>[4.0.21] - 2022-11-07</h2>
<h3>Features</h3>
<ul>
<li><em>(derive)</em> <code>long_about</code> and <code>long_help</code> attributes, without a value, force using doc comment (before it wouldn't be set if there wasn't anything different than the short help)</li>
</ul>
<h2>[4.0.20] - 2022-11-07</h2>
<h3>Fixes</h3>
<ul>
<li><em>(derive)</em> Allow defaulted value parser for '()' fields</li>
</ul>
<h2>[4.0.19] - 2022-11-04</h2>
<h3>Features</h3>
<ul>
<li><code>ColorChoice</code> now implements <code>ValueEnum</code></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="6cbe5c4323"><code>6cbe5c4</code></a> chore: Release</li>
<li><a href="d2739c95cf"><code>d2739c9</code></a> docs: Update changelog</li>
<li><a href="eaa6bfe826"><code>eaa6bfe</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/clap-rs/clap/issues/4463">#4463</a> from epage/help</li>
<li><a href="dfe9e73880"><code>dfe9e73</code></a> fix(help): Update auto-next-line to use new padding</li>
<li><a href="539577dfb2"><code>539577d</code></a> refactor(help): Remove dead code</li>
<li><a href="bc457b179f"><code>bc457b1</code></a> chore: Release</li>
<li><a href="d5c3c13ec2"><code>d5c3c13</code></a> docs: Update changelog</li>
<li><a href="87edc19ef7"><code>87edc19</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/clap-rs/clap/issues/4461">#4461</a> from epage/help</li>
<li><a href="c37ab6c205"><code>c37ab6c</code></a> fix(derive): Allow 'long_help' to force populating from doc comment</li>
<li><a href="8751152316"><code>8751152</code></a> test(derive): Verify long_help behavior</li>
<li>Additional commits viewable in <a href="https://github.com/clap-rs/clap/compare/v4.0.18...v4.0.22">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.0.18&new-version=4.0.22)](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 [regex](https://github.com/rust-lang/regex) from 1.6.0 to 1.7.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/rust-lang/regex/blob/master/CHANGELOG.md">regex's changelog</a>.</em></p>
<blockquote>
<h1>1.7.0 (2022-11-05)</h1>
<p>This release principally includes an upgrade to Unicode 15.</p>
<p>New features:</p>
<ul>
<li>[FEATURE <a href="https://github-redirect.dependabot.com/rust-lang/regex/issues/832">#832</a>](<a href="https://github-redirect.dependabot.com/rust-lang/regex/issues/916">rust-lang/regex#916</a>):
Upgrade to Unicode 15.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f871a8eb1d"><code>f871a8e</code></a> 1.7.0</li>
<li><a href="ca7b99c647"><code>ca7b99c</code></a> changelog: 1.7.0</li>
<li><a href="ea3b132080"><code>ea3b132</code></a> regex-syntax-0.6.28</li>
<li><a href="9a1892737b"><code>9a18927</code></a> syntax: update to Unicode 15</li>
<li><a href="0d0023e412"><code>0d0023e</code></a> rure-0.2.2</li>
<li><a href="3bac5c8075"><code>3bac5c8</code></a> capi: add 'rlib' crate type</li>
<li><a href="159a63c85e"><code>159a63c</code></a> doc: add a note about the empty regex</li>
<li><a href="fc6f5ccc51"><code>fc6f5cc</code></a> readme: re-word usage to remove version number</li>
<li><a href="67824c7af2"><code>67824c7</code></a> ci: switch to dtolnay/rust-toolchain</li>
<li><a href="54660765af"><code>5466076</code></a> capi: fix 'unused return value' warnings</li>
<li>See full diff in <a href="https://github.com/rust-lang/regex/compare/1.6.0...1.7.0">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.6.0&new-version=1.7.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 [sys-locale](https://github.com/1Password/sys-locale) from 0.2.1 to 0.2.3.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/1Password/sys-locale/releases">sys-locale's releases</a>.</em></p>
<blockquote>
<h2>v0.2.3</h2>
<p>See <a href="https://github.com/1Password/sys-locale/blob/main/CHANGELOG.md#023---2022-11-06">the changelog</a> for details.</p>
<h2>v0.2.2</h2>
<p>See <a href="https://github.com/1Password/sys-locale/blob/main/CHANGELOG.md#022---2022-11-06">the changelog</a> for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/1Password/sys-locale/blob/main/CHANGELOG.md">sys-locale's changelog</a>.</em></p>
<blockquote>
<h2>[0.2.3] - 2022-11-06</h2>
<h3>Fixed</h3>
<ul>
<li>Re-release 0.2.2 and correctly maintain <code>no_std</code> compatibility on Apple targets.</li>
</ul>
<h2>[0.2.2] - 2022-11-06</h2>
<h3>Changed</h3>
<ul>
<li>The Apple backend has been rewritten in pure Rust instead of Objective-C.</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>The locale returned on UNIX systems is now always a correctly formatted BCP-47 tag.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="21a5596bb6"><code>21a5596</code></a> Release 0.2.3</li>
<li><a href="6717e5662a"><code>6717e56</code></a> Use manual CoreFoundation bindings instead of core-foundation-sys</li>
<li><a href="f4dee466cf"><code>f4dee46</code></a> Release 0.2.2</li>
<li><a href="db4471ebff"><code>db4471e</code></a> Convert CHANGELOG.md to LF line endings</li>
<li><a href="a35c485c10"><code>a35c485</code></a> Update CHANGELOG</li>
<li><a href="ad29e24f7b"><code>ad29e24</code></a> Rewrite Apple locale fetching in pure Rust</li>
<li><a href="e76d9c55d1"><code>e76d9c5</code></a> Improve locale fetching tests</li>
<li><a href="29f4f2582b"><code>29f4f25</code></a> Fix implementation for Linux</li>
<li><a href="7c58f80849"><code>7c58f80</code></a> Fix cross-compiling CI</li>
<li>See full diff in <a href="https://github.com/1Password/sys-locale/compare/v0.2.1...v0.2.3">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=sys-locale&package-manager=cargo&previous-version=0.2.1&new-version=0.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>
Bumps [test262](https://github.com/tc39/test262) from `85373b4` to `f6c48f3`.
<details>
<summary>Commits</summary>
<ul>
<li><a href="f6c48f333e"><code>f6c48f3</code></a> Update Intl tests to recognize microsecond and nanosecond as sanctioned</li>
<li><a href="5d8ebdff05"><code>5d8ebdf</code></a> Improve documentation for assert.compareIterator.</li>
<li><a href="745f3c01aa"><code>745f3c0</code></a> Add more tests for duplicated named capture groups.</li>
<li><a href="54c9ff9084"><code>54c9ff9</code></a> Rename duplicate-names.js.</li>
<li><a href="c3c6c86663"><code>c3c6c86</code></a> Fix some esids.</li>
<li><a href="9e1907e5f7"><code>9e1907e</code></a> Unicode case-folding tests</li>
<li><a href="c44d82c370"><code>c44d82c</code></a> Add <code>/iu</code> Unicode case folding tests</li>
<li><a href="27063ae219"><code>27063ae</code></a> Duplicate named capture groups: .groups and .indices.groups objects</li>
<li><a href="fabb1fd379"><code>fabb1fd</code></a> Duplicate named capture groups: Fix match arrays</li>
<li><a href="d77d9b2b85"><code>d77d9b2</code></a> Duplicate named capture groups: Syntax tests</li>
<li>Additional commits viewable in <a href="85373b4ce1...f6c48f333e">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 offers a fuzzer which is capable of detecting faults in the parser and interner. It does so by ensuring that the parsed AST remains the same between a parsed source and the result of parsing the `to_interned_string` result of the first parsed source.
It changes the following:
- Adds a fuzzer for the parser and interner.
Any issues I raise in association with this fuzzer will link back to this fuzzer.
You may run the fuzzer using the following commands:
```bash
$ cd boa_engine
$ cargo +nightly fuzz run -s none parser-idempotency
```
Co-authored-by: Addison Crump <addison.crump@cispa.de>
This PR adds an `OrAbrupt` trait, with the `or_abrupt()` function. This function is equivalent to the previous `?.ok_or(ParseError::AbruptEnd)`, but it's cleaner. It's implemented for the parser cursor results types.
It also adds an `advance()` function to the parser cursor (which might be possible to optimize further), that just advances the cursor without returning any token. This shows a clearer intent in many places where it's being used.
I also used `ParseResult` in more places, since we were not using it in many places.
This PR rewrites some patterns of the `JsString` implementation in order to pass all its miri tests. This can be verified by running:
```bash
cargo +nightly miri test -p boa_engine string::tests -- --skip builtins --skip parser
```
Basically, we were doing two operations that were Undefined Behaviour per the [Stacked Borrows](https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md) model:
- Casting `&JsString` to `&mut RawJsString` to `&[u16]`. The intermediate mutable borrow must not exist, or Miri considers this as Undefined Behaviour.
- Trying to access `RawJsString.data` using the dot operator. Miri complains with `this is a zero-size retag ([0x10..0x10]) so the tag in question does not exist anywhere`. To fix this, we can recompute the position of `data` every time we want to access it.
This PR rewrites all syntax-directed operations that find declared names and variables using visitors.
Hopefully, this should be the last step before finally being able to separate the parser from the engine.
I checked the failing [tests](85373b4ce1/test/language/statements/for-await-of/async-gen-decl-dstr-obj-prop-elem-target-yield-expr.js (L49)) and they're apparently false positives, since they return `Promise { <rejected> ReferenceError: x is not initialized }` on the main branch.
Right now our promises print `{ }` on display. This PR improves a bit the display and ergonomics of promises in general. Now, promises will print...
- When pending: `Promise { <pending> }`
- When fulfilled: `Promise { "hi" }`
- When rejected: `Promise { <rejected> ReferenceError: x is not initialized }`
So, there were some tests that weren't reporting the result of async evaluations correctly. This PR fixes this. It also ignores tests with the `IsHTMLDDA` feature, since we haven't implemented it.
On another note, this also changes the symbols of the test suite to 'F' (failed) and '-' (ignored), which is clearer for colorless terminals.
This Pull Request updates the codebase to the newest version of rustc (1.65.0).
It changes the following:
- Bumps `rust-version` to 1.65.0.
- Rewrites some snippets to use the new let else, ok_or_else and some other utils.
- Removes the `rustdoc::missing_doc_code_examples` allow lint from our codebase. (Context: https://github.com/rust-lang/rust/pull/101732)
This Pull Request fixes#1805.
It changes the following:
- Implement async arrow function parsing and execution.
- Handle special case when a function expressions binding identifier need to be bound in the function body.
- Implement special silent ignored assignment for the above case.
- Fix issue with getting the correct promise capability for function returns.
- Complete function object `toString` todo.
I will fix the two failing assignmenttargettype tests in a follow up PR.
This Pull Request replaces `contains`, `contains_arguments`, `has_direct_super` and `function_contains_super` with visitors. (~1000 removed lines!)
Also, the new visitor implementation caught a bug where we weren't setting the home object of async functions, generators and async generators for methods of classes, which caused a stack overflow on `super` calls, and I think that's pretty cool!
Next is `var_declared_names`, `lexically_declared_names` and friends, which will be on another PR.
This should hopefully improve our compilation times, both from a clean build and from an incremental compilation snapshot.
Next would be the parser, but it imports `Context`, so it'll require a bit more work.
The number of file changes is obviously big, but almost nothing was changed, I just moved everything to another crate and readjusted the imports of the `parser` module. (Though, I did have to change some details, because there were some functions on the ast that returned `ParseError`s, and the tests had to be moved to the parser)
This Pull Request closes no specific issue, but allows for analysis and post-processing passes by both internal and external developers.
It changes the following:
- Adds a Visitor trait, to be implemented by visitors of a particular node type.
- Adds `Type`Visitor traits which offer access to private members of a node.
- Adds an example which demonstrates the use of Visitor traits by walking over an AST and printing its contents.
At this time, the PR is more of a demonstration of intent rather than a full PR. Once it's in a satisfactory state, I'll mark it as not a draft.
Co-authored-by: Addison Crump <addison.crump@cispa.de>
This Pull Request implements `delete` for variable references:
```Javascript
x = 5;
console.log(x) // 5;
delete x;
console.log(x) // ReferenceError
```
It changes the following:
- Implements delete for references.
- Fixes tests related to deletions of function definitions inside `eval`.
- Implements an op to throw an error on super property deletion.
This puts us at a conformance of 97.98% for the `test/language/expressions/delete` suite. The last 2 failing tests are related to `with` statements ([11.4.1-4.a-5.js](b5d3192914/test/language/expressions/delete/11.4.1-4.a-5.js (L1)) and [11.4.1-4.a-6.js](b5d3192914/test/language/expressions/delete/11.4.1-4.a-6.js (L18))).
Bumps [once_cell](https://github.com/matklad/once_cell) from 1.15.0 to 1.16.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>
<h2>1.16.0</h2>
<ul>
<li>Add <code>no_std</code> implementation based on <code>critical-section</code>,
<a href="https://github-redirect.dependabot.com/matklad/once_cell/pull/195">#195</a>.</li>
<li>Deprecate <code>atomic-polyfill</code> feature (use the new <code>critical-section</code> instead)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="18e47d7308"><code>18e47d7</code></a> Merge <a href="https://github-redirect.dependabot.com/matklad/once_cell/issues/206">#206</a></li>
<li><a href="06ff1bd31f"><code>06ff1bd</code></a> publish 1.16.0</li>
<li><a href="04e1d59ce7"><code>04e1d59</code></a> Merge <a href="https://github-redirect.dependabot.com/matklad/once_cell/issues/204">#204</a></li>
<li><a href="32ba3f8aa8"><code>32ba3f8</code></a> clarify MSRV</li>
<li><a href="0ebafa5d2f"><code>0ebafa5</code></a> Merge <a href="https://github-redirect.dependabot.com/matklad/once_cell/issues/203">#203</a></li>
<li><a href="cb85e6b8b8"><code>cb85e6b</code></a> publish 1.16.0-pre.1</li>
<li><a href="b56e329d70"><code>b56e329</code></a> Merge <a href="https://github-redirect.dependabot.com/matklad/once_cell/issues/195">#195</a></li>
<li><a href="7d9afdb9d7"><code>7d9afdb</code></a> Add comment explaining <code>Mutex\<unsync::OnceCell></code>.</li>
<li><a href="32dada4dbe"><code>32dada4</code></a> Fix features.</li>
<li><a href="23d129038f"><code>23d1290</code></a> Decrease <code>critical-section</code> version.</li>
<li>Additional commits viewable in <a href="https://github.com/matklad/once_cell/compare/v1.15.0...v1.16.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.15.0&new-version=1.16.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 [test262](https://github.com/tc39/test262) from `b5d3192` to `85373b4`.
<details>
<summary>Commits</summary>
<ul>
<li><a href="85373b4ce1"><code>85373b4</code></a> Temporal: Fix PlainDateTime construct args</li>
<li><a href="ade328d530"><code>ade328d</code></a> Fix toSpliced mutate-while-iterating test</li>
<li><a href="c15d4bef28"><code>c15d4be</code></a> Add missing include to WeakSet/iterable-with-symbol-values</li>
<li>See full diff in <a href="b5d3192914...85373b4ce1">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>
Fixes#1917 (fixes the code example given with the hashes)
Fixes the order dependent execution of assignment, so the following code works correctly:
```javascript
function f(x) { console.log(x) } // used to check the order of execution
let a = [[]]
(f(1), a)[(f(2), 0)][(f(3), 0)] = (f(4), 123) // 🤮
```
Prints out:
```bash
1
2
3
4
123
```
As expected
This introduces some opcodes:
- ~~`Swap3`: currently used only to keep some previous code working that needs refactoring.~~
- ~~`RotateRight n`: Rotates the `n` top values from the top of the stack to the right by `1`.~~ Already added by #2390
~~Besides the new opcodes,~~ Some opcodes pop and push order of values on the stack have been changed. To eliminate many swaps and to make this change easier.
~~This PR is still a WIP and needs more refactoring~~
This is now ready for review/merge :)
This Pull Request implements optional chains.
Example:
```Javascript
const adventurer = {
name: 'Alice',
cat: {
name: 'Dinah'
}
};
console.log(adventurer.cat?.name); // Dinah
console.log(adventurer.dog?.name); // undefined
```
Since I needed to implement `Opcode::RotateLeft`, and #2378 had an implementation for `Opcode::RotateRight`, I took the opportunity to integrate both ops into this PR (big thanks to @HalidOdat for the original implementation!).
This PR almost has 100% conformance for the `optional-chaining` test suite. However, there's this one [test](85373b4ce1/test/language/expressions/optional-chaining/member-expression.js) that can't be solved until we properly set function names for function expressions in object and class definitions.
<!---
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 is related to #2098.
It changes the following:
- Implements a wrapper for the `Generator` built-in object
- Adds to some of the documentation across the builtin wrappers with the goal of trying to clean up the documentation by making it a bit more consistent [on boa's docs](https://boa-dev.github.io/boa/doc/boa_engine/object/builtins/index.html)
This Pull Request allows collisions of var declarations with already existing lexical bindings if the `eval` call is strict or occurs within strict code. In short, it allows:
```Javascript
{
let x;
{
eval('"use strict"; var x;');
}
}
```
and
```Javascript
"use strict";
{
let x;
{
eval('var x;');
}
}
```
This is valid since in strict code all `eval` calls get their own function environment, making it impossible to declare a new var in the outer function environment. This change also skips poisoning environments on strict code, because `eval` cannot add new declarations for the current environment in that situation.
The documentation page of our blog is a whooping 532 MB in size. This is because we're uploading the whole documentation of all our deps instead of only our crates. This PR modifies our CI to only upload a lightweight version of our documentation, which excludes all deps (replaces all hyperlinks with crates.io links) and only builds our crates docs. This brings the total size of our docs down to 87 MB.
This Pull Request implements member accessors in `for ... in` and `for ... of` loops. This unlocks patterns like:
```Javascript
let obj = {a: 0, b: 1};
for (obj.a of [1,2,3]) {
}
console.log(obj.a) // 3
```
This updates the Code of Conduct to the Contributor Covenant v2.1 version (we were using the 2.0 version until now). Changes are very minor. As far as I can tell, the only content difference is the explicit mention of _caste_ and _color_ among the potential traits that could cause harassment.
Then it just changes the format a bit to make links a bit more user friendly, by not posting URLs directly.
But I have a question: should we update the contact method? It currently says the following:
> Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [discord](https://discord.gg/tUFFk9Y) by contacting _JaseW_.
Maybe we should mention the `@boa-dev` group, and that they can contact anyone there. What do you think? I would also like to update this before https://github.com/boa-dev/ryu-js/pull/22
Currently we run 7 different jobs:
- tests linux
- tests macos
- tests windows
- rustfmt
- clippy
- examples
- documentation
With this change I reduced them to 4 and hopefully sped them up.
The total execution time is limited by the tests, especially linux that calculates coverage. Having separate jobs for clippy and rustfmt (which take a very small amount of time) is a waste of energy.
With this PR:
Introduced a new cargo profile, `ci`, that should create smaller sized binaries and reduce the our cache usage.
I changed the test runner for macos and windows to [nextest](https://nexte.st/), which should be faster and is specifically designed for CI.
I merged all smaller tasks in a single job, misc, the steps clearly identify what is being tested so it shouldn't affect clarity.
Switched to using the [rust-cache](https://github.com/Swatinem/rust-cache) GH action, this simplifies our work by no longer having to worry about which directories to cache, rust-cache handles all that for us.
~~The bors task should also be modified, I'll get to it as soon as I have time. I believe it should be possible for us to have a single workflow described and have it both be the normal CI and the bors test.~~
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.145 to 1.0.147.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/serde-rs/serde/releases">serde's releases</a>.</em></p>
<blockquote>
<h2>v1.0.147</h2>
<ul>
<li>Add <code>serde:🇩🇪:value::EnumAccessDeserializer</code> which transforms an <code>EnumAccess</code> into a <code>Deserializer</code> (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2305">#2305</a>)</li>
</ul>
<h2>v1.0.146</h2>
<ul>
<li>Allow internally tagged newtype variant to contain unit (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2303">#2303</a>, thanks <a href="https://github.com/tage64"><code>@tage64</code></a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="f41509261e"><code>f415092</code></a> Release 1.0.147</li>
<li><a href="6d009711a2"><code>6d00971</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2305">#2305</a> from serde-rs/enumaccessdeserializer</li>
<li><a href="354b48fd40"><code>354b48f</code></a> Add EnumAccessDeserializer to turn EnumAccess into a Deserializer</li>
<li><a href="3fd8e52f0c"><code>3fd8e52</code></a> Release 1.0.146</li>
<li><a href="142dce0d3d"><code>142dce0</code></a> Touch up PR 2303</li>
<li><a href="6aed101630"><code>6aed101</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2303">#2303</a> from tage64/master</li>
<li><a href="e2ccfd9ea7"><code>e2ccfd9</code></a> Remove bad deserialization from sequence to internally tagged newtype variant...</li>
<li><a href="a07d794f74"><code>a07d794</code></a> Update test_suite/tests/test_annotations.rs</li>
<li><a href="90d28fc314"><code>90d28fc</code></a> Serialize and deserialize a tagged newtype variant over unit () as if it was ...</li>
<li><a href="55cf0ac51a"><code>55cf0ac</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2297">#2297</a> from serde-rs/output</li>
<li>Additional commits viewable in <a href="https://github.com/serde-rs/serde/compare/v1.0.145...v1.0.147">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.145&new-version=1.0.147)](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_yaml](https://github.com/dtolnay/serde-yaml) from 0.9.13 to 0.9.14.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/dtolnay/serde-yaml/releases">serde_yaml's releases</a>.</em></p>
<blockquote>
<h2>0.9.14</h2>
<ul>
<li>Implement <code>Deserializer</code> for <code>TaggedValue</code> and <code>&TaggedValue</code> (<a href="https://github-redirect.dependabot.com/dtolnay/serde-yaml/issues/339">#339</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="8948d368c0"><code>8948d36</code></a> Release 0.9.14</li>
<li><a href="8d95125eed"><code>8d95125</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/dtolnay/serde-yaml/issues/339">#339</a> from dtolnay/deserializertaggedvalue</li>
<li><a href="371f764d32"><code>371f764</code></a> Implement Deserializer for TaggedValue and &TaggedValue</li>
<li><a href="c5523fe475"><code>c5523fe</code></a> Replace nonstandard SError name used only in Value Deserialize</li>
<li><a href="516fdff567"><code>516fdff</code></a> Ignore uninlined_format_args pedantic clippy lint</li>
<li><a href="31fa98e396"><code>31fa98e</code></a> Pull in unsafe-libyaml 0.2.4</li>
<li>See full diff in <a href="https://github.com/dtolnay/serde-yaml/compare/0.9.13...0.9.14">compare view</a></li>
</ul>
</details>
<br />
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde_yaml&package-manager=cargo&previous-version=0.9.13&new-version=0.9.14)](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 [boa-dev/criterion-compare-action](https://github.com/boa-dev/criterion-compare-action) from 3.2.3 to 3.2.4.
<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.2.4</h2>
<p>This release fixes an issue that could happen in some cases when checking out the base branch. It also updates dependencies.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="adfd3a9463"><code>adfd3a9</code></a> Bumped version number</li>
<li><a href="ad09f21939"><code>ad09f21</code></a> Fixing git checkout error (<a href="https://github-redirect.dependabot.com/boa-dev/criterion-compare-action/issues/79">#79</a>)</li>
<li><a href="421db6a51d"><code>421db6a</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/boa-dev/criterion-compare-action/issues/78">#78</a> from boa-dev/dependabot/github_actions/actions/setup-n...</li>
<li><a href="aaf4259b7b"><code>aaf4259</code></a> Bump actions/setup-node from 3.4.1 to 3.5.1</li>
<li>See full diff in <a href="https://github.com/boa-dev/criterion-compare-action/compare/v3.2.3...v3.2.4">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.2.3&new-version=3.2.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
</details>
Bumps [test262](https://github.com/tc39/test262) from `ee7c379` to `b5d3192`.
<details>
<summary>Commits</summary>
<ul>
<li><a href="b5d3192914"><code>b5d3192</code></a> Temporal: Test Calendar.p.mergeFields enumeration changes</li>
<li><a href="99bc91e0f5"><code>99bc91e</code></a> Temporal: Test change from MergeLargestUnitOption to CopyDataProperties</li>
<li><a href="dfbeca3c79"><code>dfbeca3</code></a> Temporal: Fix mergeFields test for non-string keys</li>
<li><a href="d59d28defa"><code>d59d28d</code></a> Meta: Add GraalJS issue reporting link</li>
<li><a href="4161042bf7"><code>4161042</code></a> Upgrade esvu</li>
<li><a href="1f59bf5911"><code>1f59bf5</code></a> Temporal: Add tests for fast path in ToTemporalTimeZone</li>
<li><a href="34805283d9"><code>3480528</code></a> Temporal: Add tests for fast path in ToTemporalCalendar</li>
<li><a href="fefa14c285"><code>fefa14c</code></a> Temporal: Clarify names of some time zone tests</li>
<li><a href="5a858cc0c4"><code>5a858cc</code></a> Add missing includes to toSorted/toReversed this-value-invalid.js tests</li>
<li><a href="6f4601d095"><code>6f4601d</code></a> Add "Change Array by Copy" tests (stage 3) (<a href="https://github-redirect.dependabot.com/tc39/test262/issues/3464">#3464</a>)</li>
<li>Additional commits viewable in <a href="ee7c379375...b5d3192914">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>
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel neccesary.
--->
Just a small fix to a typo in the comment on the PR template 😄
In most cases, the `ToInternedString` was just calling `self.to_indented_string(interner, 0)`. This avoids all this duplicate code by adding a new trait, `ToIndentedString`. Any type implementing that automatically implements `ToInternedString`.
I have also added a bunch of `#[inline]` in one-liners, and some one-line documentations for some functions.
I have noticed that we also use `contains()` and `contains_arguments()` a lot. Would it make sense to create traits for this?
<!---
Thank you for contributing to Boa! Please fill out the template below, and remove or add any
information as you feel necessary.
--->
Hi!
This isn't really related to a pull request that I know of. I was trying to better wrap my head around Boa's VM and thought I'd break it apart so that the file wasn't 2500+ lines. I figured I'd submit it as a draft and get feedback/see if anyone was interested in it. The way the modules were broken apart was primarily based off the opcode name (`GetFunction` & `GetFunctionAsync` -> `./get/function.rs`).
It changes the following:
- Adds an `Operation` trait to opcode/mod.rs
- Implements `Operation` for each Opcode variant, moving the executable instruction code from `vm/mod.rs` to the respective module
Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
This Pull Request changes the following:
- Fix error in `Proxy` set implementation
After this all other failing `Proxy` tests fail because of us missing the `with` implementation.
Co-authored-by: RageKnify <RageKnify@gmail.com>
This Pull Request changes the following:
- Implements the `LabelledStatement` Parse node.
- Removes `label` from all label-able items (switch, blocks and loop statements).
- Adjusts parsing to the new AST.
#2295 isn't fixed by this, but with this change it should be easier to fix.
Boa's `Context::eval()` and `Context::parse()` functions allow reading a byte slice directly, apart from a string. We were not showing this properly in our examples, so this modifies the `loadfile.rs` example to use a byte vector instead of a string, which allows us to use UTF-16 files, if I'm not mistaken.