From f2c7153e214929251feae1be78790e8a45d5398a Mon Sep 17 00:00:00 2001 From: furkle Date: Tue, 5 May 2020 17:27:39 -0400 Subject: [PATCH] Fix #478 This should fix issue #478 by printing the keys of `ValueType` rather than the integer values. --- src/NativeFunctionCall.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/NativeFunctionCall.ts b/src/NativeFunctionCall.ts index 23b185d9..8c4dca03 100644 --- a/src/NativeFunctionCall.ts +++ b/src/NativeFunctionCall.ts @@ -129,7 +129,8 @@ export class NativeFunctionCall extends InkObject{ if (this._operationFuncs === null) return throwNullException('NativeFunctionCall._operationFuncs'); let opForTypeObj = this._operationFuncs.get(valType); if (!opForTypeObj) { - throw new StoryException('Cannot perform operation '+this.name+' on '+valType); + const key = Object.keys(ValueType)[valType]; + throw new StoryException('Cannot perform operation '+this.name+' on '+key); } if (paramCount == 2) { @@ -253,8 +254,10 @@ export class NativeFunctionCall extends InkObject{ parametersOut.push(castedValue); } else throw new StoryException('Could not find List item with the value ' + intVal + ' in ' + list.name); - } else - throw new StoryException('Cannot mix Lists and ' + val.valueType + ' values in this operation'); + } else { + const key = Object.keys(ValueType)[val.valType]; + throw new StoryException('Cannot mix Lists and ' + key + ' values in this operation'); + } } }