mirror of https://github.com/boa-dev/boa.git
Tree:
f8b682085d
add-vhs-ci
benchmarks
control-flow-graph
expect-lints
feature/node_span
feature/snapshot
features
gh-readonly-queue/main/pr-2877-b0ddf5eed00a53281d67fc7d846233fc0d99ce9c
gh-readonly-queue/main/pr-3144-8e48cec73fae708420b9af88813d4870243c491a
main
nan-boxing
optimization/static-shapes
real_conformance
reduce-environment-allocations
refactor/interner
refactor/register-vm
release-0.20
releases/0.17
releases/0.19
semver_checks
tco
utility-crate
wasm-debugger
nightly
v0.10
v0.11
v0.12
v0.13
v0.14
v0.15
v0.16
v0.17
v0.17.1
v0.17.2
v0.17.3
v0.18
v0.19
v0.19.1
v0.2.0
v0.2.1
v0.3.0
v0.4.0
v0.5.0
v0.5.1
v0.6.0
v0.7.0
v0.8.0
v0.9.0
${ noResults }
2045 Commits (f8b682085d7fe0bbfcd0333038e93cf2f5aee710)
Author | SHA1 | Message | Date |
---|---|---|---|
dependabot[bot] | 41d57f49e2 |
Bump clap from 4.0.22 to 4.0.23 (#2435)
Bumps [clap](https://github.com/clap-rs/clap) from 4.0.22 to 4.0.23. <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.23</h2> <h2>[4.0.23] - 2022-11-11</h2> <h3>Fixes</h3> <ul> <li>Don't panic on reporting invalid-long errors when followed by invalid UTF8</li> <li><em>(help)</em> Clarified argument to <code>help</code> subcommand</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.23] - 2022-11-11</h2> <h3>Fixes</h3> <ul> <li>Don't panic on reporting invalid-long errors when followed by invalid UTF8</li> <li><em>(help)</em> Clarified argument to <code>help</code> subcommand</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 4493254de7 |
Bump chrono from 0.4.22 to 0.4.23 (#2436)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.22 to 0.4.23. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/chronotope/chrono/releases">chrono's releases</a>.</em></p> <blockquote> <p>0.4.23 is the next 0.4 release of the popular chrono date and time library for Rust. After the 0.4.20-0.4.22 series that brought chrono back to life after a long hiatus, development has been fairly quiet, allowing us to start planning changes for the 0.5.0 release. As such, we've started deprecating some APIs that are likely to be removed in 0.5. If you have any feedback on these changes, please let us know in the issue tracker!</p> <h3>Deprecations</h3> <ul> <li>Deprecate methods that have an <code>_opt()</code> alternative (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/827">#827</a>)</li> <li>Deprecate usage of the <code>Date<Tz></code> type (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/851">#851</a>)</li> </ul> <h3>Features</h3> <ul> <li>Optimize RFC 3339 (and RFC 2822) encoding (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/844">#844</a>, thanks to <a href="https://github.com/conradludgate"><code>@conradludgate</code></a>)</li> <li>Addition and subtraction with the <code>Days</code> type (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/784">#784</a>)</li> <li>Add <code>NaiveDateTime::from_timestamp_millis(_opt)</code> (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/818">#818</a>, thanks to <a href="https://github.com/Pscheidl"><code>@Pscheidl</code></a> -- backported in <a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/823">#823</a>)</li> <li>Allow for changing TZ variable and cache it for <code>Local</code> timezone (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/853">#853</a>)</li> <li>Add optional support for the <code>arbitrary::Arbitrary</code> trait (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/849">#849</a>, thanks to <a href="https://github.com/greyblake"><code>@greyblake</code></a> and <a href="https://github.com/asayers"><code>@asayers</code></a>)</li> </ul> <h3>Fixes</h3> <ul> <li>Support tzdb location on AIX (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/826">#826</a>)</li> <li>Fix warnings in documentation (<a href="https://github-redirect.dependabot.com/chronotope/chrono/issues/847">#847</a>)</li> </ul> <p>On behalf of <a href="https://github.com/esheppa"><code>@esheppa</code></a> and <a href="https://github.com/djc"><code>@djc</code></a>, thanks to all contributors!</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | fcab8051d4 |
Bump css-loader from 6.7.1 to 6.7.2 (#2434)
Bumps [css-loader](https://github.com/webpack-contrib/css-loader) from 6.7.1 to 6.7.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/webpack-contrib/css-loader/releases">css-loader's releases</a>.</em></p> <blockquote> <h2>v6.7.2</h2> <h3><a href="https://github.com/webpack-contrib/css-loader/compare/v6.7.1...v6.7.2">6.7.2</a> (2022-11-13)</h3> <h3>Bug Fixes</h3> <ul> <li>css modules generation with inline syntax (<a href="https://github-redirect.dependabot.com/webpack-contrib/css-loader/issues/1480">#1480</a>) (<a href=" |
2 years ago |
dependabot[bot] | e8e95f2311 |
Bump test262 from `f6c48f3` to `1d5dc6b` (#2437)
Bumps [test262](https://github.com/tc39/test262) from `f6c48f3` to `1d5dc6b`. <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
João Borges | c2dd0271d0 |
Switch tarpaulin to llvm engine (#2432)
Trying this to see if it makes coverage numbers more accurate |
2 years ago |
José Julián Espina | fdac8ece5b |
Fix some Date tests (#2431)
Found some tests on the `Date` builtin that were failing for incorrect length attributes and missing checks. |
2 years ago |
dependabot[bot] | 2362f7353c |
Bump webpack from 5.74.0 to 5.75.0 (#2427)
Bumps [webpack](https://github.com/webpack/webpack) from 5.74.0 to 5.75.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.75.0</h2> <h1>Bugfixes</h1> <ul> <li><code>experiments.*</code> normalize to <code>false</code> when opt-out</li> <li>avoid <code>NaN%</code></li> <li>show the correct error when using a conflicting chunk name in code</li> <li>HMR code tests existance of <code>window</code> before trying to access it</li> <li>fix <code>eval-nosources-*</code> actually exclude sources</li> <li>fix race condition where no module is returned from processing module</li> <li>fix position of standalong semicolon in runtime code</li> </ul> <h1>Features</h1> <ul> <li>add support for <code>@import</code> to extenal CSS when using experimental CSS in node</li> <li>add <code>i64</code> support to the deprecated WASM implementation</li> </ul> <h1>Developer Experience</h1> <ul> <li>expose <code>EnableWasmLoadingPlugin</code></li> <li>add more typings</li> <li>generate getters instead of readonly properties in typings to allow overriding them</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | 6eff7ca00e |
Handle `__proto__` fields in object literals (#2423)
This Pull Request changes the following: - Handle `__proto__` fields in object literals |
2 years ago |
Anuvrat | 70f73b45d8 |
Safe wrapper for `JsDate` (#2181)
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? |
2 years ago |
dependabot[bot] | 2ffae5b6f3 |
Bump loader-utils from 2.0.2 to 2.0.3 (#2421)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.2 to 2.0.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/webpack/loader-utils/releases">loader-utils's releases</a>.</em></p> <blockquote> <h2>v2.0.3</h2> <h3><a href="https://github.com/webpack/loader-utils/compare/v2.0.1...v2.0.3">2.0.3</a> (2022-10-20)</h3> <h3>Bug Fixes</h3> <ul> <li><strong>security:</strong> prototype pollution exploit (<a href="https://github-redirect.dependabot.com/webpack/loader-utils/issues/217">#217</a>) (<a href=" |
2 years ago |
dependabot[bot] | 7f1a7aeac9 |
Bump clap from 4.0.18 to 4.0.22 (#2419)
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=" |
2 years ago |
dependabot[bot] | e1f90a8025 |
Bump regex from 1.6.0 to 1.7.0 (#2418)
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=" |
2 years ago |
dependabot[bot] | a7a51d2411 |
Bump benchmark-action/github-action-benchmark from 1.14.0 to 1.15.0 (#2417)
Bumps [benchmark-action/github-action-benchmark](https://github.com/benchmark-action/github-action-benchmark) from 1.14.0 to 1.15.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/benchmark-action/github-action-benchmark/releases">benchmark-action/github-action-benchmark's releases</a>.</em></p>
<blockquote>
<h2>v1.15.0</h2>
<ul>
<li><strong>Feat:</strong> Add support for Java via JMH (<a href="https://github-redirect.dependabot.com/benchmark-action/github-action-benchmark/issues/134">#134</a>)</li>
<li><strong>Chore:</strong> Update <code>@actions/core</code>, <code>@actions/exec</code> and <code>@actions/io</code> to the latest version (<a href="https://github-redirect.dependabot.com/benchmark-action/github-action-benchmark/issues/137">#137</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/benchmark-action/github-action-benchmark/blob/master/CHANGELOG.md">benchmark-action/github-action-benchmark's changelog</a>.</em></p>
<blockquote>
<h1><a href="https://github.com/benchmark-action/github-action-benchmark/releases/tag/v1.15.0">v1.15.0</a> - 03 Nov 2022</h1>
<ul>
<li><strong>Feat</strong> Add support for Java via JMH (<a href="https://github-redirect.dependabot.com/benchmark-action/github-action-benchmark/issues/134">#134</a>)</li>
<li><strong>Chore</strong> Update <code>@actions/core</code>, <code>@actions/exec</code> and <code>@actions/io</code> to the latest version (<a href="https://github-redirect.dependabot.com/benchmark-action/github-action-benchmark/issues/137">#137</a>)</li>
</ul>
<p><!-- raw HTML omitted --><!-- raw HTML omitted --></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="
|
2 years ago |
dependabot[bot] | fe280ec268 |
Bump sys-locale from 0.2.1 to 0.2.3 (#2420)
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=" |
2 years ago |
raskad | 6c7240195a |
Add early error for `yield` in `GeneratorExpression` parameters (#2413)
This Pull Request changes the following: - Add early error for `yield` in `GeneratorExpression` parameters |
2 years ago |
dependabot[bot] | bc61243351 |
Bump test262 from `85373b4` to `f6c48f3` (#2414)
Bumps [test262](https://github.com/tc39/test262) from `85373b4` to `f6c48f3`. <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Addison Crump | e64a20e2a6 |
Parser Idempotency Fuzzer (#2400)
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> |
2 years ago |
José Julián Espina | b88736a5c9 |
Extract the parser into a crate (#2409)
Depends on #2408. This finally separates parsing from execution, which should make compilations a bit faster. |
2 years ago |
Iban Eguia Moraza | 23f0335bf1 |
Reduced boilerplate code in the parser (#2410)
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. |
2 years ago |
José Julián Espina | 8a664f2f24 |
Make `JsString` conform to miri tests (#2412)
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. |
2 years ago |
José Julián Espina | 8e14d76893 |
Rewrite scope analysis operations using visitors (#2408)
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](
|
2 years ago |
José Julián Espina | aad78154cf |
Pretty print promise objects (#2407)
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 }` |
2 years ago |
José Julián Espina | 73d23ead7f |
Fix async tests result values (#2406)
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. |
2 years ago |
José Julián Espina | 91235c77fe |
Rewrite some patterns with let-else and ok_or_else (#2404)
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) |
2 years ago |
raskad | dc3b09a001 |
Implement async arrow functions (#2393)
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. |
2 years ago |
José Julián Espina | 49a58675cc |
Replace `contains` and friends with visitors (#2403)
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. |
2 years ago |
José Julián Espina | b4da172f91 |
Extract the ast to a crate (#2402)
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) |
2 years ago |
Addison Crump | b5b8cdfa18 |
Implement AST Visitor pattern (attempt #3) (#2392)
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> |
2 years ago |
José Julián Espina | c72e4c20c9 |
Implement delete for references (#2395)
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]( |
2 years ago |
dependabot[bot] | 6c70dd6243 |
Bump once_cell from 1.15.0 to 1.16.0 (#2396)
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=" |
2 years ago |
dependabot[bot] | 8c58339b38 |
Bump test262 from `b5d3192` to `85373b4` (#2397)
Bumps [test262](https://github.com/tc39/test262) from `b5d3192` to `85373b4`. <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Halid Odat | bc2dd9c4bd |
Fix order dependent execution in assignment. (#2378)
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 :) |
2 years ago |
José Julián Espina | 18824baba8 |
Generate `Opcode` impl using macro (#2391)
This reduces a lot of the repetition from the `Opcode` functions and makes it easier to add a new Op. |
2 years ago |
José Julián Espina | 4b892a931d |
Implement optional chains (#2390)
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](
|
2 years ago |
raskad | f446c0970f |
Remove invalid optimization in addition (#2387)
This Pull Request changes the following: - Remove invalid optimization in addition where `ToPrimitive` calls where skipped. |
2 years ago |
raskad | b67596bc9b |
Add named evaluation of logical assignments (#2389)
This Pull Request changes the following: - Add named evaluation of logical assignments |
2 years ago |
raskad | 203c1961bb |
Skip prototype field definition for arrow function (#2388)
This Pull Request changes the following: - Skip prototype field definition for arrow function - Add `GetArrowFunction` opcode |
2 years ago |
raskad | 786357919f |
Set `in` to `true` when parsing AssignmentExpression in ConditionalExpression (#2386)
This Pull Request fixes the following: - Set `in` to `true` when parsing AssignmentExpression in ConditionalExpression |
2 years ago |
Kevin | f026f2005a |
Implement `JsGenerator` and wrapper docs clean up (#2380)
<!--- 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) |
2 years ago |
José Julián Espina | 762dd93d44 |
Fix var collisions in strict eval calls (#2382)
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. |
2 years ago |
José Julián Espina | 8a5f141125 |
Reduce documentation size in blog (#2383)
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. |
2 years ago |
José Julián Espina | 447fca4cc0 |
Implement member accessors in initializer of for loops (#2381)
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 ``` |
2 years ago |
José Julián Espina | 89e3081672 |
Document the AST (#2377)
As promised in https://github.com/boa-dev/boa/pull/2319#issuecomment-1280095047. There are still some style inconsistencies (which require a bit more time and effort), but having the whole module documented is a lot better for clarity. |
2 years ago |
Iban Eguia Moraza | 6a43878b04 |
Updated the Code of Conduct (#2365)
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 |
2 years ago |
João Borges | 48e6513564 |
Cleanup and speed-up CI (#2376)
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.~~ |
2 years ago |
dependabot[bot] | 946a4ddf74 |
Bump serde from 1.0.145 to 1.0.147 (#2374)
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=" |
2 years ago |
dependabot[bot] | d10df0221c |
Bump serde_yaml from 0.9.13 to 0.9.14 (#2373)
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=" |
2 years ago |
dependabot[bot] | b9335b72ac |
Bump boa-dev/criterion-compare-action from 3.2.3 to 3.2.4 (#2372)
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=" |
2 years ago |
dependabot[bot] | 5ba101d4bc |
Bump test262 from `ee7c379` to `b5d3192` (#2375)
Bumps [test262](https://github.com/tc39/test262) from `ee7c379` to `b5d3192`. <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | de231df63a |
Allow LineTerminator before Semicolon in `continue` (#2371)
This Pull Request changes the following: - Check if there is a Semicolon after a LineTerminator is found in a `continue` statement. |
2 years ago |