mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 01:59:38 +00:00
fdb6ca6d01
Currently only CFE ("Fasta") tests have their context message output parsed. It should be easy to extend that to dart2js and DDC if that's useful. Analyzer might be more work. This also adds support to the test updater for inserting context messages when updating tests. By default, that flag is off, so the existing behavior is preserved where context messages are ignnored. If you want them, pass "-c" when updating a test. When validating test output, if the test file contains context messages, then they are validated. Otherwise, any context messages in the CFE output are ignored. This way existing tests still pass. Change StaticError to represent a single error for a single front end. Before, the data model collapsed errors for different front-ends at the same location into a single StaticError object which tracked different messages for each front end. The idea was to move towards a world where they really are the "same" error with eventually the same message. But this adds a lot of complexity with things like merging errors and doesn't reflect the reality that each error from each front end is basically its own thing. Also, critically, it makes it much harder to attach context messages to a specific front end's error object. This changes it so that an instance of StaticError represents a single error for a single front end. The test file syntax is unchanged and the updated tool behaves the same. In a static error test, multiple expectations can still share the same "// ^^^" marker line. They are just expanded to multiple StaticError objects at parse time. This eliminates all of the complexity around merging and simplifying errors. Change-Id: Ida1736bfcde436fc2d1ce2963d91fa9cb154afa8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193281 Commit-Queue: Bob Nystrom <rnystrom@google.com> Reviewed-by: Paul Berry <paulberry@google.com> |
||
---|---|---|
.. | ||
bin | ||
lib | ||
test | ||
tool | ||
.gitignore | ||
analysis_options.yaml | ||
pubspec.yaml |