From 7d1dd42632d00d97323f58f9ad3b962183dacd01 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 6 Nov 2024 15:42:05 -0500 Subject: [PATCH] Revert "allow uppercase elements in strict mode (#1650)" This reverts commit aefd600b98bfa32ecb6d3212fc3e5a89635df74d. --- packages/@glimmer/syntax/lib/v2/normalize.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/@glimmer/syntax/lib/v2/normalize.ts b/packages/@glimmer/syntax/lib/v2/normalize.ts index fb5b75630..741464a3a 100644 --- a/packages/@glimmer/syntax/lib/v2/normalize.ts +++ b/packages/@glimmer/syntax/lib/v2/normalize.ts @@ -762,6 +762,13 @@ class ElementNormalizer { let inScope = variable[0] === '@' || variable === 'this' || this.ctx.hasBinding(variable); if (this.ctx.strict && !inScope) { + if (uppercase) { + throw generateSyntaxError( + `Attempted to invoke a component that was not in scope in a strict mode template, \`<${variable}>\`. If you wanted to create an element with that name, convert it to lowercase - \`<${variable.toLowerCase()}>\``, + loc + ); + } + // In strict mode, values are always elements unless they are in scope return 'ElementHead'; }