Skip to content

Commit ff93965

Browse files
committed
Fix escape characters in strings inside templates inside templated strings ${"\n"}
1 parent f0276bb commit ff93965

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
Puck.js: E.getTemperature(true) will now use the uC's internal temp sensor (previously only external was possible)
2626
Add fast path to xIntArray.indexOf
2727
Add median-of-3 for Array.sort (1/3 of the compares for pre-sorted data)
28+
Fix escape characters in strings inside templates inside templated strings `${"\n"}`
2829

2930
2v27 : nRF5x: Ensure Bluetooth notifications work correctly when two separate connections use the same handle for their characteristics
3031
nRF5x: Remove handlers from our handlers array when a device is disconnected

src/jslex.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,8 @@ static void jslLexString() {
352352
tempatedStringHasTemplate = true;
353353
} else if (nesting && lex->currCh=='}') nesting--;
354354
}
355-
if (lex->currCh == '\\') {
355+
if (nesting==0 && lex->currCh == '\\') {
356+
// only handle escaped characters in the outer template string
356357
jslGetNextCh();
357358
char ch = lex->currCh;
358359
switch (lex->currCh) {

0 commit comments

Comments
 (0)