Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
21 changes: 21 additions & 0 deletions tests/baselines/reference/narrowingPlainJsNoCrash1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//// [tests/cases/compiler/narrowingPlainJsNoCrash1.ts] ////

//// [index.js]
// https://github.com/microsoft/TypeScript/issues/59594

var a$b = {};
var c, d;
d = a$b;
while (d !== a$b);
while ((c = a$b != a$b)) c.e;


//// [index.js]
// https://github.com/microsoft/TypeScript/issues/59594
var a$b = {};
var c, d;
d = a$b;
while (d !== a$b)
;
while ((c = a$b != a$b))
c.e;
26 changes: 26 additions & 0 deletions tests/baselines/reference/narrowingPlainJsNoCrash1.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//// [tests/cases/compiler/narrowingPlainJsNoCrash1.ts] ////

=== index.js ===
// https://github.com/microsoft/TypeScript/issues/59594

var a$b = {};
>a$b : Symbol(a$b, Decl(index.js, 2, 3))

var c, d;
>c : Symbol(c, Decl(index.js, 3, 3))
>d : Symbol(d, Decl(index.js, 3, 6))

d = a$b;
>d : Symbol(d, Decl(index.js, 3, 6))
>a$b : Symbol(a$b, Decl(index.js, 2, 3))

while (d !== a$b);
>d : Symbol(d, Decl(index.js, 3, 6))
>a$b : Symbol(a$b, Decl(index.js, 2, 3))

while ((c = a$b != a$b)) c.e;
>c : Symbol(c, Decl(index.js, 3, 3))
>a$b : Symbol(a$b, Decl(index.js, 2, 3))
>a$b : Symbol(a$b, Decl(index.js, 2, 3))
>c : Symbol(c, Decl(index.js, 3, 3))

48 changes: 48 additions & 0 deletions tests/baselines/reference/narrowingPlainJsNoCrash1.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//// [tests/cases/compiler/narrowingPlainJsNoCrash1.ts] ////

=== index.js ===
// https://github.com/microsoft/TypeScript/issues/59594

var a$b = {};
>a$b : {}
> : ^^
>{} : {}
> : ^^

var c, d;
>c : any
>d : any

d = a$b;
>d = a$b : {}
> : ^^
>d : any
>a$b : {}
> : ^^

while (d !== a$b);
>d !== a$b : boolean
> : ^^^^^^^
>d : {}
> : ^^
>a$b : {}
> : ^^

while ((c = a$b != a$b)) c.e;
>(c = a$b != a$b) : boolean
> : ^^^^^^^
>c = a$b != a$b : boolean
> : ^^^^^^^
>c : any
>a$b != a$b : boolean
> : ^^^^^^^
>a$b : {}
> : ^^
>a$b : {}
> : ^^
>c.e : error
>c : true
> : ^^^^
>e : any
> : ^^^

13 changes: 13 additions & 0 deletions tests/cases/compiler/narrowingPlainJsNoCrash1.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// @allowJs: true
// @checkJs: false
// @outDir: true

// @filename: index.js

// https://github.com/microsoft/TypeScript/issues/59594

var a$b = {};
var c, d;
d = a$b;
while (d !== a$b);
while ((c = a$b != a$b)) c.e;