Repository navigation
Conversation
|
Depends on #31347. Will rebase once merged. Edit: Done. |
c5e180e to
95d4f41
Compare
95d4f41 to
51bfb5b
Compare
alxhub
left a comment
There was a problem hiding this comment.
Also make this a feat(ivy) as there's no need to announce this commit to the user, especially since it won't be useful in VE at all.
f60f228 to
60d142d
Compare
There was a problem hiding this comment.
That's weird! Even if the above guard uses === undefined?
There was a problem hiding this comment.
Yeah, here's a simpler example: playground.
I think this may be related to microsoft/TypeScript#11498
There was a problem hiding this comment.
Oooh, there's a closure involved. Then it makes sense :-)
ca3d671 to
569dd72
Compare
angular/angular#31391 introduces a breaking change to `parseAction`, which now requires at least three parameters. This provides a fix-forward for when the change lands.
angular/angular#31391 introduces a breaking change to `parseAction`, which now requires at least three parameters. This provides a fix-forward for when the change lands.
angular/angular#31391 introduces a breaking change to `parseAction`, which now requires at least three parameters. This provides a fix-forward for when the change lands.
| ParsedProperty[]|null { | ||
| createBoundHostProperties( | ||
| dirMeta: CompileDirectiveSummary, sourceSpan: ParseSourceSpan, | ||
| absoluteOffset: number = sourceSpan.start.offset): ParsedProperty[]|null { |
There was a problem hiding this comment.
Why is this a sensible default value? Under what circumstances will this be correct/not correct?
There was a problem hiding this comment.
Because in this case, sourceSpan is a span of byte offsets in the source file, which is what we want from absoluteOffset (sourceSpan is later used to compute the line/column offset for error locations).
This is incorrect in places where users of the function pass arbitrary or incorrect values of sourceSpan, which unfortunately there is a fair amount of.
|
Caretaker: This PR requires http://cl/258819283 to be patched. |
…31391) Currently, template expressions and statements have their location recorded relative to the HTML element they are in, with no handle to absolute location in a source file except for a line/column location. However, the line/column location is also not entirely accurate, as it points an entire semantic expression, and not necessarily the start of an expression recorded by the expression parser. To support record of the source code expressions originate from, add a new `sourceSpan` field to `ASTWithSource` that records the absolute byte offset of an expression within a source code. Implement part 2 of [refactoring template parsing for stability](https://hackmd.io/@X3ECPVy-RCuVfba-pnvIpw/BkDUxaW84/%2FMA1oxh6jRXqSmZBcLfYdyw?type=book). PR Close angular#31391
|
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. |
Currently, template expressions and statements have their location
recorded relative to the HTML element they are in, with no handle to
absolute location in a source file except for a line/column location.
However, the line/column location is also not entirely accurate, as it
points an entire semantic expression, and not necessarily the start of
an expression recorded by the expression parser.
To support record of the source code expressions originate from, add a
new
sourceSpanfield toASTWithSourcethat records the absolute byteoffset of an expression within a source code.
Implement part 2 of refactoring template parsing for
stability.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently, template expressions and statements have their location
recorded relative to the HTML element they are in, with no handle to
absolute location in a source file except for a line/column location.
However, the line/column location is also not entirely accurate, as it
points an entire semantic expression, and not necessarily the start of
an expression recorded by the expression parser.
What is the new behavior?
To support record of the source code expressions originate from, add a
new
sourceSpanfield toASTWithSourcethat records the absolute byteoffset of an expression within a source code.
Does this PR introduce a breaking change?
Other information
See the design doc for refactoring template parsing for stability.