Fix bug with top-level-await with class variable init

* Prevent native stack overflow
* Fix bug in ExecutionState::inPauserScope

Signed-off-by: Seonghyun Kim <sh8281.kim@samsung.com>
This commit is contained in:
Seonghyun Kim 2023-10-23 20:07:40 +09:00 committed by Hyukwoo Park
commit 97e698db34
4 changed files with 41 additions and 29 deletions

View file

@ -419,6 +419,12 @@ ScriptParser::InitializeScriptResult ScriptParser::initializeScript(String* orig
if (LIKELY(needByteCodeGeneration)) {
try {
#if defined(ENABLE_CODE_CACHE)
// give up if there is top-level-await
if (topCodeBlock->isAsync()) {
cacheable = false;
deleteCodeBlockCacheInfo();
}
// Store cache
if (cacheable) {
codeCache->prepareCacheWriting(srcHash);