Skip to content

Latest commit

 

History

History
633 lines (556 loc) · 32.9 KB

CHANGELOG.md

File metadata and controls

633 lines (556 loc) · 32.9 KB

CHANGELOG

0.10.0 (2020-09-29) - New Lexer & Test 262 Harness

Feature Enhancements:

  • FEATURE #524: Implement remaining Math methods (@mr-rodgers)
  • FEATURE #562: Implement remaining Number methods (@joshwd36)
  • FEATURE #536: Implement SyntaxError (@HalidOdat)
  • FEATURE #543: Implements Object.create builtin method (@croraf)
  • FEATURE #492: Switch to rustyline for the CLI (@IovoslavIovchev & @Razican)
  • FEATURE #595: Added syntax highlighting for strings in REPL (@HalidOdat)
  • FEATURE #586: Better error formatting and cli color (@HalidOdat)
  • FEATURE #590: Added keyword and operator colors and matching bracket validator to REPL (@HalidOdat)
  • FEATURE #555: Implement Array.prototype.reduce (@benjaminflin)
  • FEATURE #550: Initial implementation of Map() (@joshwd36 & @HalidOdat)
  • FEATURE #579: Implement Array.prototype.reduceRight (@benjaminflin)
  • FEATURE #585: Implement Well-Known Symbols (@joshwd36)
  • FEATURE #589: Implement the comma operator (@KashParty)
  • FEATURE #341: Ability to create multiline blocks in boa shell (@HalidOdat)
  • FEATURE #252: Implement Date (@jcdickinson)
  • FEATURE #711: Add support for >>>= (@arpit-saxena)
  • FEATURE #549: Implement label statements (@jasonwilliams)
  • FEATURE #373: Introduce PropertyKey for field acces (@RageKnify)
  • FEATURE #627: Feature native class objects (NativeObject and Class traits) (@HalidOdat)
  • FEATURE #694: Feature gc module (@HalidOdat)
  • FEATURE #656: Feature Context (@HalidOdat)
  • FEATURE #673: Add #[track_caller] to GcObject methods that can panic (@HalidOdat)
  • FEATURE #661: Add documentation to GcObject methods (@HalidOdat)
  • FEATURE #662: Implement std::error::Error for GcObject borrow errors (@HalidOdat)
  • FEATURE #660: Make GcObject::contruct not take 'this' (@HalidOdat)
  • FEATURE #654: Move require_object_coercible to Value (@HalidOdat)
  • FEATURE #603: Index PropertyKey, Object iterators and symbol support (@HalidOdat)
  • FEATURE #637: Feature boa::Result<T> (@HalidOdat)
  • FEATURE #625: Moved value operations from Interpreter to Value (@HalidOdat)
  • FEATURE #638: Changed to Value::to_*int32 => Value::to_*32 (@HalidOdat)

Bug Fixes:

  • BUG #405: Fix json.stringify symbol handling (@n14little)
  • BUG #520: Fix all Value operations and add unsigned shift right (@HalidOdat)
  • BUG #529: Refactor exec/expression into exec/call and exec/new (@croraf)
  • BUG #510: [[Call]] calling an undefined method does not throw (@joshwd36)
  • BUG #493: Use correct exponential representation for rational values (@Tropid)
  • BUG #572: Spec Compliant Number.prototype.toString(), better Number object formating and -0 (@HalidOdat)
  • BUG #599: Fixed String.prototype.indexOf() bug, when the search string is empty (@HalidOdat)
  • BUG #615: Fix abstract relational comparison operators (@HalidOdat)
  • BUG #608: Debug::fmt Causes Causes a Stack Overflow (@jcdickinson)
  • BUG #532 [builtins - Object] Object.getPrototypeOf returning incorrectly (@54k1)
  • BUG #533 [exec - function] function.prototype doesn't have own constructor property pointing to this function (@54k1)
  • BUG #641 Test new_instance_should_point_to_prototype is not checked correctly (@54k1)
  • BUG #644 undefined constants panic on execution (@jcdickinson)
  • BUG #631: Unexpected result when applying typeof to undefined value (@jcdickinson)
  • BUG #667: Fix panic when calling function that mutates itself (@dvtkrlbs)
  • BUG #668: Fix clippy on Nightly (@dvtkrlbs)
  • BUG #582: Make String.prototype.repeat() ECMAScript specification compliant (@HalidOdat)
  • BUG #541: Made all Math methods spec compliant (@HalidOdat)
  • BUG #597: Made String.prototype.indexOf spec compliant. (@HalidOdat)
  • BUG #598: Made String.prototype.lastIndexOf() spec compliant (@HalidOdat)
  • BUG #583: Fix string prototype trim methods (@HalidOdat)
  • BUG #728: Fix bug when setting the length on String objects (@jasonwilliams)
  • BUG #710: Fix panic when a self mutating function is constructing an object (@HalidOdat)
  • BUG #699: Fix Value::to_json order of items in array (@sele9)
  • BUG #610: Fix: String.prototype.replace substitutions (@RageKnify)
  • BUG #645: Fix undefined constant expression evaluation (@jcdickinson)
  • BUG #643: Change default return type from null to undefined (@54k1)
  • BUG #642: Missing constructor field in ordinary functions (@54k1)
  • BUG #604: Missing __proto__ field in functions instances (@54k1)
  • BUG #561: Throw a TypeError when a non-object is called (@joshwd36)
  • BUG #748: Fix parse error throwing a TypeError, instead of SyntaxError (@iamsaquib8)
  • BUG #737: Make Object.toString() spec compliant (@RageKnify)

Internal Improvements:

Feature Enhancements:

  • FEATURE #414: Implement Number object constants (@Lan2u) (@HalidOdat)
  • FEATURE #345: Implement the optional replacer parameter in JSON.stringify( value[, replacer [, space] ] ) (@n14little)
  • FEATURE #480: Implement global Infinity property (@AnirudhKonduru)
  • FEATURE #410: Add support for the reviver function to JSON.parse (@abhijeetbhagat)
  • FEATURE #425: Specification compliant ToString (to_string) (@HalidOdat)
  • FEATURE #442: Added TypeError implementation (@HalidOdat)
  • FEATURE #450: Specification compliant ToBigInt (to_bigint) (@HalidOdat)
  • FEATURE #455: TemplateLiteral Basic lexer implementation (@croraf)
  • FEATURE #447: parseInt, parseFloat implementation (@Lan2u)
  • FEATURE #468: Add BigInt.asIntN() and BigInt.asUintN() functions (@Tropid)
  • FEATURE #428: [Feature Request] - Create benchmark for Array manipulation (@abhijeetbhagat)
  • FEATURE #439: Implement break handling in switch statements (@Lan2u)
  • FEATURE #301: Implementing the switch statement in the new parser (@Lan2u)
  • FEATURE #120: Implement globalThis (@zanayr)
  • FEATURE #513: Implement Object.is() method (@tylermorten)
  • FEATURE #481: Implement global undefined property (@croraf)

Bug Fixes:

  • BUG #412: Fixed parsing if statement without else block preceded by a newline (@HalidOdat)
  • BUG #409: Fix function object constructable/callable (@HalidOdat)
  • BUG #403 Value::to_json() does not handle undefined correctly (@n14little)
  • BUG #443: HasOwnProperty should call GetOwnProperty and not GetProperty (@n14little)
  • BUG #210: builtinfun.length undefined (@Croraf)
  • BUG #466: Change ToPrimitive() (to_primitive()) hint to be an enum, instead of string (@HalidOdat)
  • BUG #421: NaN is lexed as a number, not as an identifier (@croraf)
  • BUG #454: Function declaration returns the function, it should return undefined (@croraf)
  • BUG #482: Field access should propagate the exception (Err(_)) (@neeldug)
  • BUG #463: Use of undefined variable should throw an error (@croraf)
  • BUG #502: Fixed global objects initialization order (@HalidOdat)
  • BUG #509: JSON.stringify(undefined) panics (@n14little)
  • BUG #514: Clean up Math Methods (@n14little)
  • BUG #511: [Call] Usage of "this" in methods is not supported (@jasonwilliams)

Internal Improvements

v0.8.0 brings more language implementations, such as do..while, function objects and also more recent EcmaScript additions, like BigInt. We have now moved the Web Assembly build into the wasm package, plus added a code of conduct for those contributing.

The parser has been even more modularized in this release making it easier to add new parsing rules.

Boa has migrated it's object implemention to FXHash which brings much improved results over the built-in Rust hashmaps (at the cost of less DOS Protection).

Feature Enhancements:

Bug fixes:

  • BUG #308: Assignment operator not working in tests (a = a +1) (@ptasz3k)
  • BUG #322: Benchmarks are failing in master (@Razican)
  • BUG #325: Put JSON functions on the object, not the prototype (@coolreader18)
  • BUG #331: We only get Const::Num, never Const::Int (@HalidOdat)
  • BUG #209: Calling new Array with 1 argument doesn't work properly (@HalidOdat)
  • BUG #266: Panic assigning named function to variable (@Razican)
  • BUG #397: fix NaN is lexed as identifier, not as a number (@attliaLin)
  • BUG #362: Remove Monaco Editor Webpack Plugin and Manually Vendor Editor Workers (@subhankar-panda)
  • BUG #406: Dependency Upgrade (@Razican)
  • BUG #407: String() wasn't defaulting to empty string on call (@jasonwilliams)
  • BUG #404: Fix for 0 length new String(@tylermorten)

Code Of Conduct:

  • COC #384: Code of conduct added (@Razican)

Security:

  • SEC #391: run security audit daily at midnight. (@n14little)

v0.7.0 brings a REPL, Improved parser messages and a new parser! This is now the default behaviour of Boa, so running Boa without a file argument will bring you into a javascript shell. Tests have also been moved to their own files, we had a lot of tests in some modules so it was time to separate.

New Parser

Most of the work in this release has been on rewriting the parser. A big task taken on by HalidOdat, Razican and myself.

The majority of the old parser was 1 big function (called parse) which had some pattern matching on each token coming in.
The easy branches could generate expressions (which were basically AST Nodes), the more involved branches would recursively call into the same function, until eventually you had an expression generated.

This only worked so far, eventually debugging parsing problems were difficult, also more bugs were being raised against the parser which couldn't be fixed.

We decided to break the parser into more of a state-machine. The initial decision for this was inspired by Fedor Indutny who did a talk at (the last) JSConf EU about how he broke up the old node-parser to make it more maintanable. He goes into more detail here https://www.youtube.com/watch?v=x3k_5Mi66sY&feature=youtu.be&t=530

The new parser has functions to match the states of parsing in the spec. For example https://tc39.es/ecma262/#prod-VariableDeclaration has a matching function read_variable_declaration. This not only makes it better to maintain but easier for new contributors to get involed, as following the parsing logic of the spec is easier than before.

Once finished some optimisations were added by HalidOdat to use references to the tokens instead of cloning them each time we take them from the lexer.
This works because the tokens live just as long as the parser operations do, so we don't need to copy the tokens.
What this brings is a huge performance boost, the parser is 67% faster than before!

Parser Improvement

Feature enhancements:

  • FEATURE #281: Rebuild the parser (@jasonwilliams, @Razican, @HalidOdat)
  • FEATURE #278: Added the ability to dump the token stream or ast in bin. (@HalidOdat)
  • FEATURE #253: Implement Array.isArray (@cisen)
  • FEATURE Switch to normal output instead of debugged output (stdout/stdout) (@jasonwilliams)
  • FEATURE #258: Moved test modules to their own files (@Razican)
  • FEATURE #267: Add print & REPL functionality to CLI (@JohnDoneth)
  • FEATURE #268: Addition of forEach() (@jasonwilliams) (@xSke)
  • FEATURE #262: Implement Array.prototype.filter (@Nickforall)
  • FEATURE #261: Improved parser error messages (@Razican)
  • FEATURE #277: Add a logo to the project (@HalidOdat)
  • FEATURE #260: Add methods with f64 std equivelant to Math object (@Nickforall)

Bug fixes:

  • BUG #249: fix(parser): handle trailing comma in object literals (@gomesalexandre)
  • BUG #244: Fixed more Lexer Panics (@adumbidiot)
  • BUG #256: Fixed comments lexing (@Razican)
  • BUG #251: Fixed empty returns (@Razican)
  • BUG #272: Fix parsing of floats that start with a zero (@Nickforall)
  • BUG #240: Fix parser panic
  • BUG #273: new Class().method() has incorrect precedence

Documentation Updates:

  • DOC #297: Better user contributed documentation

The lexer has had several fixes in this release, including how it parses numbers, scientific notation should be improved. On top of that the lexer no longer panics on errors including Syntax Errors (thanks @adumbidiot), instead you get some output on where the error happened.

Moving to a workspace architecture

Boa offers both a CLI and a library, initially these were all in the same binary. The downside is those who want to embed boa as-is end up with all of the command-line dependencies. So the time has come to separate out the two, this is normal procedure, this should be analogous to ripgrep and the regex crate. Cargo has great support for workspaces, so this shouldn't be an issue.

Benchmarks

We now have benchmarks which run against master! Thanks to Github Actions these will run automatically a commit is merged.

Feature enhancements:

Bug fixes:

  • BUG #222: Fixed clippy errors (@IovoslavIovchev)
  • BUG #228: [lexer: single-line-comment] Fix bug when single line comment is last line of file (@croraf)
  • BUG #229: Replace error throwing with panic in "Lexer::next()" (@croraf)
  • BUG #232/BUG #238: Clippy checking has been scaled right back to just Perf and Style (@jasonwilliams)
  • BUG #227: Array.prototype.toString should be called by ES value (@cisen)
  • BUG #242: Fixed some panics in the lexer (@adumbidiot)
  • BUG #235: Fixed arithmetic operations with no space (@gomesalexandre)
  • BUG #245: Fixed parsing of floats with scientific notation (@adumbidiot)

Feature enhancements:

  • FEATURE #151: Implement the Rest/Spread operator (functions and arrays).
  • FEATURE #193: Implement macro for setting builtin functions
  • FEATURE #211: Better Display support for all Objects (pretty printing)

Feature enhancements:

  • FEATURE #119: Introduce realm struct to hold realm context and global object.
  • FEATURE #89: Implement exponentiation operator. Thanks @arbroween
  • FEATURE #47: Add tests for comments in source code. Thanks @Emanon42
  • FEATURE #137: Use Monaco theme for the demo page
  • FEATURE #114: String.match(regExp) is implemented (@muskuloes)
  • FEATURE #115: String.matchAll(regExp) is implemented (@bojan88)
  • FEATURE #163: Implement Array.prototype.every() (@letmutx)
  • FEATURE #165: Implement Array.prototype.find() (@letmutx)
  • FEATURE #166: Implement Array.prototype.findIndex() (@felipe-fg)
  • FEATURE #39: Implement block scoped variable declarations (@barskern)
  • FEATURE #161: Enable obj[key] = value syntax.
  • FEATURE #179: Implement the Tilde operator (@letmutx)
  • FEATURE #189: Implement Array.prototype.includes (incl tests) (@simonbrahan)
  • FEATURE #180: Implement Array.prototype.slice (@muskuloes @letmutx)
  • FEATURE #152: Short Function syntax (no arguments)
  • FEATURE #164: Implement Array.prototype.fill() (@bojan88)
  • Array tests: Tests implemented for shift, unshift and reverse, pop and push (@muskuloes)
  • Demo page has been improved, new font plus change on input. Thanks @WofWca
  • FEATURE #182: Implement some Number prototype methods (incl tests) (@pop)
  • FEATURE #34: Number object and Constructore are implemented (including methods) (@pop)
  • FEATURE #194: Array.prototype.map (@IovoslavIovchev)
  • FEATURE #90: Symbol Implementation (@jasonwilliams)

Bug fixes:

  • BUG #113: Unassigned variables have default of undefined (@pop)
  • BUG #61: Clippy warnings/errors fixed (@korpen)
  • BUG #147: Updated object global
  • BUG #154: Correctly handle all whitespaces within the lexer
  • Tidy up Globals being added to Global Object. Thanks @DomParfitt

0.4.0 (2019-09-25)

v0.4.0 brings quite a big release. The biggest feature to land is the support of regular expressions. Functions now have the arguments object supported and we have a debugging section in the docs.

Feature enhancements:

  • FEATURE #6: Support for regex literals. (Big thanks @999eagle)
  • FEATURE #13: toLowerCase, toUpperCase, substring, substr and valueOf implemented (thanks @arbroween)
  • Support for arguments object within functions
  • StringData instead of PrimitieData to match spec
  • Native function signatures changed, operations added to match spec
  • Primitives can now be boxed/unboxed when methods are ran on them
  • Spelling edits (thanks @someguynamedmatt)
  • Ability to set global values before interpreter starts (thanks @999eagle)
  • Assign operators implemented (thanks @oll3)

Bug fixes:

  • BUG #57: Fixed issue with stackoverflow by implementing early returns.
  • Allow to re-assign value to an existing binding. (Thanks @oll3)

0.3.0 (2019-07-26)

  • UnexpectedKeyword(Else) bug fixed boa-dev#38
  • Contributing guide added
  • Ability to specify file - Thanks @callumquick
  • Travis fixes
  • Parser Tests - Thanks @Razican
  • Migrate to dyn traits - Thanks @Atul9
  • Added implementations for Array.prototype: concat(), push(), pop() and join() - Thanks @callumquick
  • Some clippy Issues fixed - Thanks @Razican
  • Objects have been refactored to use structs which are more closely aligned with the specification
  • Benchmarks have been added
  • String and Array specific console.log formats - Thanks @callumquick
  • isPropertyKey implementation added - Thanks @KrisChambers
  • Unit Tests for Array and Strings - Thanks @GalAster
  • typo fix - Thanks @palerdot
  • dist cleanup, thanks @zgotsch

0.2.1 (2019-06-30)

Some String prototype methods are implemented. Thanks to @lennartbuit we have trim/trimStart/trimEnd added to the string prototype

Feature enhancements:

Bug fixes:

  • Plenty

0.2.0 (2019-06-10)

Working state reached

  • Tests on the lexer, conforms with puncturators and keywords from TC39 specification
  • wasm-bindgen added with working demo in Web Assembly
  • snapshot of boa in a working state for the first time