Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeFunctionCall prints enum values in error messages, not value type strings #478

Closed
furkle opened this issue May 5, 2020 · 2 comments

Comments

@furkle
Copy link
Contributor

furkle commented May 5, 2020

Overview

I have noticed multiple times that runtime error messages produced by inkjs differ in slight but significant ways by those outputting by Inky. In particular, when one attempts to perform a logical operation like > on a variable which is not a number, the error message one should get looks approximately like this:

Cannot perform operation > on String

However, in inkjs, this looks like so:

Cannot perform operation > on 3

After a colleague pointed out this was likely referring to a type, not a value, we found that error messages from NativeFunctionCall.ts were including the value from the enum, which is an integer, rather than the key, which is a string.

Reproduction

  1. Produce a runtime error by comparing two variables which are of an incomparable type.
  2. Note the error produced in inkjs differs from that produced by Inky.

Pull request

#479

furkle pushed a commit to furkle/inkjs that referenced this issue May 5, 2020
This should fix issue y-lohse#478 by printing the keys of `ValueType` rather than the integer values.
@furkle furkle mentioned this issue May 5, 2020
@ephread
Copy link
Collaborator

ephread commented May 5, 2020

Oh, that's another nice find @furkle, thanks! I'll have a look at the PR.

@furkle
Copy link
Contributor Author

furkle commented May 5, 2020

Travis is failing so unfortunately I'm not sure if it's actually a working PR, but it's basically a two-line fix, so I hope it works 😄

y-lohse pushed a commit that referenced this issue May 15, 2020
This should fix issue #478 by printing the keys of `ValueType` rather than the integer values.
y-lohse pushed a commit that referenced this issue May 25, 2020
This should fix issue #478 by printing the keys of `ValueType` rather than the integer values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants