-
-
Notifications
You must be signed in to change notification settings - Fork 532
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
Use of >>>
operator gives different results for same expression
#936
Comments
Every time you hit the "Enter" key, ts-node needs to pass all inputs from the entire REPL session to the typescript compiler as a single file. For example, if you refer to an interface that was declared earlier in the REPL session, the compiler needs to be given the declaration and the usage in a single source file. This means prior REPL inputs are compiled repeatedly, but only the emitted JavaScript corresponding with the most recent REPL input should be evaled. ts-node uses a diffing library to figure out which lines of code are new and should be evaled. In this case, the diff looks like this:
Looks like the code being compiled is |
You can see what the compiler's emitting via the Playground: |
As @cspotcode says, we have some tricks around this to handle ASI, but in this case it’s broken - should be fairly easy to fix though. |
I am working with bitwise operators. However, when I use the
>>>
operator I do not always get the same result:Here is my bash session:
What is going on here?
The text was updated successfully, but these errors were encountered: