Commit Graph

9 Commits

Author SHA1 Message Date
Brian Wilkerson c2eb9a9860 Add support to the element model for both lazy variables and required parameters
Change-Id: I2733f26cc4ee1be28fc96bbf23402e34449ff030
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99241
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-04-12 12:41:48 +00:00
Sigmund Cherem a7175938c3 Remove use of package_root in analyzer/test/error_test
context: the package_root logic is not portable to how we run this test outside
the sdk in other build systems like bazel. To make it work in bazel, we
currently use const.fromEnvironment to override the location of the package
root. Due to upcoming changes to constant evaluation we can't continue using
const.fromEnvironment.

I considered 3 other options:
 * using Platform.environment
 * changing platform_root to be more sophisticated (e.g. look for a folder
 containing `test`, instead of looking for `pkg`)
 * directly defining the root at the beginning of main based on Platform.script

The latter works out of the box in bazel and is also pretty simple, so I felt it
was a good choice.

Note: there are several other tests depending on package_root that we can update
in a similar fashion. Today this is the only test that depends on package_root
that we are running internally in bazel.
Change-Id: Ie7b79a82c78605048b26b9676eac2fbd8b15aaa7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98879
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2019-04-09 16:46:57 +00:00
Brian Wilkerson 0560014c79 Remove unused error codes
Change-Id: I47daa6dab610af657ca781db5ca88438988c3c87
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98162
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-03-29 15:37:26 +00:00
Brian Wilkerson 5f0de26d48 Clean up the remaining copyright notices
Change-Id: If099be4f71ba551df0dc3d69815ae6a9f55d1eba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97781
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-24 20:11:28 +00:00
Paul Berry 7d277c4a32 Introduce methods and classes to replace "2" variants left over from "UI as code" work.
The AST refactor for "UI as code" left behind a few things whose names
ended in "2".  This CL deprecates those things and creates
replacements that don't end in "2", so that we keep the API clean.  In
a future breaking change release of the analyzer we'll remove the
deprecated things.

The following methods and classes are added:
- ForStatement and ForStatementImpl
- ListLiteral.elements
- SetOrMapLiteral.elements
- AstVisitor.visitForStatement
- AstFactory.forStatement
- NodeLintRegistry.addForStatement

The following methods and classes are deprecated:
- ForStatement2 and ForStatement2Impl
- ListLiteral.elements2
- SetOrMapLiteral.elements2
- AstVisitor.visitForStatement2
- AstFactory.forStatement2
- NodeLintRegistry.addForStatement2

In a similar way to how we did the previous stage of AST migration,
the existing visitors have been modified so that the default
implementation of visitForStatement2 redirects to visitForStatement;
this allows clients to change their overrides of visitForStatement2 to
override visitForStatement instead.  Once all clients have been
migrated we will be able to delete the visitForStatement2 method.

Change-Id: Ife5949071fe4cb50791cd4f2f4b99a1bfaad54c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97360
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-03-20 22:58:55 +00:00
Brian Wilkerson 122aa43ef6 Convert ListLiteral and remove uses of ListLiteral2
Change-Id: I6c6f60ae969deb798cdbc8572341f2a51256b194
Reviewed-on: https://dart-review.googlesource.com/c/93341
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-02-15 16:17:28 +00:00
Konstantin Shcheglov b5eb7d463e Extract and migrate ErrorReporter tests.
R=brianwilkerson@google.com

Change-Id: I5fd12bdd3dc6bacbec61ad9b722a0016cbde2229
Reviewed-on: https://dart-review.googlesource.com/c/92024
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-02-05 19:16:15 +00:00
Paul Berry 70f2969b6c Create a uniform mechanism for finding the 'pkg' directory when running tests.
Several tests need to access source files in the 'pkg' directory, and
they use various mechanisms for finding it.  This CL changes
everything to use the same mechanism.

Change-Id: I146a6d72ec05a20cf07451a83eada9fb8e71a966
Reviewed-on: https://dart-review.googlesource.com/5484
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-09-13 20:05:40 +00:00
Brian Wilkerson 2041871f34 Add missed files from previous CL
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2990273002 .
2017-08-04 09:20:15 -07:00