diff --git a/package-lock.json b/package-lock.json index 482ffa6e0b16..8e1c67e30aec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,7 @@ "requires": true, "packages": { "": { - "version": "3.41.0", + "version": "3.42.5", "license": "MIT", "devDependencies": { "@ampproject/remapping": "^0.3.0", diff --git a/src/compiler/compile/Component.ts b/src/compiler/compile/Component.ts index 202e14fd9813..769b61c67b10 100644 --- a/src/compiler/compile/Component.ts +++ b/src/compiler/compile/Component.ts @@ -587,7 +587,7 @@ export default class Component { scope.declarations.forEach((node, name) => { if (name[0] === '$') { - return this.error(node as any, compiler_errors.illegal_declaration); + return this.error(node as any, compiler_errors.illegal_declaration(name)); } const writable = node.type === 'VariableDeclaration' && (node.kind === 'var' || node.kind === 'let'); @@ -660,7 +660,7 @@ export default class Component { instance_scope.declarations.forEach((node, name) => { if (name[0] === '$') { - return this.error(node as any, compiler_errors.illegal_declaration); + return this.error(node as any, compiler_errors.illegal_declaration(name)); } const writable = node.type === 'VariableDeclaration' && (node.kind === 'var' || node.kind === 'let'); diff --git a/src/compiler/compile/compiler_errors.ts b/src/compiler/compile/compiler_errors.ts index 54263c3eb911..f8d84431ddd6 100644 --- a/src/compiler/compile/compiler_errors.ts +++ b/src/compiler/compile/compiler_errors.ts @@ -174,10 +174,10 @@ export default { code: 'default-export', message: 'A component cannot have a default export' }, - illegal_declaration: { + illegal_declaration: (name: string) => ({ code: 'illegal-declaration', - message: 'The $ prefix is reserved, and cannot be used for variable and import names' - }, + message: `The $ prefix is reserved, and cannot be used for variable and import names, but found ${name}` + }), illegal_subscription: { code: 'illegal-subscription', message: 'Cannot reference store value inside