You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then instantiating the component without a foo prop shouldn't cause a warning in dev mode. This seems to affect only cases where undefined is the default value - other default values work fine.
The text was updated successfully, but these errors were encountered:
I believe there's a bug when determining the initialized declarations in a given scope:
diff --git a/src/compile/utils/scope.ts b/src/compile/utils/scope.ts
index 20cca46c..6488986d 100644
--- a/src/compile/utils/scope.ts+++ b/src/compile/utils/scope.ts@@ -75,12 +75,10 @@ export class Scope {
if (node.kind === 'var' && this.block && this.parent) {
this.parent.add_declaration(node);
} else if (node.type === 'VariableDeclaration') {
- const initialised = !!node.init;-
node.declarations.forEach((declarator: Node) => {
extract_names(declarator.id).forEach(name => {
this.declarations.set(name, node);
- if (initialised) this.initialised_declarations.add(name);+ if (declarator.init) this.initialised_declarations.add(name);
});
});
} else {
In the AST, init is a property on the individual VariableDeclarators, not on the VariableDeclaration. I'm not sure whether this has any impact on other things in the code. None that I've seen so far.
If a component has
then instantiating the component without a
foo
prop shouldn't cause a warning in dev mode. This seems to affect only cases whereundefined
is the default value - other default values work fine.The text was updated successfully, but these errors were encountered: