Skip to content

Commit a3da8f7

Browse files
committed
Fix debug assert parsing {}=>{} when not executing (fix #2365)
1 parent 4efcab8 commit a3da8f7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
Fix debug assert when reversing an array with non-integer elements (fix #2362)
3232
Fix debug assert when using instanceof if __proto__ was set to non-object (fix #2363)
3333
Fix debug assert when creating a function with code that isn't a string (fix #2364)
34+
Fix debug assert parsing {}=>{} when not executing (fix #2365)
3435

3536
2v17 : Bangle.js: When reading file info from a filename table, do it in blocks of 8 (20% faster file search)
3637
Bangle.js2: Increase flash buffer size from 16->32 bytes (5% performance increase)

src/jsparse.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,9 +1601,11 @@ NO_INLINE JsVar *jspeAddNamedFunctionParameter(JsVar *funcVar, JsVar *name) {
16011601
#ifndef ESPR_NO_ARROW_FN
16021602
// parse an arrow function
16031603
NO_INLINE JsVar *jspeArrowFunction(JsVar *funcVar, JsVar *a) {
1604-
assert(!a || jsvIsName(a));
16051604
JSP_ASSERT_MATCH(LEX_ARROW_FUNCTION);
1606-
funcVar = jspeAddNamedFunctionParameter(funcVar, a);
1605+
if (JSP_SHOULD_EXECUTE) {
1606+
assert(!a || jsvIsName(a));
1607+
funcVar = jspeAddNamedFunctionParameter(funcVar, a);
1608+
}
16071609

16081610
bool expressionOnly = lex->tk!='{';
16091611
bool fnIncludesThis = jspeFunctionDefinitionInternal(funcVar, expressionOnly);

0 commit comments

Comments
 (0)