mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Merge pull request #17252 from Microsoft/contextually-type-this-in-object-literals-in-javascript
Contextually type this in object literals in JS
This commit is contained in:
@@ -12662,7 +12662,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (noImplicitThis) {
|
||||
if (noImplicitThis || isInJavaScriptFile(func)) {
|
||||
const containingLiteral = getContainingObjectLiteral(func);
|
||||
if (containingLiteral) {
|
||||
// We have an object literal method. Check if the containing object literal has a contextual type
|
||||
|
||||
Reference in New Issue
Block a user