* Refactor: Define all property methods of constructors
* Refactor: Simplify naming of ConstructorBuilder methods
As per review in #1109 by @HalidOdat
Co-authored-by: Halid Odat <halidodat@gmail.com>
Fix octal escape in string literal
Add tests
Fix zero escape
Fix zero escape lookahead
Rename variables
Rename helper functions
Refactor match arms
Fix escape line terminator sequence
Fix single character escape
Fix line terminator and escape followed by unicode char
Fix broken tests
Add NonOctalDecimalEscapeSequence
Fix comment
Refactor
Modify error message
Add tests
Rename tests
Add test for error
Add comments for unsafe bytes to str
Update boa/src/syntax/lexer/string.rs
Co-authored-by: tofpie <75836434+tofpie@users.noreply.github.com>
Minor refactor
Remove unsafe bytes to str
Fix panic when reading invalid utf-8 chars
Refactor string literal
Support invalid utf-8 chars in string literal input
Add cook function for template literal
Fix line continuation bug
Add methods for utf16 buffer trait
Add trait comments
Add error message for template literal
Add and fix comments
Hide unused exported function and modify tests
Fix bug
Fix merge bug
* Add overflow check when fixing year, month, and day
* Add timeclip
* Add timeclip to `Date.UTC()`
* Minor fix
* Fix comment
* Add more range check
* Add timeclip to all date creation
* Remove redundant overflow check
* Fix clippy
* Add newTarget to construct
* Fix construct for self-mutating function
* Implement suggestions from review
Co-authored-by: tofpie <tofpie@users.noreply.github.com>
* Fixed a bunch of test262 panics (#817)
This also implements a spec-compliant `parseInt()` function.
* Reverted a test
* Addressed long comments from review
* VM: Implement LetDeclList and the `let` keyword
* Support var and const
* Split defining and initializing into separate instructions
* DefLet doesn't need the value
* InitLexical initializes value if set
* Code review
* Fix rustfmt
* Add documentation
* InitLexical fix
Co-authored-by: jasonwilliams <jase.williams@gmail.com>
Nodes implement CodeGen which generates instructions onto a stack held in Context.
The VM will interpret the instructions from Context.
There are some issues:
- Only basic instructions are added, but I'm working off https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Internals/Bytecode for now it should be easy to add more in.
- The Stack is a Vec, this isn't ideal (we may be able to live with it for now) but the stack should really be a fixed sized array. This isn't possible because Value can't be copied in there as it holds Rc and Gc values. Can we have fixed-sized Values that hold a pointer? Something like the "stackvec" crate should help
- put all VM related code behind "vm" feature flag
Co-authored-by: Jason Williams <jwilliams720@bloomberg.net>
Co-authored-by: Halid Odat <halidodat@gmail.com>
* Implement for..in
* Fix code styling issue
* Add break and continue with label
* Add break and continue for while and do-while
* Add unit tests
* Fix formatting
* Split node ForInOfLoop into ForInLoop and ForOfLoop
* Fix issues in ForInOfLoop node splitting
* Merge with master branch
Co-authored-by: tofpie <tofpie@users.noreply.github.com>
- Fix panic if first argument is not supplied.
- Fix panic if second argument is not supplied.
- Fix bug when the object is not a object.
- Implemented `DefinePropertyOrThrow()`