Skip to content

Commit

Permalink
Fix debug assert parsing {}=>{} when not executing (fix #2365)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfwilliams committed May 10, 2023
1 parent 4efcab8 commit a3da8f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
Fix debug assert when reversing an array with non-integer elements (fix #2362)
Fix debug assert when using instanceof if __proto__ was set to non-object (fix #2363)
Fix debug assert when creating a function with code that isn't a string (fix #2364)
Fix debug assert parsing {}=>{} when not executing (fix #2365)

2v17 : Bangle.js: When reading file info from a filename table, do it in blocks of 8 (20% faster file search)
Bangle.js2: Increase flash buffer size from 16->32 bytes (5% performance increase)
Expand Down
6 changes: 4 additions & 2 deletions src/jsparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1601,9 +1601,11 @@ NO_INLINE JsVar *jspeAddNamedFunctionParameter(JsVar *funcVar, JsVar *name) {
#ifndef ESPR_NO_ARROW_FN
// parse an arrow function
NO_INLINE JsVar *jspeArrowFunction(JsVar *funcVar, JsVar *a) {
assert(!a || jsvIsName(a));
JSP_ASSERT_MATCH(LEX_ARROW_FUNCTION);
funcVar = jspeAddNamedFunctionParameter(funcVar, a);
if (JSP_SHOULD_EXECUTE) {
assert(!a || jsvIsName(a));
funcVar = jspeAddNamedFunctionParameter(funcVar, a);
}

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

0 comments on commit a3da8f7

Please sign in to comment.