From e76e358d98312b248f16637b32c22196b51aeb0f Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 1 May 2019 19:50:52 +0900 Subject: [PATCH] Fix bug --- src/misc/aiscript/evaluator.ts | 10 ---------- src/misc/aiscript/type-checker.ts | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/misc/aiscript/evaluator.ts b/src/misc/aiscript/evaluator.ts index 0de924e81..fef2d4f3a 100644 --- a/src/misc/aiscript/evaluator.ts +++ b/src/misc/aiscript/evaluator.ts @@ -112,16 +112,6 @@ export class ASEvaluator { this.envVars.SEED = seed; } - @autobind - public getVarByName(name: string): Variable { - const v = this.variables.find(x => x.name === name); - if (v !== undefined) { - return v; - } else { - throw new AiScriptError(`No such variable '${name}'`); - } - } - @autobind private interpolate(str: string, scope: Scope) { return str.replace(/\{(.+?)\}/g, match => { diff --git a/src/misc/aiscript/type-checker.ts b/src/misc/aiscript/type-checker.ts index c40c844ea..817e54986 100644 --- a/src/misc/aiscript/type-checker.ts +++ b/src/misc/aiscript/type-checker.ts @@ -139,6 +139,16 @@ export class ASTypeChecker { } } + @autobind + public getVarByName(name: string): Variable { + const v = this.variables.find(x => x.name === name); + if (v !== undefined) { + return v; + } else { + throw new Error(`No such variable '${name}'`); + } + } + @autobind public getVarsByType(type: Type): Variable[] { if (type == null) return this.variables;