-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: parameter variable infinite recursion error (#5500)
* fix: parameter variable infinite recursion error Ensure before hasEffects of function body (triggered by function call), the arguments are first provided * update test
- Loading branch information
Showing
5 changed files
with
52 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = defineTest({ | ||
description: | ||
'Avoid maximum call stack error, make sure parameter value is optimized before hasEffects (#5499).' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
let created = 0; | ||
|
||
function Test(options) { | ||
if (!this) { | ||
return new Test(options); | ||
} | ||
if (options.x) { | ||
return 0; | ||
} | ||
created++; | ||
} | ||
|
||
function Test2(options) { | ||
if (!this) { | ||
return new Test2(options); | ||
} | ||
if (options.x) { | ||
return 0; | ||
} | ||
created++; | ||
} | ||
|
||
new Test({}); | ||
Test2`{}`; | ||
|
||
assert.equal(created, 2); |