Skip to content

Commit

Permalink
Fix #478
Browse files Browse the repository at this point in the history
This should fix issue #478 by printing the keys of `ValueType` rather than the integer values.
  • Loading branch information
furkle authored and y-lohse committed May 15, 2020
1 parent c5d5c28 commit a6b71f7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/NativeFunctionCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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');
}
}
}

Expand Down

0 comments on commit a6b71f7

Please sign in to comment.