Skip to content

Commit

Permalink
Revert "allow uppercase elements in strict mode (#1650)"
Browse files Browse the repository at this point in the history
This reverts commit aefd600.
  • Loading branch information
NullVoxPopuli authored Nov 6, 2024
1 parent aefd600 commit 7d1dd42
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/@glimmer/syntax/lib/v2/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
Expand Down

0 comments on commit 7d1dd42

Please sign in to comment.