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

JavaScript runtime: deprecated usage update, index fixes for deprecated references. #4536

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions runtime/JavaScript/spec/rewriter/TokenStreamRewriterSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import calc from "./generatedCode/calc.js";
* @param {string} input
*/
function getRewriter(lexerClass, input) {
const chars = new antlr4.InputStream(input);
const chars = new antlr4.CharStreams.fromString(input);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a static function, please remove new

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Embarrassing mistake, of course! Fixed.

const lexer = new lexerClass(chars);
const tokens = new antlr4.CommonTokenStream(lexer);
tokens.fill();
Expand Down Expand Up @@ -385,7 +385,7 @@ describe("TokenStreamRewriter", () => {

it("throws an error if second replace operation overlaps the first one on the left", () => {
// Arrange
const chars = new antlr4.InputStream("abcccba");
const chars = new antlr4.CharStreams.fromString("abcccba");
const lexer = new abc(chars);
const tokens = new antlr4.CommonTokenStream(lexer);
tokens.fill();
Expand Down
2 changes: 1 addition & 1 deletion runtime/JavaScript/src/antlr4/Lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class Lexer extends Recognizer {
this.notifyListeners(e); // report error
this.recover(e);
} else {
console.log(e.stack);
console.log(e.stack);
throw e;
}
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/JavaScript/src/antlr4/index.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { default as Utils } from './utils/index.js';
import Token from './Token.js';
import CommonToken from './CommonToken.js';
import InputStream from './InputStream.js';
import CharStream from './InputStream.js';
import CharStream from './CharStream.js';
import FileStream from './FileStream.js';
import CommonTokenStream from './CommonTokenStream.js';
import Lexer from './Lexer.js';
Expand Down
2 changes: 1 addition & 1 deletion runtime/JavaScript/src/antlr4/index.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { default as Utils } from './utils/index.js';
import Token from './Token.js';
import CommonToken from './CommonToken.js';
import InputStream from './InputStream.js';
import CharStream from './InputStream.js';
import CharStream from './CharStream.js';
import CommonTokenStream from './CommonTokenStream.js';
import Lexer from './Lexer.js';
import Parser from './Parser.js';
Expand Down
Loading