Closed
Conversation
Author
|
Ooof. Looks like I got some autoformatter thing in there. Gonna fix that. |
Contributor
|
feels messy...but it does make some sense. the alternative is in userland just putting |
The ternary indentation in normalRawEvaluator was changed by an autoformatter but is unrelated to the fix. This restores the original indentation to keep the PR diff focused on the actual change. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
|
idk, i see what you're saying but I don't love the implementation. I think I'm going to close until more report this and a better implemenation comes across. thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See: #4775
During
x-initif creating an arrow function to assign to a property (x-init="$el.fn = () => { flag = true }"), it will be executed immediately (interpreted as a block and not a function).If a statement precedes that declaration, it is interpreted as a function and not executed immediately (
x-init="0; $el.fn = () => { flag = true }")Minimal repro HTML:
Result:
I would expect both of those to give the same result, and I would expect both to function like the second case (prepended statement).
resolution
Adds a regex in
generateFunctionFromStringto correctly recognize those situations.