Skip to content

Commit

Permalink
Revert "Fix potential for crash after ReferenceError during function …
Browse files Browse the repository at this point in the history
…declaration (fix #2457)"

This reverts commit 5fee08f.
  • Loading branch information
gfwilliams committed Feb 1, 2024
1 parent 08040d1 commit 856a5f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
Fix issue with g.wrapString when running on flash-based strings
Fix lock leak when using flat/flash/native strings as object indices
Fix g.wrapString lockup if wrap width is less than the character width
Fix potential for crash after ReferenceError during function declaration (fix #2457)

2v20 : Ensure String.charCodeAt returns NaN for out of bounds chars
Bangle.js2: When rendering overlays, *do not* use the current FG/BG color for 1 bit overlays
Expand Down
7 changes: 2 additions & 5 deletions src/jsparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,12 +1319,9 @@ NO_INLINE JsVar *jspeFactorFunctionCall() {
while ((lex->tk=='(' || (isConstructor && JSP_SHOULD_EXECUTE)) && !jspIsInterrupted()) {
JsVar *funcName = a;
JsVar *func = jsvSkipName(funcName);
if (!func) { // could have ReferenceErrored while skipping name
jsvUnLock2(funcName, parent);
return 0;
}

/* The constructor function doesn't change parsing, so if we're
* not executing, just short-cut it. */
* not executing, just short-cut it. */
if (isConstructor && JSP_SHOULD_EXECUTE) {
// If we have '(' parse an argument list, otherwise don't look for any args
bool parseArgs = lex->tk=='(';
Expand Down

0 comments on commit 856a5f6

Please sign in to comment.