By using an identifier in a BrightScript file as an index into that object, we accidentally leaked non-Token properties on the KeyWords JS object from the lexer, e.g. return KeyWords["constructor"]. Use hasOwnProperty() to check if an identifier is a BrightScript keyword to avoid returning JavaScript internals as Tokens.
By using an identifier in a BrightScript file as an index into that object, we accidentally leaked non-Token properties on the
KeyWords
JS object from the lexer, e.g.return KeyWords["constructor"]
. UsehasOwnProperty()
to check if an identifier is a BrightScript keyword to avoid returning JavaScript internals as Tokens.fixes #613