mirror of https://github.com/boa-dev/boa.git
Tree:
cc9b6baba7
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 }
613 Commits (cc9b6baba7acc8fba498d889790b21bf268cc9c5)
Author | SHA1 | Message | Date |
---|---|---|---|
José Julián Espina | 1e75fd0d21 |
Make `Realm` shareable between functions (#2801)
This Pull Request fixes #2317 and #1835, finally giving our engine proper realms 🥳. It changes the following: - Extracts the compile environment stack from `Realm` and into `Vm`. - Adjusts the bytecompiler to accommodate this change. - Adjusts `call/construct_internal` to accommodate this change. This also coincidentally fixed #2317, which I'm pretty happy about. - Adjusts several APIs (`NativeJob`, `Realm`) and builtins (`eval`, initializers) to accommodate this change. - Adjusts `JsNativeError`s to hold a reference to the Realm from which they were created. This only affects errors created within calls to function objects. Native calls don't need to set the realm because it's inherited by the next outer active function object. TLDR: `JsError` API stays the same, we just set the origin Realm of errors in `JsObject::call/construct_internal`. |
2 years ago |
Haled Odat | 7a4d6526b0 |
Fix `String.prototype.replace()` order of `ToString` execution (#2799)
Fix order of `ToString` execution, there are 3 failing tests on `.replace()` but they seem to be regex related |
2 years ago |
Haled Odat | 88fb15c0e5 |
Fix `Symbol.prototype[@@iterator]` (#2800)
It changes the following: - Fixes`Symbol.prototype[@@iterator]` so it calls `RequireObjectCoercible` and then `ToString` - Makes string iterator store a `JsString` which should be faster, instead of `JsValue` then calling `ToString` on every iteration |
2 years ago |
José Julián Espina | 34d6b93f36 |
Fix cross-realm construction bugs (#2786)
This Pull Request fixes test [`assert-throws-same-realm.js`](
|
2 years ago |
dependabot[bot] | 303d8d4b69 |
Bump bitflags from 2.0.2 to 2.1.0 (#2788)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.0.2 to 2.1.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/bitflags/bitflags/releases">bitflags's releases</a>.</em></p> <blockquote> <h2>2.1.0</h2> <h2>What's Changed</h2> <ul> <li>Add docs for the internal Field0 and examples of formatting/parsing by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/328">bitflags/bitflags#328</a></li> <li>Add support for arbitrary by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/324">bitflags/bitflags#324</a></li> <li>Fix up missing docs for consts within consts by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/330">bitflags/bitflags#330</a></li> <li>Ignore clippy lint in generated code by <a href="https://github.com/Jake-Shadle"><code>@Jake-Shadle</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/331">bitflags/bitflags#331</a></li> <li>Prepare for 2.1.0 release by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/334">bitflags/bitflags#334</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/Jake-Shadle"><code>@Jake-Shadle</code></a> made their first contribution in <a href="https://redirect.github.com/bitflags/bitflags/pull/331">bitflags/bitflags#331</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/bitflags/bitflags/compare/2.0.2...2.1.0">https://github.com/bitflags/bitflags/compare/2.0.2...2.1.0</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md">bitflags's changelog</a>.</em></p> <blockquote> <h1>2.1.0</h1> <h2>What's Changed</h2> <ul> <li>Add docs for the internal Field0 and examples of formatting/parsing by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/328">bitflags/bitflags#328</a></li> <li>Add support for arbitrary by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/324">bitflags/bitflags#324</a></li> <li>Fix up missing docs for consts within consts by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/330">bitflags/bitflags#330</a></li> <li>Ignore clippy lint in generated code by <a href="https://github.com/Jake-Shadle"><code>@Jake-Shadle</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/331">bitflags/bitflags#331</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/Jake-Shadle"><code>@Jake-Shadle</code></a> made their first contribution in <a href="https://redirect.github.com/bitflags/bitflags/pull/331">bitflags/bitflags#331</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/bitflags/bitflags/compare/2.0.2...2.1.0">https://github.com/bitflags/bitflags/compare/2.0.2...2.1.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Haled Odat | 570bc85ebe |
Implement debug object for CLI (#2772)
Currently some debugging stuff in JavaScript land is difficult to impossible, like triggering a GC collect, this is not impossible to do in JavaScript the way I triggered it was by creating a huge amount of object `for (let i = 0; i < 100000; ++i) { ({}) }` but this is cumbersome and not guaranteed to trigger a gc. This PR implements `--debug-object` flag that injects the `$boa` debug object in the context, the object is separated into modules currently `gc`, `function`, `object`. We can now do `$boa.gc.collect()`, which force triggers a GC collect. Or sometimes I wanted a trace (the current solution is great, you can trace stuff like `>>> 1 + 1` but that is also it's limitation), it traces everything, I sometimes have a scenario and just want to trace a single function in that scenario, that's why I added the `$boa.function.trace(func, this, ...args)` It only traces the function. ```js >> $boa.function.trace((a, b) => a + b, undefined, 1, 2) -------------------------Compiled Output: ''-------------------------- Location Count Opcode Operands 000000 0000 DefInitArg 0000: 'a' 000005 0001 DefInitArg 0001: 'b' 000010 0002 RestParameterPop 000011 0003 GetName 0000: 'a' 000016 0004 GetName 0001: 'b' 000021 0005 Add 000022 0006 Return 000023 0007 PushUndefined 000024 0008 Return ... (cut for brevity) ... ``` It also implements `$boa.function.flowgraph(func, options)`: ```js $boa.function.flowgraph(func, 'graphviz') $boa.function.flowgraph(func, { format: 'mermaid', direction: 'TopBottom' }) ``` Printing the object pointer: ```js $boa.object.id({}) // '0x566464F33' ``` It currently implements some functionality which we can grow it with our debugging needs since we are not restricted by a spec we can add whatever we want :) I was originally going to implement this in #2723 (but the PR is too big), for shapes having functions like: ```js $boa.shape.type({}) // Shared shape $boa.shape.id({}) // 0x8578FG355 (objects, shape pointer) $boa.shape.flowgraph({}) // printing the shape transition chain, like $boa.function.flowgraph ``` Shapes chains are very hard to debug once they are big... so having this type of debugging capability would make it much easier. |
2 years ago |
dependabot[bot] | 0eb4aecc10 |
Bump sys-locale from 0.2.4 to 0.3.0 (#2781)
Bumps [sys-locale](https://github.com/1Password/sys-locale) from 0.2.4 to 0.3.0. <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.3.0</h2> <p>See <a href="https://github.com/1Password/sys-locale/blob/main/CHANGELOG.md#030---2023-04-04">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.3.0] - 2023-04-04</h2> <h3>Changed</h3> <ul> <li>The crate now only uses <code>wasm-bindgen</code> when targeting WebAssembly on the web. Use the new <code>js</code> feature to target the web.</li> </ul> <h3>Fixed</h3> <ul> <li>The crate now compiles for unsupported platforms.</li> <li>Cleaned up typos and grammar in README.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 57bbacb502 |
Bump num_enum from 0.5.11 to 0.6.0 (#2782)
Bumps [num_enum](https://github.com/illicitonion/num_enum) from 0.5.11 to 0.6.0. <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
José Julián Espina | 0babe195fb |
Implement `escape` and `unescape` (#2768)
<!--- 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 implements the [`escape`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/escape) and [`unescape`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape) functions. Both are technically deprecated, but they're also part of the [Additional ECMAScript Features for Web Browsers](https://tc39.es/ecma262/#sec-additional-ecmascript-features-for-web-browsers) section, so it is preferable to have them in place. |
2 years ago |
Iban Eguia Moraza | 540aa2be4f |
Initial version of a JS -> Rust conversion trait. (#2276)
This Pull Request closes #1975. It's still a work in progress, but tries to go in that direction. It changes the following: - Adds a new `TryFromJs` trait, that can be derived using a new `boa_derive` crate. - Adds a new `try_js_into()` function that, similarly to the standard library `TryInto` trait Things to think about: - Should the `boa_derive` crate be re-exported in `boa_engine` using a `derive` feature, similar to how it's done in `serde`? - The current implementation only converts perfectly valid values. So, if we try to convert a big integer into an `i8`, or any floating point number to an `f32`. So, you cannot derive `TryFromJs` for structures that contain an `f32` for example (you can still manually implement the trait, though, and decide in favour of a loss of precision). Should we also provide some traits for transparent loss of precision? - Currently, you cannot convert between types, so if the JS struct has an integer, you cannot cast it to a boolean, for example. Should we provide a `TryConvertJs` trait, for example to force conversions? - Currently we only have basic types and object conversions. Should add `Array` to `Vec` conversion, for example, right? Should we also add `TypedArray` conversions? What about `Map` and `Set`? Does this step over the fine grained APIs that we were creating? Note that this still requires a bunch of documentation, tests, and validation from the dev team and from the users that requested this feature. I'm particularly interested in @lastmjs's thoughts on this API. I already added an usage example in `boa_examples/src/bin/derive.rs`. Co-authored-by: jedel1043 <jedel0124@gmail.com> |
2 years ago |
raskad | e286d9fbb7 |
Add AST node for parenthesized expressions (#2738)
Currently we have no explicit representation for parenthesized expressions which makes some behaviours impossible to detect. A bonus is that we can now turn AST that contains parenthesized expressions back to code. This Pull Request changes the following: - Add an AST node for parenthesized expressions. - Adjust some conversions and checks to "ignore"/"expand" parenthesized expressions. - Fix some tests that had parenthesized expressions. |
2 years ago |
Haled Odat | edb0417543 |
Shrink size of `IndexedProperties` (#2757)
Most objects don't have indexed properties, and those who have, have dense properties, this PR uses `ThinVec` to reduce the size of dense properties. It changes the following: - Trim `16` bytes from `IndexedProperties`, this reduces all objects size |
2 years ago |
Haled Odat | 6c438b5516 |
Implement constant folding optimization (#2679)
This PR implements an optimizer, It currently implements the [constant folding optimization][cfo]. this optimization is responsible for "folding"/evaluating constant expressions. For example: ```js let x = ((1 + 2 + -4) * 8) << 4 ``` Generates the following instruction(s) (`cargo run -- -t`): ``` 000000 0000 PushOne 000001 0001 PushInt8 2 000003 0002 Add 000004 0003 PushInt8 4 000006 0004 Neg 000007 0005 Add 000008 0006 PushInt8 8 000010 0007 Mul 000011 0008 PushInt8 4 000013 0009 ShiftLeft 000014 0010 DefInitLet 0000: 'x' ``` With constant folding it generates the following instruction(s) (`cargo run -- -t -O`): ``` 000000 0000 PushInt8 -128 000002 0001 DefInitLet 0000: 'x' ``` It changes the following: - Implement ~~WIP~~ constant folding optimization, ~~only works with integers for now~~ - Add `--optimize, -O` flag to boa_cli - Add `--optimizer-statistics` flag to boa_cli for optimizer statistics - Add `--optimize, -O` flag to boa_tester After I finish with this, will try to implement other optimizations :) [cfo]: https://en.wikipedia.org/wiki/Constant_folding |
2 years ago |
raskad | cf85843dc8 |
Fix super call execution order (#2724)
This Pull Request fixes/closes #2672. It changes the following: - Get the super constructor and the new target before executing arguments in super calls. |
2 years ago |
José Julián Espina | bf47815a49 |
Implement `JsPromise` wrapper (#2758)
This Pull Request closes #2687. It changes the following: - Adds a `JsPromise` wrapper to manipulate promises from Rust. - Cleans up the `promise` module to ease the integration of `JsPromise` with it. cc @lastmjs |
2 years ago |
dependabot[bot] | d134a0acee |
Bump serde from 1.0.158 to 1.0.159 (#2755)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.158 to 1.0.159. <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.159</h2> <ul> <li>Accept empty #[serde()] attribute (<a href="https://redirect.github.com/serde-rs/serde/issues/2422">#2422</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | ea7557dee7 |
Bump serde_json from 1.0.94 to 1.0.95 (#2753)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.94 to 1.0.95. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/serde-rs/json/releases">serde_json's releases</a>.</em></p> <blockquote> <h2>v1.0.95</h2> <ul> <li>Preserve f32 precision when serializing f32 -> serde_json::Value -> JSON string in "arbitrary_precision" mode (<a href="https://redirect.github.com/serde-rs/json/issues/1004">#1004</a>, <a href="https://redirect.github.com/serde-rs/json/issues/1005">#1005</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Haled Odat | ed358dea0c |
Shrink objects by using `ThinVec`s (#2752)
The fields like `[[PrivateElements]]` are hardly used but they occupy `24` bytes (on 64-bit arch.) the `ThinVec` type stores the `len` and `cap` right before the elements (like our `JsString` implementation) and only a pointer is kept (if not used it does not allocate!), was going to use this in #2723 , since it uses a `Vec` as a dense storage, but the PR is already too big. It changes the following: - Shrink object from `328` to `288` bytes (40 bytes reduction) - Add the `thin_vec` lightweight crate (single file) |
2 years ago |
Haled Odat | 7bec3e6a84 |
Don't construct prototype if not needed (#2751)
When the function is `async || arrow || method ` we don't need to construct the prototype (then drop it). |
2 years ago |
dependabot[bot] | 03a83a7e56 |
Bump indexmap from 1.9.2 to 1.9.3 (#2749)
Bumps [indexmap](https://github.com/bluss/indexmap) from 1.9.2 to 1.9.3. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/bluss/indexmap/blob/master/RELEASES.md">indexmap's changelog</a>.</em></p> <blockquote> <ul> <li> <p>1.9.3</p> <ul> <li>Bump the <code>rustc-rayon</code> dependency, for compiler use only.</li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Iban Eguia Moraza | f793a278df |
Added an example usage to documentation (#2742)
It changes the following: - Adds an example usage in the main `boa_engine` documentation - Add a simple README file in the boa_examples crate |
2 years ago |
Iban Eguia Moraza | 6ea4848bb5 |
Fix documentation links (#2741)
This PR changes the following: - Adds a new (very simple) security policy, to comply with GitHub standards - Changes the internal links of the documentation to point to the new boajs.dev domain - The developer documentation link now lies in the CONTRIBUTING.md file |
2 years ago |
raskad | b9ad5bcdd0 |
Make if statements return their completion values (#2739)
This Pull Request changes the following: - Adjust if statement execution to leave their resulting values on the stack when needed. |
2 years ago |
raskad | 8d16940943 |
Fix update expressions getting values multiple times (#2733)
Currently update expressions get values multiple times. This can lead to multiple executions of object property getters. This is very similar to #2551. Unfortunateley it seems like we have to sacrifice some code duplication for correctness in these cases. But that is probably for the best, as we can generate more optimized bytecode for each of these `get/set` cases. |
2 years ago |
José Julián Espina | 9cfb68d3e3 |
Remove panics on module compilation (#2730)
This Pull Request fixes the current panics on module compilation to prepare for the next release. |
2 years ago |
raskad | 790c20a156 |
Fix remaining `Set` tests (#2725)
This Pull Request changes the following: - Add locking for `Set`s during iteration. We already do this for `Map`s. - Properly implement negative zero handling for `add`, `has` and `delete`. - Refactor some `Set` functions and add spec comments. |
2 years ago |
raskad | f025e6fc92 |
Add negative zero handling for `Map.delete` (#2726)
This Pull Request changes the following: - Add negative zero handling for `Map.delete` |
2 years ago |
raskad | 0e01a74f59 |
Add early errors to dynamic function constructors (#2716)
This Pull Request fixes #2673. It changes the following: - Add early errors to dynamic function constructors. - Add tests that check for syntax errors when `super` is passed to the function constructor. |
2 years ago |
José Julián Espina | cb4e49a0ce |
Align iterator loops to the spec (#2686)
~Depends on #2683.~ Merged. This Pull Request fixes #2658. It changes the following: - Makes `for .. of` loop execution more spec compliant. - Rewrites iterator related opcodes to be able to use it on all for .. of/in loops. - Adds some utility op codes. |
2 years ago |
Haled Odat | 3b5122635f |
Make tracing an opt-in feature (#2709)
This PR adds the `"trace"` feature flag that enables vm opcode tracing (off by default), most users aren't interested in tracing/debugging that's why I think it should be made out-in. |
2 years ago |
Haled Odat | 4544362b77 |
Fix get function opcode traces (#2708)
Fix get function opcode traces (`GetFunction`, `GetGenerator`, etc) ```js function x() { let y = 0; } ``` Before: ``` 000000 0000 GetFunction 0000: 'JSInternedStrRef { utf8: Some("x"), utf16: [120] }' (length: 0) 000006 0001 DefInitVar 0000: 'x' ``` After: ``` 000000 0000 GetFunction 0000: 'x' (length: 0) 000006 0001 DefInitVar 0000: 'x' ``` |
2 years ago |
raskad | 431a358b2f |
Implement `with` and object environments (#2692)
This Pull Request changes the following: - Implement `with` statement parsing, ast node, compilation and excution. - Implement object environments that are used in the `with` statement excution. The implementation of object environments can probably be optimized further by using more compile-time information about when object environments can exist. Maybe there could also be a separate environment stack for object environments to reduce the filtering and iteration that is needed with the current implementation. This does not fix all tests in the `test/language/statements/with` suite yet. But for most failing tests that I have looked at we are missing other features / have bugs elsewhere. As a note for the review: The functions in the `impl Context` block in `boa_engine/src/environments/runtime.rs` are mostly copied / moved from the existing functions. The only change there should be the addition of the object environment logic. They had to be moved to `Context` because of borrow semantics. |
2 years ago |
dependabot[bot] | 7b2564e126 |
Bump bitflags from 2.0.1 to 2.0.2 (#2701)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.0.1 to 2.0.2. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/bitflags/bitflags/releases">bitflags's releases</a>.</em></p> <blockquote> <h2>2.0.2</h2> <h2>What's Changed</h2> <ul> <li>Fix up missing isize and usize Bits impls by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/321">bitflags/bitflags#321</a></li> <li>Prepare for 2.0.2 release by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/322">bitflags/bitflags#322</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/bitflags/bitflags/compare/2.0.1...2.0.2">https://github.com/bitflags/bitflags/compare/2.0.1...2.0.2</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md">bitflags's changelog</a>.</em></p> <blockquote> <h1>2.0.2</h1> <h2>What's Changed</h2> <ul> <li>Fix up missing isize and usize Bits impls by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/321">bitflags/bitflags#321</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/bitflags/bitflags/compare/2.0.1...2.0.2">https://github.com/bitflags/bitflags/compare/2.0.1...2.0.2</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 98356de414 |
Bump thiserror from 1.0.39 to 1.0.40 (#2698)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.39 to 1.0.40. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/dtolnay/thiserror/releases">thiserror's releases</a>.</em></p> <blockquote> <h2>1.0.40</h2> <ul> <li>Update syn dependency to 2.x</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
raskad | d794edfeb2 |
Fix Object constructor (#2694)
This Pull Request changes the following: - Add the additional required condition in the Object constructor that checks if the `NewTarget` is the Object constructor itself. |
2 years ago |
Haled Odat | b2b079b475 |
Fix value to bigint conversion (#2688)
This PR should fix the remaining tests in the builtin `BigInt` test suite |
2 years ago |
Haled Odat | 50a343a3ce |
Avoid unneeded bounds checks in bytecode address patching (#2680)
As discussed in this comment https://github.com/boa-dev/boa/pull/2669#discussion_r1137618027, `rustc` doesn't seem to optimize out the bounds checks. |
2 years ago |
Haled Odat | 4d121e54d9 |
Fix incorrect `Number.MIN_VALUE` value (#2682)
This will fix the remaining test of the `multiplication` and `division` test suite It changes the following: - Change `Number.MIN_VALUE` from `f64::MIN_POSITIVE` to `5e-324` value |
2 years ago |
Haled Odat | 2588aa9f9a |
Fix exponent operator (#2681)
When `abs(base) == 1` and `y == +/- Infinity` result should be `NaN` Fixes the remaining failing tests in the `exponentiation` test suite |
2 years ago |
dependabot[bot] | 65bb0d890e |
Bump bitflags from 2.0.0 to 2.0.1 (#2677)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.0.0 to 2.0.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/bitflags/bitflags/releases">bitflags's releases</a>.</em></p> <blockquote> <h2>2.0.1</h2> <h2>What's Changed</h2> <ul> <li>Fix up some docs issues by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/309">bitflags/bitflags#309</a></li> <li>Make empty_flag() const. by <a href="https://github.com/tormeh"><code>@tormeh</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/313">bitflags/bitflags#313</a></li> <li>Fix formatting of multi-bit flags with partial overlap by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/316">bitflags/bitflags#316</a></li> <li>Prepare for 2.0.1 release by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/317">bitflags/bitflags#317</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/tormeh"><code>@tormeh</code></a> made their first contribution in <a href="https://redirect.github.com/bitflags/bitflags/pull/313">bitflags/bitflags#313</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/bitflags/bitflags/compare/2.0.0...2.0.1">https://github.com/bitflags/bitflags/compare/2.0.0...2.0.1</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md">bitflags's changelog</a>.</em></p> <blockquote> <h1>2.0.1</h1> <h2>What's Changed</h2> <ul> <li>Fix up some docs issues by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/309">bitflags/bitflags#309</a></li> <li>Make empty_flag() const. by <a href="https://github.com/tormeh"><code>@tormeh</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/313">bitflags/bitflags#313</a></li> <li>Fix formatting of multi-bit flags with partial overlap by <a href="https://github.com/KodrAus"><code>@KodrAus</code></a> in <a href="https://redirect.github.com/bitflags/bitflags/pull/316">bitflags/bitflags#316</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/tormeh"><code>@tormeh</code></a> made their first contribution in <a href="https://redirect.github.com/bitflags/bitflags/pull/313">bitflags/bitflags#313</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/bitflags/bitflags/compare/2.0.0...2.0.1">https://github.com/bitflags/bitflags/compare/2.0.0...2.0.1</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
Haled Odat | da866cae64 |
Decouple bytecompiler from CodeBlock (#2669)
Hopefully this is a PR in a series of PRs to implement a bytecode optimizer, before that can happen there needs to be a lot of refactoring in the way we store and compile it. This also give us some memory benefits, it reduces `CodeBlock` size from `264` **=>** `208` (removes `56` bytes). Additionally when calling `into_boxed_slice`, If the vector has excess capacity, its items will be moved into a newly-allocated buffer with exactly the right capacity removing wasted space. |
2 years ago |
Kevin | 10d58b334e |
Implement `CompletionRecords` for the Vm (#2618)
<!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel necessary. ---> This goal of this draft is to begin to implement `CompletionRecords`. This draft switches the `Vm`'s `Opcode` from `JsResult<ShouldExit>` to `CompletionType` where the value is the top of the stack and returns a `CompletionRecord`. Primarily submitting as a draft for now for feedback. It changes the following: - Adds `CompletionRecord` and `CompletionType` to `Vm`. - Changes the evaluation loop from `while` to `loop` that returns a `CompletionType`. - Adapts `Context::run` to handle `CompletionType` and `CompletionRecord`. - Removes `FinallyAddresses` in favor of just checking the `env_stack`. |
2 years ago |
Iban Eguia Moraza | 0a843d2096 |
Bump bitflags to 2.0.0 (#2666)
Updated `bitflags`, overrides #2665. |
2 years ago |
dependabot[bot] | 6173a7343f |
Bump serde from 1.0.155 to 1.0.156 (#2662)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.155 to 1.0.156. <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.156</h2> <ul> <li>Documentation improvements</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
José Julián Espina | 5a3186d633 |
Handle surrogates in `String.fromCodePoint` (#2659)
This Pull Request fixes #2657. It changes the following: - Handles surrogates when trying to convert f64 codepoints to u16. - Replaces `abs().floor()` with `truncate` on `is_float_integer`. |
2 years ago |
lauren n. liberda | 6443aa86ec |
[regexp] new tests for unicode flag (#2656)
the flag got introduced in regress 0.5.0 <!--- Thank you for contributing to Boa! Please fill out the template below, and remove or add any information as you feel necessary. ---> This Pull Request fixes/closes: n/a. It changes the following: - add test for unicode flag - add test for native error on failing to parse (got removed in #2651 because the previous example parsing correctly now) Co-authored-by: Lauren N. Liberda <lauren@selfisekai.rocks> |
2 years ago |
dependabot[bot] | b138a3088a |
Bump serde from 1.0.154 to 1.0.155 (#2650)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.154 to 1.0.155. <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.155</h2> <ul> <li>Support <code>Serialize</code> and <code>Deserialize</code> impls for <code>core::ffi::CStr</code> and <code>alloc::ffi::CString</code> without "std" feature (<a href="https://redirect.github.com/serde-rs/serde/issues/2374">#2374</a>, thanks <a href="https://github.com/safarir"><code>@safarir</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | a8a49ebca7 |
Bump chrono from 0.4.23 to 0.4.24 (#2653)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.23 to 0.4.24. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/chronotope/chrono/releases">chrono's releases</a>.</em></p> <blockquote> <h2>0.4.24</h2> <p>This is a small maintenance release with accumulated fixes and improvements.</p> <ul> <li>Fix doc on <code>Days::new()</code> to refer to days, not months (<a href="https://redirect.github.com/chronotope/chrono/issues/874">#874</a>, thanks to <a href="https://github.com/brotskydotcom"><code>@brotskydotcom</code></a>)</li> <li>Clarify out of range value for <code>from_timestamp_opt()</code> (<a href="https://redirect.github.com/chronotope/chrono/issues/879">#879</a>, thanks to <a href="https://github.com/xmo-odoo"><code>@xmo-odoo</code></a>)</li> <li>Add <code>format_localized()</code> for <code>NaiveDate</code> (<a href="https://redirect.github.com/chronotope/chrono/issues/881">#881</a>, thanks to <a href="https://github.com/mseele"><code>@mseele</code></a>)</li> <li>Fix bug in <code>Add</code>/<code>Sub</code> <code>Days</code>, add tests with DST timezone (<a href="https://redirect.github.com/chronotope/chrono/issues/878">#878</a>)</li> <li>Make <code>NaiveTime::MIN</code> public (<a href="https://redirect.github.com/chronotope/chrono/issues/890">#890</a>)</li> <li>Fix <code>from_timestamp_millis()</code> implementation and add more tests (<a href="https://redirect.github.com/chronotope/chrono/issues/885">#885</a>)</li> <li>Fix typo in docstrings (<a href="https://redirect.github.com/chronotope/chrono/issues/897">#897</a>, thanks to <a href="https://github.com/dandxy89"><code>@dandxy89</code></a>)</li> <li>Add test proving that <a href="https://redirect.github.com/chronotope/chrono/issues/903">#903</a> is fixed in 0.4.x head (<a href="https://redirect.github.com/chronotope/chrono/issues/905">#905</a>, thanks to <a href="https://github.com/umanwizard"><code>@umanwizard</code></a>)</li> <li>Add <code>from_timestamp_micros()</code> function (<a href="https://redirect.github.com/chronotope/chrono/issues/906">#906</a>, thanks to <a href="https://github.com/umanwizard"><code>@umanwizard</code></a>)</li> <li>Check cargo-deny in CI (<a href="https://redirect.github.com/chronotope/chrono/issues/909">#909</a>)</li> <li>Derive <code>Hash</code> for most pub types that also derive <code>PartialEq</code> (<a href="https://redirect.github.com/chronotope/chrono/issues/938">#938</a>, thanks to <a href="https://github.com/bruceg"><code>@bruceg</code></a>)</li> <li>Update deprecated methods in <code>from_utc()</code> example (<a href="https://redirect.github.com/chronotope/chrono/issues/939">#939</a>, thanks to <a href="https://github.com/greg-el"><code>@greg-el</code></a>)</li> <li>Fix panic in <code>DateTime::checked_add_days()</code> (<a href="https://redirect.github.com/chronotope/chrono/issues/942">#942</a>, thanks to <a href="https://github.com/Ekleog"><code>@Ekleog</code></a>)</li> <li>More documentation for dates before 1 BCE or after 9999 CE (<a href="https://redirect.github.com/chronotope/chrono/issues/950">#950</a>, thanks to <a href="https://github.com/cgit"><code>@cgit</code></a>)</li> <li>Improve <code>FixedOffset</code> docs (<a href="https://redirect.github.com/chronotope/chrono/issues/953">#953</a>, thanks to <a href="https://github.com/klnusbaum"><code>@klnusbaum</code></a>)</li> <li>Add chrono-fuzz to CI and update its libfuzzer-sys dependency (<a href="https://redirect.github.com/chronotope/chrono/issues/968">#968</a>, thanks to <a href="https://github.com/LingMan"><code>@LingMan</code></a>)</li> <li>Fixes to parsing and calculation of week numbers (<a href="https://redirect.github.com/chronotope/chrono/issues/966">#966</a>, thanks to <a href="https://github.com/raphaelroosz"><code>@raphaelroosz</code></a>)</li> <li>Make iana-time-zone a target specific dependency (<a href="https://redirect.github.com/chronotope/chrono/issues/980">#980</a>, thanks to <a href="https://github.com/krtab"><code>@krtab</code></a>)</li> <li>Make eligible functions <code>const</code> (<a href="https://redirect.github.com/chronotope/chrono/issues/984">#984</a>, thanks to <a href="https://github.com/tormeh"><code>@tormeh</code></a>)</li> </ul> <p>Thanks to all contributors from the chrono team, <a href="https://github.com/esheppa"><code>@esheppa</code></a> and <a href="https://github.com/djc"><code>@djc</code></a>.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | ced0024fc5 |
Bump regress from 0.4.1 to 0.5.0 (#2651)
Bumps [regress](https://github.com/ridiculousfish/regress) from 0.4.1 to 0.5.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/ridiculousfish/regress/releases">regress's releases</a>.</em></p> <blockquote> <h2>v0.5.0</h2> <p>Version 0.5.0 of regress, REGex in Rust with EmcaScript Syntax.</p> <ul> <li>Unicode property escape matching like <code>\p{Letter}</code> is implemented</li> <li>Regex parsing may now use any u32 iterator, not simply strings</li> <li>The Unicode flag "u" is now recognized. Unicode is no longer the default; however non-Unicode regular expression support still has some known differences from JavaScript.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |
dependabot[bot] | 3d3191654d |
Bump serde from 1.0.153 to 1.0.154 (#2645)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.153 to 1.0.154. <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.154</h2> <ul> <li>Fix "undeclared lifetime" error in generated code when deriving Deserialize for an enum with both <code>flatten</code> and <code>'static</code> fields (<a href="https://github-redirect.dependabot.com/serde-rs/serde/issues/2383">#2383</a>, thanks <a href="https://github.com/Mingun"><code>@Mingun</code></a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
2 years ago |