This repository was archived by the owner on Mar 13, 2018. It is now read-only.
Update binding expression regex to full Polymer/polymer regex (Fixes #113)#117
Open
jonvuri wants to merge 2 commits intogooglearchive:masterfrom
Open
Update binding expression regex to full Polymer/polymer regex (Fixes #113)#117jonvuri wants to merge 2 commits intogooglearchive:masterfrom
jonvuri wants to merge 2 commits intogooglearchive:masterfrom
Conversation
…nd bindings correctly (and perhaps other edge cases)
Contributor
|
@jrajav Can you rebase this? |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #113
We grab the binding regex from https://github.com/Polymer/polymer/blob/d385873e3696aade3d122cb1c28f0ce8f6af4b35/src/lib/annotations/annotations.html#L92-L109 and modify it slightly to have only one capture group for the binding (which is what
extractBindingExpressionexpects), and to handle the native event binding delimiter if present.Big thanks to @TimvdLippe for help with the native binding expression and other feedback!
Among other things, the main thing this fixes is the greedy handling of binding expressions on the same line. This could also be solved by simply making the original inline regexes non-greedy, but this is a more thorough solution to handle most binding expression structures.
Also fixed two minor issues with the unit tests - those are the first two commits in this PR.