-
-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lazy evaluation for cooked template string #1103
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1103 +/- ##
==========================================
+ Coverage 58.81% 58.83% +0.02%
==========================================
Files 176 176
Lines 12467 12468 +1
==========================================
+ Hits 7332 7336 +4
+ Misses 5135 5132 -3
Continue to review full report at Codecov.
|
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 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 Lazy evaluate cooked template string Fix clippy Fix test262 stack overflow issue Fix invalid setting strict mode with template literal Remove unnecessary cache Remove
b6f270d
to
2c2ab77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! :)
* Lazy evaluate cooked template string 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 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 Lazy evaluate cooked template string Fix clippy Fix test262 stack overflow issue Fix invalid setting strict mode with template literal Remove unnecessary cache Remove * Add comments * Minor update
This Pull Request makes the evaluation of cooked template strings lazily, which improves the performance in some cases and fixes invalid escapes in raw template strings. The following sample is now supported
It changes the following:
TemplateString
and update template related keywords`use strict`;
can not be used to invoke strict mode