mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Port 8369: Support module.exports.name = expr format for JavaScript module
This commit is contained in:
parent
2821a4b1ff
commit
f4f9d899fd
@ -1135,8 +1135,15 @@ namespace ts {
|
||||
else if (lhs.expression.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
// chained dot, e.g. x.y.z = expr; this var is the 'x.y' part
|
||||
const innerPropertyAccess = <PropertyAccessExpression>lhs.expression;
|
||||
if (innerPropertyAccess.expression.kind === SyntaxKind.Identifier && innerPropertyAccess.name.text === "prototype") {
|
||||
return SpecialPropertyAssignmentKind.PrototypeProperty;
|
||||
if (innerPropertyAccess.expression.kind === SyntaxKind.Identifier) {
|
||||
// module.exports.name = expr
|
||||
const innerPropertyAccessIdentifier = <Identifier>innerPropertyAccess.expression;
|
||||
if (innerPropertyAccessIdentifier.text === "module" && innerPropertyAccess.name.text === "exports") {
|
||||
return SpecialPropertyAssignmentKind.ExportsProperty;
|
||||
}
|
||||
if (innerPropertyAccess.name.text === "prototype") {
|
||||
return SpecialPropertyAssignmentKind.PrototypeProperty;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user