In most cases I provided the type that appeared in the return
statements. For a few test files I explicitly typed the return types as
dynamic because it caused diffs in the expected break point locations
when adding more explicit types and it wasn't totally clear what the
new locations should be.
Change-Id: Ifdd80edcccc5fc4a2083ecdbb0e5fbf1c4453e01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133339
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
- Enable `prefer_null_aware_operators`, it was already clean.
- Enable `prefer_conditional_assignment` and fix one violation.
Change-Id: I73a5062d5aeedaea9a7b542db02f455111566cfe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130724
Auto-Submit: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Rename the library prefix used in imports from `JS` to `js_ast`. Create more of
a distinction between:
* `JS` the library. Now named `js_ast`.
* `js` the const instance of a JSBuilder.
* `JS` the helper to inline javascript in the SDK patches
and runtime libraries.
Ignore the lint in the js_ast directory to avoid additional diffs for the
eventual un-forking of the package.
Cleanup a few unused imports.
Issue #37218
Change-Id: I039c1048876d9d9ad424fbec3ad555d300845a3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106160
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Note, this has the effect of including all DDC Dart sources with the
shipped SDK: we ship everything under sdk/lib.
This should enable https://github.com/dart-lang/build/issues/2262
Change-Id: If66bc7c620034e7f2acf7d2c3e9524a408417681
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104383
Commit-Queue: Vijay Menon <vsm@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
These violations look like actual bugs and were not simply mechanical fixes.
Change-Id: I69ae67751e48829fc4733dcb327ba0aa52602c91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104063
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Explicit casts make it easier to confidently navigate the code base and
apply refactorings which tighten types. This change exposes a number of
places where types can be tightened, but only the most trivial were
applied. For most places I added the explicit cast that would have
happened anyway and so behavior shouldn't be changing.
- Add the configuration which disallows implicit casts in the analyzer.
- Add explicit casts in almost all instances.
- Where the implicit cast was due to a local variable type on the left,
change it to a `var` so the type is not repeated.
- In a few places add argument types where they were already applied on
the parent type, and the subclass was unnecessarily loosening argument
types to dynamic.
- In a few places where a method was defined with an implicit dynamic
return but had an obvious and consistent return type, annotate the
method instead of casting after calls to that method.
Change-Id: I90e11b1cc08ce69967ea5705b507d5758a8f668f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103381
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Working towards turning on all lints from package:pedantic. This change includes
the lints that needed cleanup and don't change any behavior.
Applied cleanup:
* Don't explicitly initialize variables to null.
* DO use curly braces for all flow control structures.
* Use `.isEmpty` instead of `.length == 0`.
* Use `.isNotEmpty` instead of `.length > 0` or `! .isEmpty`.
* Use `=` to separate a named parameter from its default value.
The remaining lints from package:pedantic will require cleanup that is less
automatic and will be addressed in later changes.
Change-Id: Ie4c3ba685f8a559209dd14ac037203ecd16252c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103086
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
These aren't useful to see cluttering up diagnostic lists - they can be
found easily enough in other ways.
Change-Id: I34b800c1145ae476822afddff558d62c4ffb9b2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103141
Reviewed-by: Mark Zhou <markzipan@google.com>
Previously 36% of overrides were annotated, including inconsistent
annotations within a single class.
- Add annotations on remaining overridden methods.
- Add linter section to `analysis_options.yaml` so that missing
annotations are visible while editing.
Change-Id: Ief1a6d5b8da6f4b630a6cfc72a6ed67db346c081
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103140
Reviewed-by: Vijay Menon <vsm@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
This should work around #32450 and fix the buildbots.
Change-Id: I21d187a34de86ef4e383a9ea7fc297eda1363780
Reviewed-on: https://dart-review.googlesource.com/45521
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
There are a few bug fixes here as well. Most notably, `.name.name`
instead of `.name` in DDK's analysis of virtual accessors. DDC/K's
handling of spread arguments in JS interop was also fairly broken
(it was generating a RestParameter instead of Spread). There's
also a lot of cleanup in js_ast as well, to make it a bit more
type safe.
Change-Id: Ia5333179e6dd0a62f20ce64a2b2b8bedf2ed7c49
Reviewed-on: https://dart-review.googlesource.com/44700
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>