From 76d32e428c4e846973210fc3a3e8c7d9f9d11842 Mon Sep 17 00:00:00 2001 From: kim jeong yong Date: Fri, 30 Jan 2026 15:37:41 +0900 Subject: [PATCH 1/2] Refactor scope assignment in block_func.js to use optional chaining and improve safety. Added a check for the first block before creating a new Entry.Scope instance. --- src/playground/blocks/block_func.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/playground/blocks/block_func.js b/src/playground/blocks/block_func.js index 295ee6c968..c9113d1f49 100644 --- a/src/playground/blocks/block_func.js +++ b/src/playground/blocks/block_func.js @@ -466,10 +466,11 @@ module.exports = { } this.funcExecutor.result = this.funcExecutor.scope; - this.funcExecutor.scope = new Entry.Scope( - this.funcExecutor.scope.block.statements[0].getFirstBlock(), - this.funcExecutor - ); + + const firstBlock = this.funcExecutor?.scope?.block?.statements[0]?.getFirstBlock(); + if(firstBlock) { + this.funcExecutor.scope = new Entry.Scope(firstBlock, this.funcExecutor); + } const { promises } = this.funcExecutor.execute(); if (!this.funcExecutor.isEnd()) { From 3bf057abc26133e0f0429e722f589db1194361e3 Mon Sep 17 00:00:00 2001 From: kim jeong yong Date: Fri, 30 Jan 2026 15:42:59 +0900 Subject: [PATCH 2/2] Refactor formatting in block_func.js for improved readability. Adjusted line breaks for better clarity in the assignment of the first block. --- src/playground/blocks/block_func.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/playground/blocks/block_func.js b/src/playground/blocks/block_func.js index c9113d1f49..570746832b 100644 --- a/src/playground/blocks/block_func.js +++ b/src/playground/blocks/block_func.js @@ -467,8 +467,9 @@ module.exports = { this.funcExecutor.result = this.funcExecutor.scope; - const firstBlock = this.funcExecutor?.scope?.block?.statements[0]?.getFirstBlock(); - if(firstBlock) { + const firstBlock = + this.funcExecutor?.scope?.block?.statements[0]?.getFirstBlock(); + if (firstBlock) { this.funcExecutor.scope = new Entry.Scope(firstBlock, this.funcExecutor); } const { promises } = this.funcExecutor.execute();