This is visible with --strict:
// @noEmit: true
// @allowJs: true
// @checkJs: true
// @strict: true
// @Filename: a.js
function A() {
this.x = { y : 1 }
}
var a = new A()
a.x.y
Expected behavior:
No error
Actual behavior:
Error "Object is possibly undefined" when accessing a.x.y
This is visible with
--strict:Expected behavior:
No error
Actual behavior:
Error "Object is possibly undefined" when accessing
a.x.y