| commit | 66646f312c699bf2f4c70334dcabc21c1470f65b | [log] [tgz] |
|---|---|---|
| author | Tess Strickland <sstrickl@google.com> | Wed Dec 16 11:14:12 2020 +0000 |
| committer | commit-bot@chromium.org <commit-bot@chromium.org> | Wed Dec 16 11:14:12 2020 +0000 |
| tree | 37ae376f802314a27b86ec202a709b8a882471cc | |
| parent | 868cb26a2d9093983ed022b77ba26be6cb8fb7f7 [diff] |
[vm] Signal bad token positions and lines in KernelLineStartsReader. First, change LocationForPosition and TokenRangeAtLine to return whether they successfully located the offset/line. Also change the wrappers in Script (GetTokenLocation and TokenRangeAtLine) to return whether or not any information was successfully located. These methods now only change the out parameters in the case that appropriate information was found, so any unconditional uses of the out parameters need the out parameters to be appropriately initialized. We now allow negative lines to be requested in TokenRangeAtLine (with the failure behavior described above) so the line returned by LocationAtPosition can be fed into TokenRangeAtLine without intermediate checking. The calculation of the token length, which uses the script source and not the line starts array, has been moved to a new method, Script::GetTokenLength. The new method returns the length (or a negative value if the token length could not be determined) instead of using an out parameter. TEST=Existing tests on trybots, to ensure tests using current line/number info aren't affected. Bug: https://github.com/dart-lang/sdk/issues/44436 Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-product-x64-try,vm-kernel-linux-product-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm-try Change-Id: Ibc048a226d11ff9a340a8d249654d07720fdf115 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175365 Commit-Queue: Tess Strickland <sstrickl@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com> Reviewed-by: Clement Skau <cskau@google.com>
Dart is:
Optimized for UI: Develop with a programming language specialized around the needs of user interface creation
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app
Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Visit dart.dev to learn more about the language, tools, getting started, and more.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents on our wiki.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.