Skip to content
This repository was archived by the owner on Oct 18, 2022. It is now read-only.

Commit 016e766

Browse files
committed
fix(ts): Add typeof' in @type of assert
Using import("assert").strict appears to cause TypeScript to enter an infinite loop. This prevented type checking from working properly in the test suite. Workaround: Add 'typeof' at the beginning of the @type annotation. Possibly related issue: microsoft/TypeScript#36830
1 parent b45562a commit 016e766

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

test/interpreter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Explicit type annotation is needed to suppress TypeScript error.
44
// See https://stackoverflow.com/a/59229771/ for more information.
5-
/** @type {import("assert").strict} */
5+
/** @type {typeof import("assert").strict} */
66
const assert = require("assert").strict;
77

88
const interpret = require("../src/interpreter.js");

test/lexer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Explicit type annotation is needed to suppress TypeScript error.
44
// See https://stackoverflow.com/a/59229771/ for more information.
5-
/** @type {import("assert").strict} */
5+
/** @type {typeof import("assert").strict} */
66
const assert = require("assert").strict;
77

88
const tokenize = require("../src/lexer.js");

test/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Explicit type annotation is needed to suppress TypeScript error.
44
// See https://stackoverflow.com/a/59229771/ for more information.
5-
/** @type {import("assert").strict} */
5+
/** @type {typeof import("assert").strict} */
66
const assert = require("assert").strict;
77

88
const parse = require("../src/parser.js");

0 commit comments

Comments
 (0)