More test suite strictness fixups (#63022)

This commit is contained in:
Daniel Rosenwasser 2026-01-20 16:19:04 -08:00 committed by GitHub
parent ff5dbcf272
commit 58ed4bcfe4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 20 additions and 6 deletions

View File

@ -1,3 +1,4 @@
// @strict: false
// https://github.com/Microsoft/TypeScript/issues/11038
() => function () {
for (let someKey in {}) {

View File

@ -1,3 +1,4 @@
// @strict: false
namespace a {
export var b = 10;
}

View File

@ -1,3 +1,4 @@
// @strict: false
declare class _this { // no error - as no code generation
}
var f = () => this;

View File

@ -1,3 +1,4 @@
// @strict: false
declare var _this: number; // no error as no code gen
var f = () => this;
_this = 10; // Error

View File

@ -1,3 +1,4 @@
// @strict: false
class _this {
}
var f = () => this;

View File

@ -1,3 +1,4 @@
// @strict: false
enum _this { // Error
_thisVal1,
_thisVal2,

View File

@ -1,3 +1,4 @@
// @strict: false
function _this() { //Error
return 10;
}

View File

@ -1,3 +1,4 @@
// @strict: false
namespace _this { //Error
class c {
}

View File

@ -1,2 +1,3 @@
// @strict: false
var _this = 1;
var f = () => this;

View File

@ -1,4 +1,5 @@
// @declaration: true
// @noImplicitThis: false
// @module: commonjs
// @target: es6

View File

@ -1,3 +1,4 @@
// @strict: false
declare var ko: any;
class Person {

View File

@ -1,6 +1,7 @@
// @allowJs: true
// @checkJs: true
// @noEmit: true
// @noImplicitThis: false
// @filename: index.js
self.importScripts = (function (importScripts) {
return function () {

View File

@ -1,4 +1,5 @@
// @strictNullChecks: true
// @strictPropertyInitialization: false
type T1 = { a: number };
type T2 = T1 & { b: number };

View File

@ -1,3 +1,4 @@
// @strict: false
export function foo() {
export var x = this;
}

View File

@ -11,7 +11,7 @@
//// declare var j: J
//// class C {
//// ic: IC
//// m() { this.ic/**/ = j }
//// constructor() { this.ic/**/ = j }
//// }
verify.codeFixAvailable([
{ description: ts.Diagnostics.Add_undefined_to_optional_property_type.message }
@ -30,7 +30,7 @@ interface J {
declare var j: J
class C {
ic: IC
m() { this.ic = j }
constructor() { this.ic = j }
}`,
});

View File

@ -9,10 +9,10 @@
//// a?: number | undefined
//// }
//// declare var j: J
//// class C {
//// interface C {
//// ic2: IC2
//// }
//// var c = new C()
//// declare var c: C
//// c.ic2/**/ = j
verify.codeFixAvailable([
{ description: ts.Diagnostics.Add_undefined_to_optional_property_type.message }
@ -29,10 +29,10 @@ interface J {
a?: number | undefined
}
declare var j: J
class C {
interface C {
ic2: IC2
}
var c = new C()
declare var c: C
c.ic2 = j`,
});