raskad
e1da91292e
Reduce environment allocations ( #4002 )
...
* Skip environment creation when all bindings in the scope are local
* Skip environment creation when possible for arrow functions
* Do not allocate space for local bindings in runtime environments
* Change RefCell to Cell
1 week ago
dependabot[bot]
26681a0e2c
Bump the rust-dependencies group across 1 directory with 6 updates ( #4061 )
...
* Bump the rust-dependencies group across 1 directory with 6 updates
Bumps the rust-dependencies group with 6 updates in the / directory:
| Package | From | To |
| --- | --- | --- |
| [indexmap](https://github.com/indexmap-rs/indexmap ) | `2.6.0` | `2.7.0` |
| [rustc-hash](https://github.com/rust-lang/rustc-hash ) | `2.0.0` | `2.1.0` |
| [time](https://github.com/time-rs/time ) | `0.3.36` | `0.3.37` |
| [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen ) | `0.2.95` | `0.2.97` |
| [wasm-bindgen-test](https://github.com/rustwasm/wasm-bindgen ) | `0.3.45` | `0.3.47` |
| [syn](https://github.com/dtolnay/syn ) | `2.0.89` | `2.0.90` |
Updates `indexmap` from 2.6.0 to 2.7.0
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md )
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.6.0...2.7.0 )
Updates `rustc-hash` from 2.0.0 to 2.1.0
- [Changelog](https://github.com/rust-lang/rustc-hash/blob/master/CHANGELOG.md )
- [Commits](https://github.com/rust-lang/rustc-hash/compare/v2.0.0...v2.1.0 )
Updates `time` from 0.3.36 to 0.3.37
- [Release notes](https://github.com/time-rs/time/releases )
- [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md )
- [Commits](https://github.com/time-rs/time/compare/v0.3.36...v0.3.37 )
Updates `wasm-bindgen` from 0.2.95 to 0.2.97
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases )
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.95...0.2.97 )
Updates `wasm-bindgen-test` from 0.3.45 to 0.3.47
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases )
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits )
Updates `syn` from 2.0.89 to 2.0.90
- [Release notes](https://github.com/dtolnay/syn/releases )
- [Commits](https://github.com/dtolnay/syn/compare/2.0.89...2.0.90 )
---
updated-dependencies:
- dependency-name: indexmap
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: rust-dependencies
- dependency-name: rustc-hash
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: rust-dependencies
- dependency-name: time
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: rust-dependencies
- dependency-name: wasm-bindgen
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: rust-dependencies
- dependency-name: wasm-bindgen-test
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: rust-dependencies
- dependency-name: syn
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: rust-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
* Remove `time` sondness workarounds for tests
* fix lockfile
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
1 week ago
raskad
793a10035f
Fix rust 1.83.0 lints ( #4060 )
...
* Fix rust 1.83.0 lints
* Allow missing docs in wasm tests
* Run tarpaulin on 1.82.0
2 weeks ago
José Julián Espina
9d8f267770
Migrate to fast-float2 ( #4052 )
3 weeks ago
CrazyboyQCD
8f1d8d473a
Add string builder to build `JsString` ( #3915 )
...
* feat: add `JsStringBuilder` and test
* chore: fix calculation on capacity and add `clone` impl
* chore: some misc fix
* fix: wrong capacity calculation in `extend`
* chore: prevent `reserve` except for the shrink in `build`
* chore: fix misc
* perf: use `realloc` for allocation
* chore: fix lint
* fix: wrong ascii validation
* fix: wrong allocated data bytes calculation
* fix: wrong capacity calcultion on `with_capacity`
* fix: clippy fix
* chore: add public `reserve`
* chore: comments and renaming
* chore: update misc
* chore: moved to module `builder` and implement `AddAssign` for `Builder`
* chore: add zero case for `with_capacity`
* chore: mark public methods `inline`
* chore: extract allocation check into `allocate_if_needed`
* chore: fix lint
* chore: expose `JsStringData`
* feat: add common string builder and export 1 byte and 2 bytes string builder
* chore: add missed trait
* chore: fix lint
* chore: fix doc
* chore: add `reserve_exact`
* chore: typos
* chore: fix argument
* chore: fix doc
* chore: mark `current_layout` unsafe
* chore: fix lint
* chore: remove `JsStringData` and rename builders
* chore: add build methods to typed builders
* chore: add more build methods to `CommonJsStringBuilder`
* chore: rename `latin1` check to `ascii` check
* chore: refine docs
* chore: update tests
* chore: limit the generic type `D` of `JsStringBuilder` to Copy
* chore: move `entend` method under `Extend` trait
* chore: should validate `Latin1` segement in `build_from_latin1`
* chore: add `Add` trait implementation to builders
* chore: refines docs and add `inline` to trait methods
* chore: adds `clone_from` and related tests
* chore: adds `as_mut_slice` to typed builders
3 weeks ago
José Julián Espina
9b7c8ce986
Bump dependencies with breaking changes ( #4050 )
3 weeks ago
Hans Larsen
e892d94f8d
Add a JsPromise::from_result for convenience ( #4039 )
1 month ago
dependabot[bot]
b8ea9bdb4e
Bump the rust-dependencies group with 3 updates ( #4036 )
...
Bumps the rust-dependencies group with 3 updates: [arbitrary](https://github.com/rust-fuzz/arbitrary ), [futures-lite](https://github.com/smol-rs/futures-lite ) and [url](https://github.com/servo/rust-url ).
Updates `arbitrary` from 1.3.2 to 1.4.1
- [Changelog](https://github.com/rust-fuzz/arbitrary/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rust-fuzz/arbitrary/compare/v1.3.2...v1.4.1 )
Updates `futures-lite` from 2.4.0 to 2.5.0
- [Release notes](https://github.com/smol-rs/futures-lite/releases )
- [Changelog](https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md )
- [Commits](https://github.com/smol-rs/futures-lite/compare/v2.4.0...v2.5.0 )
Updates `url` from 2.5.2 to 2.5.3
- [Release notes](https://github.com/servo/rust-url/releases )
- [Commits](https://github.com/servo/rust-url/compare/v2.5.2...v2.5.3 )
---
updated-dependencies:
- dependency-name: arbitrary
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: rust-dependencies
- dependency-name: futures-lite
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: rust-dependencies
- dependency-name: url
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: rust-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 month ago
CrazyboyQCD
f30514b085
Some string optimizations ( #4030 )
...
* chore: replace `js_str` with `js_string`
* chore: replace `boolean`'s `to_string` with literal
* chore: remove unnecessary `to_string`
* chore: fix lint and format
* chore: add feature gate to import `js_str`
* chore: change `get_typed_fn`'s name to `JsString`
* chore: replace js_str with js_string(cli)
* chore: replace js_str with js_string(`try_into_js`)
* chore: replace js_str with js_string(`Console`)
* chore: fix lint
* perf: use more efficient `LazyLock` on `RAW_STATICS_CACHE`
* chore: move `js_str` together with other imports
1 month ago
Hans Larsen
e37dc418ec
Option::None should try into Undefined, not Null ( #4029 )
...
This PR also include removal of useless path JsResult:: for Ok and
Err, which are preluded already.
1 month ago
CrazyboyQCD
4983471ff6
Some optimizations on `Error` ( #4020 )
...
* chore: mark `JsNativeError`'s constructors const
* chore: add associated constants
* chore: replace const method calls in `js_error` with corresponding constants
* fix: use correct method
* perf: change error's `message` type to `Cow<'static str>`
* chore: fix lint
1 month ago
Nikita-str
b60b1039e3
`TryFromJs` from `JsMap` for `HashMap` & `BtreeMap` ( #3998 )
...
* `TryFromJs` from `JsMap` for `HashMap` & `BtreeMap`
* fix `clippy` warn
* use `IteratorResult` instead of `as_object`
* `JsMap` impl `rust_for_each`
* fix: initial `JsMap` can be changed in `for_each`
* better naming
1 month ago
Jason Williams
d8ec97c85f
use with_capacity to reduce re-allocations fixes #3896 ( #3961 )
...
* use with_capacity to reduce allocations
* Update to use const generics over runtime param
* add comment above with_capacity
* - move OWN_PROPS
- add profiling marks in more places
* use const in trait instead
1 month ago
Hans Larsen
d3dbb4ad02
console.debug() should use a debug Logger method ( #4019 )
1 month ago
Nikita-str
905e4c6f90
`TryIntoJs` trait and derive macro for it ( #3999 )
...
* #3874 : `TryIntoJs` impl for primitive types
* #3874 : `#[derive(TryIntoJs)]`
is it ok to use `create_data_property_or_throw`?
in other words, am I create an object correctly?
* #3874 : some (but not enough) tests
* #3874 : fix `TryintoJs` derive bug in multi attr case
* #3874 : `TryIntoJs` derive macro example
* fix paths in derive macro
* make lint happy
2 months ago
Hans Larsen
acd1a8d9ab
Add a display_lossy() to write a JsString lossily ( #4023 )
...
* Add a display_lossy() to write a JsString lossily
* cargo fmt
2 months ago
dependabot[bot]
e22a703dfd
Bump the rust-dependencies group across 1 directory with 8 updates ( #4021 )
...
* Bump the rust-dependencies group across 1 directory with 8 updates
Bumps the rust-dependencies group with 8 updates in the / directory:
| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap ) | `4.5.19` | `4.5.20` |
| [serde_json](https://github.com/serde-rs/json ) | `1.0.128` | `1.0.132` |
| [trybuild](https://github.com/dtolnay/trybuild ) | `1.0.99` | `1.0.101` |
| [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen ) | `0.2.93` | `0.2.95` |
| [wasm-bindgen-test](https://github.com/rustwasm/wasm-bindgen ) | `0.3.43` | `0.3.45` |
| [syn](https://github.com/dtolnay/syn ) | `2.0.79` | `2.0.82` |
| [proc-macro2](https://github.com/dtolnay/proc-macro2 ) | `1.0.86` | `1.0.88` |
| [bytemuck](https://github.com/Lokathor/bytemuck ) | `1.18.0` | `1.19.0` |
Updates `clap` from 4.5.19 to 4.5.20
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.19...clap_complete-v4.5.20 )
Updates `serde_json` from 1.0.128 to 1.0.132
- [Release notes](https://github.com/serde-rs/json/releases )
- [Commits](https://github.com/serde-rs/json/compare/1.0.128...1.0.132 )
Updates `trybuild` from 1.0.99 to 1.0.101
- [Release notes](https://github.com/dtolnay/trybuild/releases )
- [Commits](https://github.com/dtolnay/trybuild/compare/1.0.99...1.0.101 )
Updates `wasm-bindgen` from 0.2.93 to 0.2.95
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases )
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.93...0.2.95 )
Updates `wasm-bindgen-test` from 0.3.43 to 0.3.45
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases )
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md )
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits )
Updates `syn` from 2.0.79 to 2.0.82
- [Release notes](https://github.com/dtolnay/syn/releases )
- [Commits](https://github.com/dtolnay/syn/compare/2.0.79...2.0.82 )
Updates `proc-macro2` from 1.0.86 to 1.0.88
- [Release notes](https://github.com/dtolnay/proc-macro2/releases )
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.86...1.0.88 )
Updates `bytemuck` from 1.18.0 to 1.19.0
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md )
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.18.0...v1.19.0 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: rust-dependencies
- dependency-name: serde_json
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: rust-dependencies
- dependency-name: trybuild
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: rust-dependencies
- dependency-name: wasm-bindgen
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: rust-dependencies
- dependency-name: wasm-bindgen-test
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: rust-dependencies
- dependency-name: syn
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: rust-dependencies
- dependency-name: proc-macro2
dependency-type: direct:production
update-type: version-update:semver-patch
dependency-group: rust-dependencies
- dependency-name: bytemuck
dependency-type: direct:production
update-type: version-update:semver-minor
dependency-group: rust-dependencies
...
Signed-off-by: dependabot[bot] <support@github.com>
* Fix wasm dependencies
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: José Julián Espina <julian.espina@canonical.com>
2 months ago
Hans Larsen
94d08fe4e6
Add a URL class to boa_runtime ( #4004 )
...
* Add a URL class (with caveats)
Some methods are NOT currently supported (some don' make sense
outside of a browser context). They are still implemented but
will throw a JavaScript Error.
Supported methods should follow the specification perfectly.
* Adding tests and using url::quirks for simpler getters/setters
* clippies
* Address comments
2 months ago
Nikita-str
67f4884d9b
`JsValue::to_json` fix integer property keys ( #4011 )
...
* #3923 : `to_json` fix integer properties key
* some refactoring
2 months ago
Nikita-str
628e31cf62
#4009 : eq bug fix + tests ( #4010 )
3 months ago
Hans Larsen
e6a695036b
Add context to the console Logger trait ( #4005 )
...
This is not backward compatible but should have minimal impact.
This is also more future proof by passing the ConsoleState
which is more opaque and allows us to update the way the
console object is constructed and passed.
3 months ago
it-a-me
bea8369620
docs: Fix link to examples ( #4007 )
3 months ago
raskad
aa09d98787
Implement scope analysis and local variables ( #3988 )
...
* Remove unnecessary compile time environment clones
* Remove compile time environments from every runtime DeclarativeEnvironment
* Implement scope analysis and local variables
* fix docs and fuzzer errors
* Apply suggestions
* Align `parse_script` and `parse_module` arguments
* Fix fuzzer
3 months ago
Hans Larsen
8438ad21cd
Add TryFromJs for TypedJsFunction and more tests ( #3981 )
...
* Add TryFromJs for TypedJsFunction and more tests
Includes adding TryFromJs for "()".
* Fix clippies and fmt
* Prettier
* Add From<TypedJsFunction> for JsValue to allow conversion
* Implement comments
* clippies
3 months ago
Hans Larsen
ddb1901d65
Add TextEncoder, TextDecoder implementations to boa_runtime ( #3994 )
...
* Add a TextEncoder implementation to boa_runtime
* Add a TextDecoder implementation as well.
3 months ago
Haled Odat
c480a42230
Implement register allocation ( #3942 )
...
* Implement register allocation
* Apply review
* Update core/engine/src/vm/opcode/rest_parameter/mod.rs
Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
---------
Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
3 months ago
Hans Larsen
dd32789ae4
Add tests from WPT and fix them in the Console ( #3979 )
3 months ago
Hans Larsen
50356e9518
Add TryIntoJsResult for vectors ( #3993 )
...
* Add TryIntoJsResult for vectors
This way JsFunction made with into_js_function can return vectors.
* Fix build error
3 months ago
Hans Larsen
affa6527c1
Add a way for js_error! macro to create native errors with message ( #3971 )
...
* Add a way for js_error! macro to create native errors with message
* Fix docs
3 months ago
Hans Larsen
c21f10efae
A simple module loader from a function ( #3932 )
...
* A simple module loader from a function
This will be the foundation for having a combinatoric module loader
system.
* Add more utility module loader types
* clippies
* Remove convenience functions and allow AsRef<Path> for constructing fs
* clippies
* Move FnModuleLoader to return a result, and add a new simpler loader
* Address comment
3 months ago
Hans Larsen
cdb47510b3
Add an "iter()" method to Js*Array for convenience ( #3986 )
...
* Allow dead code for code that is newly detected as unused
* Fix compile errors with nightly rust
* Add missing SAFETY section
* Increase safety of `FutexWaiters`
* Add an "iter()" method to Js*Array for convenience
It might be optimizable, and in either case it should be but this at
least let people use an easy API and enjoy future improvements.
* Fix clippies
---------
Co-authored-by: Theo Paris <theo@tinted.dev>
Co-authored-by: José Julián Espina <julian.espina@canonical.com>
3 months ago
Hans Larsen
5534ec2773
Add a display type for JsString to allow formatting without allocations ( #3951 )
...
Co-authored-by: Haled Odat <8566042+HalidOdat@users.noreply.github.com>
3 months ago
Hans Larsen
4778780073
Add support for Trace, Finalize and JsData for Convert<> ( #3970 )
3 months ago
Hans Larsen
b08610afd9
Allow dead code for code that is newly detected as unused ( #3984 )
...
* Allow dead code for code that is newly detected as unused
* Fix compile errors with nightly rust
* Add missing SAFETY section
* Increase safety of `FutexWaiters`
---------
Co-authored-by: Theo Paris <theo@tinted.dev>
Co-authored-by: José Julián Espina <julian.espina@canonical.com>
3 months ago
Hans Larsen
0f282f5bc3
Add support for boa(rename = "") in TryFromJs derive ( #3980 )
...
* Add support for boa(rename = "") in TryFromJs derive
* Fix clippies and fmt
* Move macro test to boa_engine
3 months ago
shurizzle
9a553db188
fix: ignore `debugger` statement ( #3976 )
...
Co-authored-by: shurizzle <me@shurizzle.dev>
3 months ago
Hans Larsen
c57f2310bf
Add a clone_inner method to allow cloning of inner data ( #3968 )
...
* Add a clone_inner method to allow cloning of inner data
* oops
* Address comment
4 months ago
José Julián Espina
25705ef5a6
Refactor iterator APIs to be on parity with the latest spec ( #3962 )
...
* The Great Refactoring Of Iterators
* Update core/engine/src/builtins/promise/mod.rs
Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
* Update core/engine/src/builtins/promise/mod.rs
Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
---------
Co-authored-by: raskad <32105367+raskad@users.noreply.github.com>
4 months ago
Kevin Ness
31e4990d6c
Build out partial record functionality, property bag construction, and `with` methods ( #3955 )
...
* Build out partial functionality and with methods
* Use temporal_rs's TinyAsciiStr
* Apply review feedback for specification comments
* Bump temporal-rs and add DateTime::with
4 months ago
José Julián Espina
af4fd5ab37
Implement `Atomics.pause` ( #3956 )
4 months ago
Hans Larsen
1691802727
Rename as_promise to as_promise_object and add as_promise -> JsPromise ( #3965 )
4 months ago
Hans Larsen
1c1d820e0e
Add clippy for denying print and eprints ( #3967 )
...
* Remove leftover eprintln from JsPromise::await_blocking
* Add clippy for denying print and eprints
And remove usage of println or allow them.
* Address comment
4 months ago
Hans Larsen
1c83ad1f09
Allow trailing commas in js_class functions ( #3964 )
4 months ago
José Julián Espina
eba912fe94
Fix `js_str` macro to correctly handle latin1 strings ( #3959 )
4 months ago
raskad
424896dbff
Refactor ast function types ( #3931 )
...
* Refactor AST function types
* fix lints
4 months ago
José Julián Espina
c22f39b026
Implement new spec changes for `AsyncGenerator` ( #3950 )
...
* Implement new spec changes for `AsyncGenerator`
* Add panic docs
4 months ago
Hans Larsen
50fabc8387
Add more utility functions around modules and exports ( #3937 )
...
* Add more utility functions around modules and exports
* Use import instead of path
* clippies and fmt
* clippies and fmt
* Add JsPromise::await_blocking and remove ell_and_run
* Fix documentation CI job
4 months ago
José Julián Espina
00f8e00492
Split default icu data into lazily deserialized parts ( #3948 )
...
* Split default icu data into lazily deserialized parts
* FIx no_std compilation
* Lazily load more ICU tools
* Fix regressions and use more stable constructors
4 months ago
Hans Larsen
c6c6e4c1ae
Allow a custom Logger to be used as the backend for boa_runtime::Console ( #3943 )
...
* Allow a custom Logger to be used as the backend for boa_runtime::Console
* Comments
4 months ago
Jason Williams
5ee0dc1ceb
add some temporal methods ( #3856 )
...
* lazy builtins
* Bump temporal_rs to latest commit
* Fix build
* Begining of plainYearMonth methods
* plainYearMonth: get_in_leap_year, get_months_in_year
* plain_year_month: implement add/subtract
* Addition of MonthDay methods
* toString implementations
* some changes to migrate to FiniteF64
* - bump the temporal version
- Move with implementation to to_temporal_month_day
- review comments
* switch to using as_inner() instead of from
Also use let _ to appease new clippy rules
* get the calendarID from the object
* update temporal ref
* Revert "lazy builtins"
This reverts commit a4e602d129
.
* changes from review comments
---------
Co-authored-by: jedel1043 <jedel0124@gmail.com>
4 months ago