more aliased stuff

pull/4000/head
daszgfz 6 years ago
parent 32768faa50
commit f6060ed0dd

@ -796,6 +796,11 @@ export default class Component {
scope = map.get(node); scope = map.get(node);
} }
if (node.type === 'VariableDeclarator' && node.id.type === 'Identifier' && node.init.type === 'Identifier') {
const variable = component.var_lookup.get(node.init.name);
variable.aliased = true;
}
if (node.type === 'ExpressionStatement' && node.expression.type === 'CallExpression') { if (node.type === 'ExpressionStatement' && node.expression.type === 'CallExpression') {
node.expression.arguments.forEach(arg => { node.expression.arguments.forEach(arg => {
if (arg.type === 'Identifier') { if (arg.type === 'Identifier') {

@ -0,0 +1,21 @@
/* generated by Svelte vX.Y.Z */
import { SvelteComponent, init, safe_not_equal } from "svelte/internal";
function instance($$self) {
function foo() {
}
const foo_alias = foo;
foo_alias.nasty_but_legal();
return [];
}
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, null, safe_not_equal, {});
}
}
export default Component;

@ -0,0 +1,5 @@
<script>
function foo() {}
const foo_alias = foo;
foo_alias.nasty_but_legal();
</script>
Loading…
Cancel
Save