From 7d94ac1c1ef3bf88c404841840e76379539523ef Mon Sep 17 00:00:00 2001 From: John Chesley Date: Wed, 6 Mar 2019 22:33:21 -0500 Subject: [PATCH 1/3] add test for #2165 --- test/runtime/samples/mixed-let-export/_config.js | 9 +++++++++ test/runtime/samples/mixed-let-export/main.svelte | 7 +++++++ 2 files changed, 16 insertions(+) create mode 100644 test/runtime/samples/mixed-let-export/_config.js create mode 100644 test/runtime/samples/mixed-let-export/main.svelte diff --git a/test/runtime/samples/mixed-let-export/_config.js b/test/runtime/samples/mixed-let-export/_config.js new file mode 100644 index 0000000000..5ac8585742 --- /dev/null +++ b/test/runtime/samples/mixed-let-export/_config.js @@ -0,0 +1,9 @@ +export default { + props: { + a: 42 + }, + + html: ` + 42 + ` +} diff --git a/test/runtime/samples/mixed-let-export/main.svelte b/test/runtime/samples/mixed-let-export/main.svelte new file mode 100644 index 0000000000..659c73a860 --- /dev/null +++ b/test/runtime/samples/mixed-let-export/main.svelte @@ -0,0 +1,7 @@ + + +{a} From c9e815fdb88f0a0db48c20d578b8d5bf0557c485 Mon Sep 17 00:00:00 2001 From: John Chesley Date: Thu, 7 Mar 2019 00:25:32 -0500 Subject: [PATCH 2/3] create a new declaration for non-exported variables that follow an exported one (#2165) --- src/compile/Component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/compile/Component.ts b/src/compile/Component.ts index 1b843e9ca2..1f640e1873 100644 --- a/src/compile/Component.ts +++ b/src/compile/Component.ts @@ -839,6 +839,14 @@ export default class Component { current_group.declarators.push(declarator); } + + if (next) { + const next_variable = component.var_lookup.get(next.id.name) + if (next_variable && !next_variable.export_name) { + current_group = null + code.overwrite(declarator.end, next.start, ` ${node.kind} `); + } + } } else { current_group = null; From 9b9a1a5d2ab75089e3ee5cfef3933f1c312fd8f7 Mon Sep 17 00:00:00 2001 From: John Chesley Date: Thu, 7 Mar 2019 00:36:20 -0500 Subject: [PATCH 3/3] woops, this is redundant --- src/compile/Component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/compile/Component.ts b/src/compile/Component.ts index 1f640e1873..ef3bb2357e 100644 --- a/src/compile/Component.ts +++ b/src/compile/Component.ts @@ -843,7 +843,6 @@ export default class Component { if (next) { const next_variable = component.var_lookup.get(next.id.name) if (next_variable && !next_variable.export_name) { - current_group = null code.overwrite(declarator.end, next.start, ` ${node.kind} `); } }