Skip to content

Commit f063964

Browse files
committed
subscribe to global stores from script (sveltejs#2139)
1 parent d1536b2 commit f063964

File tree

5 files changed

+7
-1
lines changed

5 files changed

+7
-1
lines changed

src/compile/Component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ export default class Component {
648648
this.add_reference(name.slice(1));
649649

650650
const variable = this.var_lookup.get(name.slice(1));
651-
variable.subscribable = true;
651+
if (variable) variable.subscribable = true;
652652
} else {
653653
this.add_var({
654654
name,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script>
2+
$: $missingGlobal;
3+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
error: 'missingGlobal is not defined'
3+
};

0 commit comments

Comments
 (0)