feat(DirectiveParser): throw errors when expected directives are not...#570
feat(DirectiveParser): throw errors when expected directives are not...#570b-laporte wants to merge 1 commit into
Conversation
ac64440 to
f116c20
Compare
There was a problem hiding this comment.
StringMapWrapper would be faster (ES5) if keys are string
There was a problem hiding this comment.
Indeed - I will do the change asap.
dac45a1 to
b7e0ed8
Compare
There was a problem hiding this comment.
Could the error message include the Element HTML so that developer would know where to go to fix it?
There was a problem hiding this comment.
I updated the PR with more explicit context information. For the time being it is a simple HTML description - but if we move to a JS parser (cf. webworkers) the generated DOM could include meta-data for each element such as file name, line and column numbers that could be then used for even more meaningful messages.
|
Looks good to me, but I would like @tbosch to take another look. |
85d56a8 to
2676e69
Compare
|
I did a few refactoring since the first review:
I also realised that the @tbosch I think I am done with this PR - so feel free to comment - thx 😃 |
There was a problem hiding this comment.
We should fill this already here, not and lazily by a compile step, as previous compile steps might have changed the element already. Also, this should include the compilationUnit. Right now we pass the compilationUnit as constructor argument into some steps (e.g. PropertyBindingParser), so we can provide a more meaningful error when parsing expressions. But we should actually also use the elementDescription + compilationUnit there as well.
There was a problem hiding this comment.
I.e. remove the compilationUnit from the constructors of the various compile steps and include it in the elementDescription, then use the new elementDescription where the compilationUnit was used before.
There was a problem hiding this comment.
Only if assertionsEnabled() though...
There was a problem hiding this comment.
Don't use a generic fail method, but provide an error description at the place where you want to fail (e.g. should not have come here as an exception was expected, ...)
|
LGTM, besides the mentioned changes. Also needs rebase ontop of master... |
|
thanks for the comments - I will provide an update in the coming days (unfortunately don't have much time right now..) |
|
Thanks!
|
2676e69 to
8995a73
Compare
|
OK - cleanup done according to @tbosch comments. Some more comments regarding this PR:
|
8995a73 to
acdf898
Compare
acdf898 to
c87fd04
Compare
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
... present (i.e. when non-root templates have no directive or when invalid DOM properties that are associated to an expression are not matched by any directive...)
fix #527