Skip to content

Commit

Permalink
fix: evaluator script may contains comment line
Browse files Browse the repository at this point in the history
  • Loading branch information
tinymins committed Sep 5, 2024
1 parent 1764be8 commit a2168a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/drip-table/src/utils/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const createEvaluator = (script: string, contextKeys: string[] = []) => {
: void 0;
if (!evaluator) {
// 包裹二阶函数,用于兼容微前端
script = `return function(${contextKeys.join(', ')}) { ${script} }`;
script = `return function(${contextKeys.join(', ')}) { ${script}\n}`;
evaluator = new Function('window', script)(window);
if (evaluator) { evaluatorCache.set(key, evaluator); }
}
Expand Down

0 comments on commit a2168a1

Please sign in to comment.