* #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
* 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
* 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>
* 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>
* 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
* Remove leftover eprintln from JsPromise::await_blocking
* Add clippy for denying print and eprints
And remove usage of println or allow them.
* Address comment
* 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