* 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
* Split default icu data into lazily deserialized parts
* FIx no_std compilation
* Lazily load more ICU tools
* Fix regressions and use more stable constructors
* 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>
* feat: add a way to create `JsString` from ASCII literal
* chore: add todo comment to change `DUMMY_RAW_JS_STRING` to constant
* chore: make `ORIGINAL_JS_STR` a static reference to reduce binary size
* chore: replace `static` to `const` and simplify the code
* chore: add generic parameters to `transmute`
* chore: try to use union to represent
* chore: make miri happy
* Optimize const accesses for static strings
* perf: set LITERAL a constant reference to avoid duplication on data segment
* chore: add comments
* chore: add comments
* chore : fix `refcount` test
* chore: remove unnessnary assertion
* chore: modify definition of `JsString::is_static`
* chore: add more tests
* chore: mark `StaticJsString` as `repr[C]`
* chore: improve comment
* chore: Mark `TaggedLen` as `repr(transparent)`
---------
Co-authored-by: jedel1043 <jedel0124@gmail.com>
* Update length and builtin properties
* Split tags and names as two different statics
* Missed YearMonth and MonthDay length
* Fix length on some methods
* Missed one length
* cargo fmt
* Add a js_error! macro to create opaque errors
And as a bonus since I needed it, simplify comparison of strings
and add PartialEq<&str> for JsString.
* Add PartialEq<str> for JsStr. PartialEq<&str> uses the other
* Cargo clippy
* Remove conversion of non-string literals and remove From<String> for JsValue
* Updates to temporal_rs version and temporal methods
* Apply review feedback for relativeTo
* Forgot Date.prototype.toPlainDateTime
* Fix doc on toPlainDateTime
* Add a js_class to implement the Class trait without boilerplate
This also adds a JsInstance that verifies that `this` is of the proper
class, and an `Ignore` that ignore arguments.
The syntax is a bit special because of limitations of macro_rules. For
example, the way fields are defined. It was impossible to keep both
assignments (e.g. `public field = 123;`) and dynamic fields.
This reduces significantly the boilerplate for declaring classes. The
example in class.rs is more than twice as long (if you remove comments)
than the macro is.
* clippies
* Fix usage of macros
* Fix some imports issues
* Fix some imports issues, again
* Add a way to alias a function, e.g. change case
* Address comment and get rid of unwraps
* Add more utility traits and funtions to boa_interop
* cargo clippy
* Readd the safe version for Fn which also implements Copy
* Use a new trait for converting a Rust type to a JsResult<JsValue>
* cargo clippy
* Add a test for returning result and Fn()
* Seal both IntoJsFunction and IntoJsFunctionUnsafe
* Try Borrowing and return a nice error instead of panicking
* Address comments
* Rename into_js_function to into_js_function_copied
* Move TryIntoJsResult to boa_engine
* Move JsRest to be at the end only of arguments and add JsAll
* use from_copy_closure and remove unsafe
* Add a HostDefined struct to grab host defined in the argument list
* cargo fmt and clippy
* Explain why we need Clone
* Remove the vector from JsRest<> and use a reference
* Add HostDefined to context as Data, and rename the injector in boa_interop
* Use TypeError instead if the type was not found in context
* Update core/interop/src/lib.rs
Co-authored-by: José Julián Espina <jedel0124@gmail.com>
* cargo fmt
* cargo fmt
---------
Co-authored-by: José Julián Espina <jedel0124@gmail.com>
* Add an embed_module!() macro to boa_interop
The macro creates a ModuleLoader that includes all JS files from a directory.
* Add description of function
* Run prettier
* Remove reference to a unaccessible crate
* Remove one more reference to a unaccessible crate
* Disable test that plays with paths on Windows
* Block the whole test module instead of just the fn
* This is a bit insane
* Replace path separators into JavaScript specifier separators
* cargo fmt
* cargo fmt part deux
* fix some issues with relative path and pathing on windows
* fix module resolver when there are no base path
* use the platform's path separator
* cargo fmt
* prettier
* Remove caching of the error
* Pedantic clippy gonna pedant
* Add functions to create modules from a JSON value
* Move json_module to Module::from_value_as_default
* Flag the whole json module behind the json feature
* Rename and add doc