cd09cbbd5e
* Cache widened types * Fix lint
51 lines
899 B
TypeScript
51 lines
899 B
TypeScript
// @declaration: true
|
|
// @noImplicitThis: true
|
|
|
|
// https://github.com/microsoft/TypeScript/issues/29902
|
|
|
|
function createObj() {
|
|
return {
|
|
func1() {
|
|
return this;
|
|
},
|
|
func2() {
|
|
return this;
|
|
},
|
|
func3() {
|
|
return this;
|
|
}
|
|
};
|
|
}
|
|
|
|
function createObjNoCrash() {
|
|
return {
|
|
func1() {
|
|
return this;
|
|
},
|
|
func2() {
|
|
return this;
|
|
},
|
|
func3() {
|
|
return this;
|
|
},
|
|
func4() {
|
|
return this;
|
|
},
|
|
func5() {
|
|
return this;
|
|
},
|
|
func6() {
|
|
return this;
|
|
},
|
|
func7() {
|
|
return this;
|
|
},
|
|
func8() {
|
|
return this;
|
|
},
|
|
func9() {
|
|
return this;
|
|
}
|
|
};
|
|
}
|