Merge pull request #2351 from jches/gh/2347

Don't hoist non-renamed exports
pull/2364/head
Rich Harris 6 years ago committed by GitHub
commit c20ad22363
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -925,7 +925,7 @@ export default class Component {
const v = this.var_lookup.get(d.id.name) const v = this.var_lookup.get(d.id.name)
if (v.reassigned) return false if (v.reassigned) return false
if (v.export_name && v.export_name !== v.name) return false if (v.export_name) return false
if (this.var_lookup.get(d.id.name).reassigned) return false; if (this.var_lookup.get(d.id.name).reassigned) return false;
if (this.vars.find(variable => variable.name === d.id.name && variable.module)) return false; if (this.vars.find(variable => variable.name === d.id.name && variable.module)) return false;

@ -22,6 +22,7 @@ export default {
v2=4 v2=4
vi1=4 vi1=4
$vs1=1 $vs1=1
vl0=hello
vl1=test vl1=test
$s3=29 $s3=29
loop... loop...

@ -19,6 +19,10 @@
let vs1 = v1 let vs1 = v1
export { vs1 as a4 } export { vs1 as a4 }
// literal initializer
let vl0 = 'hello'
export { vl0 }
// aliased with literal initializer // aliased with literal initializer
let vl1 = 'test' let vl1 = 'test'
export { vl1 as a5 } export { vl1 as a5 }
@ -41,6 +45,7 @@ $v1={$v1}
v2={v2} v2={v2}
vi1={vi1} vi1={vi1}
$vs1={$vs1} $vs1={$vs1}
vl0={vl0}
vl1={vl1} vl1={vl1}
$s3={$s3} $s3={$s3}
{k1}{k2} {k1}{k2}

Loading…
Cancel
Save