Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/playground/blocks/block_func.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,11 @@ module.exports = {
this.funcExecutor.localVariables = _cloneDeep(func.localVariables);
}

this.funcExecutor.result = this.funcExecutor.scope;
this.funcExecutor.scope = new Entry.Scope(
this.funcExecutor.scope.block.statements[0].getFirstBlock(),
this.funcExecutor
);
const { promises } = this.funcExecutor.execute();

if (!this.funcExecutor.isEnd()) {
Expand Down
16 changes: 9 additions & 7 deletions src/playground/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ class Scope {
}

getParam(index) {
const fieldBlock = this.block.params[index];
const newScope = new Entry.Scope(fieldBlock, this.executor);
const result = newScope.run(this.entity, true);
return result;
const param = this.block.params[index];
if (param instanceof Entry.Block) {
const newScope = new Entry.Scope(param, this.executor);
const result = newScope.run(this.entity, true);
return result;
} else {
return this.filterReservedKeywords(param);
}
}

// 클래스 레벨에서 한 번만 생성
Expand All @@ -27,11 +31,10 @@ class Scope {
}

getParams() {
const that = this;
return this.block.params.map((param) => {
if (param instanceof Entry.Block) {
const fieldBlock = param;
const newScope = new Entry.Scope(fieldBlock, that.executor);
const newScope = new Entry.Scope(fieldBlock, this.executor);
return newScope.run(this.entity, true);
} else {
return this.filterReservedKeywords(param);
Expand Down Expand Up @@ -185,7 +188,6 @@ class Scope {
}
const values = this.getParams();
const isPromise = values.some((value) => value instanceof Promise);
// const schema = this.block.getSchema();
if (!schema.func) {
return;
}
Expand Down