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

fix(compiler): ensure that placeholders have the correct sourceSpan #39717

Commits on Nov 19, 2020

  1. test(compiler-cli): add source-mapping test helper

    This helper improves the message given when an expectation
    fails in a source-mapping test.
    petebacondarwin committed Nov 19, 2020
    Copy the full SHA
    622ba07 View commit details
    Browse the repository at this point in the history
  2. fix(compiler): ensure that placeholders have the correct sourceSpan

    When the `preserveWhitespaces` is not true, the template parser will
    process the parsed AST nodes to remove excess whitespace. Since the
    generated `goog.getMsg()` statements rely upon the AST nodes after
    this whitespace is removed, the i18n extraction must make a second pass.
    
    Previously this resulted in innacurrate source-spans for the i18n text and
    placeholder nodes that were extracted in the second pass.
    
    This commit fixes this by reusing the source-spans from the first pass
    when extracting the nodes in the second pass.
    
    Fixes angular#39671
    petebacondarwin committed Nov 19, 2020
    Copy the full SHA
    25ef0e0 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    2692411 View commit details
    Browse the repository at this point in the history
  4. refactor(compiler): tidy up interpolation splitting

    When parsing for i18n messages, interpolated strings are
    split into `Text` and `Placeholder` pieces.  The method that
    does this `_visitTextWithInterpolation()` was becoming too
    complex. This commit refactors that method along with some
    associated functions that it uses.
    petebacondarwin committed Nov 19, 2020
    Copy the full SHA
    9ee0012 View commit details
    Browse the repository at this point in the history