fix(compiler): correctly handle when `toString` is exported (#15430)
Fixes #15420
This commit is contained in:
parent
c8ab5cb0c5
commit
0dda01e37c
|
@ -224,7 +224,7 @@ export class StaticSymbolResolver {
|
|||
this.recordImportAs(symbol, importSymbol);
|
||||
}
|
||||
|
||||
const origin = origins[metadataKey];
|
||||
const origin = origins.hasOwnProperty(metadataKey) && origins[metadataKey];
|
||||
if (origin) {
|
||||
// If the symbol is from a bundled index, use the declaration location of the
|
||||
// symbol so relative references (such as './my.html') will be calculated
|
||||
|
|
|
@ -577,6 +577,7 @@ const FILES: MockData = {
|
|||
`,
|
||||
'app.module.ts': `
|
||||
import { NgModule } from '@angular/core';
|
||||
import { toString } from './utils';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
|
@ -585,6 +586,12 @@ const FILES: MockData = {
|
|||
bootstrap: [ AppComponent ]
|
||||
})
|
||||
export class AppModule { }
|
||||
`,
|
||||
// #15420
|
||||
'utils.ts': `
|
||||
export function toString(value: any): string {
|
||||
return '';
|
||||
}
|
||||
`
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue