|
|
@ -40,7 +40,7 @@ export default class Generator {
|
|
|
|
// allow compiler to deconflict user's `import { get } from 'whatever'` and
|
|
|
|
// allow compiler to deconflict user's `import { get } from 'whatever'` and
|
|
|
|
// Svelte's builtin `import { get, ... } from 'svelte/shared.js'`;
|
|
|
|
// Svelte's builtin `import { get, ... } from 'svelte/shared.js'`;
|
|
|
|
this.importedNames = new Set();
|
|
|
|
this.importedNames = new Set();
|
|
|
|
this._aliases = new Map();
|
|
|
|
this.aliases = new Map();
|
|
|
|
this._usedNames = new Set( [ name ] );
|
|
|
|
this._usedNames = new Set( [ name ] );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -54,12 +54,11 @@ export default class Generator {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
alias ( name ) {
|
|
|
|
alias ( name ) {
|
|
|
|
if ( this._aliases.has( name ) ) {
|
|
|
|
if ( !this.aliases.has( name ) ) {
|
|
|
|
return this._aliases.get( name );
|
|
|
|
this.aliases.set( name, this.getUniqueName( name ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const alias = this.getUniqueName( name );
|
|
|
|
|
|
|
|
this._aliases.set( name, alias );
|
|
|
|
return this.aliases.get( name );
|
|
|
|
return alias;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
contextualise ( block, expression, context, isEventHandler ) {
|
|
|
|
contextualise ( block, expression, context, isEventHandler ) {
|
|
|
|