* remove From<JSONValue> for Value. Going from JSONValue to Value will soon need the interpreter
* pass interpreter to from_json
* move from_json to Value impl
* move to_json to Value impl alongside from_json
* add prototype to objects created from json
* consume the object and don't clone
* if it fits into i32, use integer; otherwise, use a rational
* WIP: throwing type error
* address most of the error cases
* cargo fmt
* address the rest of the error cases
* return null when JSONNumber::from_f64() returns None
* cargo fmt
* Update boa/src/builtins/value/mod.rs
* use JSONValue and use Result
* Update boa/src/builtins/json/mod.rs
Use and_then to avoid flatten
Co-authored-by: HalidOdat <halidodat@gmail.com>
Co-authored-by: Iban Eguia <razican@protonmail.ch>
Co-authored-by: HalidOdat <halidodat@gmail.com>
* Added documentation to make_builtin_fn
* Simple impl of parseInt()
* Impl rest of parse_int
* Fixed handling of strings starting 0x
* Made NaN return as per js spec
* Rework to improve clarity
* parseFloat impl, added tests
* Addressed comments to PR
* Removed f64 import
* Fixed handling of too many/few arguments to parseInt/Float
Co-authored-by: HalidOdat <halidodat@gmail.com>
Tries to make the README.md file more consistent. In some places the lines ended with a ".", while in others it did not. The licenses at the ended were missing some links and some sessions, such as [Benchmark] did not have any text besides the main link, among other things.
- Maded arrow functions non-constructable
- Simplified Function object and removed FunctionKind
- Rnamed create_ordinary -> ordinary, create_builtin -> builtin
- Added name and length properties in global objects
* Fix for 0 length field when constructing a new String.
* String.length uses character count not byte count. Also, corresponding test
* Made tests more succinct per suggestion.
* implement this
* remove construct/call from Object instead set func
* get_this_binding() was wrong, fixed
* BindingStatus is now properly set
* `this` now works on dynamic functions
* Migrates all builtins to use a single constructor/call fucntion to match the spec
* Ensure new object has an existing prototype
* create_function utility
* needing to clone before passing through
* Fix catch parsing - move the cursor to next token
* Refactor catch and finally parsing into separate modules
* Refactor catchparam parsing into separate module and add more tests
* Refactoring - use ? instead of match