mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 03:09:39 -06:00
More test suite strictness fixups (#63022)
This commit is contained in:
parent
ff5dbcf272
commit
58ed4bcfe4
@ -1,3 +1,4 @@
|
||||
// @strict: false
|
||||
// https://github.com/Microsoft/TypeScript/issues/11038
|
||||
() => function () {
|
||||
for (let someKey in {}) {
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// @strict: false
|
||||
namespace a {
|
||||
export var b = 10;
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// @strict: false
|
||||
declare class _this { // no error - as no code generation
|
||||
}
|
||||
var f = () => this;
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// @strict: false
|
||||
declare var _this: number; // no error as no code gen
|
||||
var f = () => this;
|
||||
_this = 10; // Error
|
||||
@ -1,3 +1,4 @@
|
||||
// @strict: false
|
||||
class _this {
|
||||
}
|
||||
var f = () => this;
|
||||
@ -1,3 +1,4 @@
|
||||
// @strict: false
|
||||
enum _this { // Error
|
||||
_thisVal1,
|
||||
_thisVal2,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// @strict: false
|
||||
function _this() { //Error
|
||||
return 10;
|
||||
}
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// @strict: false
|
||||
namespace _this { //Error
|
||||
class c {
|
||||
}
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
// @strict: false
|
||||
var _this = 1;
|
||||
var f = () => this;
|
||||
@ -1,4 +1,5 @@
|
||||
// @declaration: true
|
||||
// @noImplicitThis: false
|
||||
// @module: commonjs
|
||||
// @target: es6
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// @strict: false
|
||||
declare var ko: any;
|
||||
|
||||
class Person {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
// @allowJs: true
|
||||
// @checkJs: true
|
||||
// @noEmit: true
|
||||
// @noImplicitThis: false
|
||||
// @filename: index.js
|
||||
self.importScripts = (function (importScripts) {
|
||||
return function () {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
// @strictNullChecks: true
|
||||
// @strictPropertyInitialization: false
|
||||
|
||||
type T1 = { a: number };
|
||||
type T2 = T1 & { b: number };
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
// @strict: false
|
||||
export function foo() {
|
||||
export var x = this;
|
||||
}
|
||||
|
||||
@ -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 }
|
||||
}`,
|
||||
});
|
||||
|
||||
|
||||
@ -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`,
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user