You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implemented support for typeof, instanceof and the ability to deal with overloads for #122. Also found a random unsupported string type that was added.
This typeof implementation could cause some issues with type narrowing: IIRC, TS expects typeof to return "string" | "number" | "array" | "function" | "boolean" | "object", while lua's type will return "table" instead of "array" or "object".
I don't think array is a thing, I can't find any references to MDN, also typeof([]) gives me "object" in Chrome. I was discussing with @lolleko wether we should be returning "table" or "object", I think table should be fine as long as we document it properly.
I might have misremembered that with "array" then. My concern was mostly that if you have const something: object | number, if (typeof something === "table") won't successfully perform type narrowing. In fact, in recent versions of TS, I think it even produces a compiler error if you try to compare an unknown constant to a typeof result.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented support for
typeof,instanceofand the ability to deal with overloads for #122. Also found a random unsupported string type that was added.