Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<@argument> Parsing error: Cannot read properties of null (reading 'index') #22

Merged
merged 4 commits into from
Dec 30, 2023

Conversation

NullVoxPopuli
Copy link
Member

No description provided.

limber:lint:js:fix:   0:0  error  Parsing error: Cannot read properties of null (reading 'index')
Copy link

stackblitz bot commented Dec 29, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@@ -268,7 +268,7 @@ module.exports.preprocessGlimmerTemplates = function preprocessGlimmerTemplates(
let codeSlice = code.slice(...n.range);
for (const part of n.tag.split('.')) {
let pattern = `\\b${part}\\b`;
if (part.startsWith(':')) {
if (part.startsWith(':') || part.startsWith('@')) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should probably extend this to any special character?
A tag could also be _Foo

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just use indexOf, that should work...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Difference is _Foo could be defined locally

let part = code.slice(...n.parent.range);
let start = n.parent.range[0];
// for blocks {{x as |b|}} the block range does not contain the block params...
// for element tag it does <x as b />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// for element tag it does <x as b />
// for element tag it does <x as |b|>

@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review December 30, 2023 02:03
@NullVoxPopuli NullVoxPopuli added the bug Something isn't working label Dec 30, 2023
@NullVoxPopuli NullVoxPopuli merged commit 35751d1 into main Dec 30, 2023
5 checks passed
@NullVoxPopuli NullVoxPopuli deleted the argument-components branch December 30, 2023 02:04
@github-actions github-actions bot mentioned this pull request Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants