mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Fix isSameEntityName (#38999)
* Fix isSameEntityName * Add baseline * Fix baseline
This commit is contained in:
parent
74b4b5640a
commit
0d6ae004d7
@ -2105,7 +2105,7 @@ namespace ts {
|
||||
*/
|
||||
function isSameEntityName(name: Expression, initializer: Expression): boolean {
|
||||
if (isPropertyNameLiteral(name) && isPropertyNameLiteral(initializer)) {
|
||||
return getTextOfIdentifierOrLiteral(name) === getTextOfIdentifierOrLiteral(name);
|
||||
return getTextOfIdentifierOrLiteral(name) === getTextOfIdentifierOrLiteral(initializer);
|
||||
}
|
||||
if (isIdentifier(name) && isLiteralLikeAccess(initializer) &&
|
||||
(initializer.expression.kind === SyntaxKind.ThisKeyword ||
|
||||
|
||||
14
tests/baselines/reference/usedImportNotElidedInJs.js
Normal file
14
tests/baselines/reference/usedImportNotElidedInJs.js
Normal file
@ -0,0 +1,14 @@
|
||||
//// [test.js]
|
||||
// #38412
|
||||
|
||||
|
||||
import * as moment from 'moment';
|
||||
import rollupMoment__default from 'moment';
|
||||
export const moment = rollupMoment__default || moment;
|
||||
|
||||
|
||||
//// [test.js]
|
||||
// #38412
|
||||
import * as moment from 'moment';
|
||||
import rollupMoment__default from 'moment';
|
||||
export const moment = rollupMoment__default || moment;
|
||||
12
tests/cases/compiler/usedImportNotElidedInJs.ts
Normal file
12
tests/cases/compiler/usedImportNotElidedInJs.ts
Normal file
@ -0,0 +1,12 @@
|
||||
// #38412
|
||||
|
||||
// @allowJs: true
|
||||
// @noResolve: true
|
||||
// @target: es2015
|
||||
// @outDir: out
|
||||
// @noTypesAndSymbols: true
|
||||
|
||||
// @Filename: test.js
|
||||
import * as moment from 'moment';
|
||||
import rollupMoment__default from 'moment';
|
||||
export const moment = rollupMoment__default || moment;
|
||||
Loading…
x
Reference in New Issue
Block a user