Previously, when encountering identifiers in metadata on a class's
type parameter, the analyzer would resolve them using the type
parameter scope, but then fall back on using implicit `this`. The CFE
would resolve them using the class body scope. In both cases, the end
result was that the annotation could refer to static class members.
This change brings the behavior of both the analyzer and the CFE in
line with the spec, by preventing the use of implicit `this` in these
annotations, and resolving them in the type parameter scope.
This is not expected to break any code in practice, because
annotations on type parameters are rare, as are annotations referring
to static class members, and the overlap between these two should be
negligibly small.
Fixes https://github.com/dart-lang/language/issues/1790.
Bug: https://github.com/dart-lang/language/issues/1790
Change-Id: Ibe5a421e04a53d29074a8b1509e1390658ed72e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210040
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Change-Id: I860fbe6b821061695c50319204d8d6ba9c98a839
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209109
Auto-Submit: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
Removes the lazy loading of the underlying type in LazyJSTypes.
As such, this removes the need to keep AnonymousJSType and
LazyJSType separate, and is therefore refactored to
PackageJSType. Similarly, subtyping is fixed such that
PackageJSTypes are all subtypes of each other.
Change-Id: If489defdbeb5cb932db802a7d146ad2fc393b12c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207982
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This effectively enables ES6 language features in Dart2JS by default.
Also adapts some tests to expect ES6 Method Definition syntax.
Change-Id: Iec36fbf9d22afd1083f7560a16fa73fbf15fb85c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205741
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Also apply new formatting style to dart format section
Change-Id: I5e7ad454ff2794dc98eb4f1868416beb45b1c68e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206340
Auto-Submit: Kevin Moore <kevmoo@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Change-Id: I866378cba43db7f559e37d3c0bf163843f74d186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204941
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
The `unawaited` function in `dart:async` is intended for use with the `unawaited_futures` lint which is hopefully going to be part of the Dart recommended set of lints.
The `ignore` extension method is there to provide an alternative if you even want to ignore errors from a future. By having both, it makes the distinction clearer and makes it easier to not think one can be used for everything.
Change-Id: Ib96ed5ff64ead4b228721e5210efa82f76119c9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200428
Reviewed-by: Jacob Richman <jacobr@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Added check to convertNativeToDart_Dictionary to recursively convert native objects within a map to their Dart equivalent.
Fixes: https://github.com/dart-lang/sdk/issues/44319
Change-Id: I80a2bc0541454900b1c7d9635debaf72d7c120f2
Bug: 44319
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201200
Commit-Queue: Gabriel Castro <gabrielmcastro@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
This adds the providesSymbol method to DynamicLibrary. It returns
whether the library contains a function with the given name.
As per dlsym(3), it is valid for dlsym to return nullptr in a success
case if the symbol actually has a NULL value. So I've changed the logic
to check for dlerror() after we invoke dlsym(), both in the existing
lookup and in the new method.
Closes https://github.com/dart-lang/sdk/issues/46192
TEST=tests/ffi(_2)/has_symbol_test.dart
Change-Id: Ibcb1c051cc0cdd95a104fe86ef2fc76da5bafb5d
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-linux-debug-x64-try,vm-kernel-win-debug-x64-try,vm-kernel-mac-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201900
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
# 1.5.0
- (internal) migrated to `SecurityLintCode` instead of deprecated
`SecurityLintCodeWithUniqueName`
- (internal) fixed `avoid_types_as_parameter_names` to skip field formal
parameters
- fixed false positives in `prefer_interpolation_to_compose_strings` where
the left operand is not a String
- fixed false positives in `only_throw_errors` for misidentified type
variables
- new lint: `depend_on_referenced_packages`
- update `avoid_returning_null_for_future` to skip checks for null-safe
libraries
- new lint: `use_test_throws_matchers`
- relax `sort_child_properties_last` to accept closures after child
- performance improvements for `prefer_contains` and `prefer_is_empty`
- new lint: `noop_primitive_operations`
- mark `avoid_web_libraries_in_flutter` as stable
- new lint: `prefer_final_parameters`
- update `prefer_initializing_formals` to allow assignments where identifier
names don't match
Change-Id: I447a9e277a037da30e1c7b5c23d3bb5d1037f26c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201163
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This is a reland of 5c9e37f03c
Following update of `DEPS` in `flutter/engine`:
https://github.com/flutter/engine/pull/26395
New commits include:
```
git log --format="%C(auto) %h %s" 00c00e8adf9706bebe8f94483b7663c5f36f59d2..def32ceb1d660552eaec24839d377199aea5a569
def32ceb Revert "Revert "Use the frontend server to compile pub executables (#2968)" (#3006)" (#3008)
0dc7e50c Make `.gitignore` and `.pubignore` case-insensitive on Windows / MacOS (#3009)
e89d4ab8 Generate GNU-style long file names in tar archives (#3005)
d2ad13d0 Revert "Use the frontend server to compile pub executables (#2968)" (#3006)
492b15ba New binstubs for global activate using `dart pub` (#3002)
e02f23bb fix grammer in .gitignore error message (#2995)
e01e3a41 Use the frontend server to compile pub executables (#2968)
647989c6 Use RetryClient from package:http/retry.dart (#2980)
```
Original change's description:
> Change-Id: I9a0b5fb2b5616a5a0eaa16f3a90205bb1bb1fc8f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200878
> Auto-Submit: Jonas Jensen <jonasfj@google.com>
> Commit-Queue: Alexander Thomas <athom@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
Change-Id: I1a0570318c63ec97fd141d79b405f55105111077
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201260
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
This reverts commit 5c9e37f03c.
Reason for revert: flutter builds on golem somehow broke.
Original change's description:
> Bump pub.
>
> New commits include:
> ```
> git log --format="%C(auto) %h %s" 00c00e8adf9706bebe8f94483b7663c5f36f59d2..def32ceb1d660552eaec24839d377199aea5a569
> def32ceb Revert "Revert "Use the frontend server to compile pub executables (#2968)" (#3006)" (#3008)
> 0dc7e50c Make `.gitignore` and `.pubignore` case-insensitive on Windows / MacOS (#3009)
> e89d4ab8 Generate GNU-style long file names in tar archives (#3005)
> d2ad13d0 Revert "Use the frontend server to compile pub executables (#2968)" (#3006)
> 492b15ba New binstubs for global activate using `dart pub` (#3002)
> e02f23bb fix grammer in .gitignore error message (#2995)
> e01e3a41 Use the frontend server to compile pub executables (#2968)
> 647989c6 Use RetryClient from package:http/retry.dart (#2980)
> ```
>
> Change-Id: I9a0b5fb2b5616a5a0eaa16f3a90205bb1bb1fc8f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200878
> Auto-Submit: Jonas Jensen <jonasfj@google.com>
> Commit-Queue: Alexander Thomas <athom@google.com>
> Reviewed-by: Alexander Thomas <athom@google.com>
TBR=athom@google.com,jonasfj@google.com
Change-Id: I635e1c2db8ae965881359d4969cbd506348b0ed0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/201000
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Jonas Jensen <jonasfj@google.com>
New commits include:
```
git log --format="%C(auto) %h %s" 00c00e8adf9706bebe8f94483b7663c5f36f59d2..def32ceb1d660552eaec24839d377199aea5a569
def32ceb Revert "Revert "Use the frontend server to compile pub executables (#2968)" (#3006)" (#3008)
0dc7e50c Make `.gitignore` and `.pubignore` case-insensitive on Windows / MacOS (#3009)
e89d4ab8 Generate GNU-style long file names in tar archives (#3005)
d2ad13d0 Revert "Use the frontend server to compile pub executables (#2968)" (#3006)
492b15ba New binstubs for global activate using `dart pub` (#3002)
e02f23bb fix grammer in .gitignore error message (#2995)
e01e3a41 Use the frontend server to compile pub executables (#2968)
647989c6 Use RetryClient from package:http/retry.dart (#2980)
```
Change-Id: I9a0b5fb2b5616a5a0eaa16f3a90205bb1bb1fc8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200878
Auto-Submit: Jonas Jensen <jonasfj@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Allow the `realm` argument to callbacks to be `null`.
This is a breaking change, but it only affects null-safe code.
Also fix a bug in http_impl.dart where an error function with
an *optional* stack trace parameter would be called without a stack trace.
Bug: https://github.com/dart-lang/sdk/issues/44039
Change-Id: I4b38382328e26478661bf45f46cd3017631f4ebd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170094
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Change-Id: If568c551e8183d81ab02a1822deb3979165561f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199861
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
New commits include:
```
$ git log --format="%C(auto) %h %s" 0e657414a472e74ca5dd76ae0db50cc060251dec..00c00e8adf9706bebe8f94483b7663c5f36f59d2
00c00e8a Vendor tar (#2987)
291705ca Being gradual migration to null-safety (#2988)
c5f52a37 Fix CI (#2989)
74040a45 Update to analyzer 1.5.0, migrate from deprecated AnalysisSession.getParsedUnit() (#2975)
ce951d70 Fix dry-run tests for publishing by ensuring there is a server to reject requests (#2978)
018c9650 Update LICENSE (#2944)
2614f15c Revert "Vendor package:tar and package:chunked_stream (#2932)" (#2940)
12d9f457 Handle package:tar cancellations
255a3091 Vendor package:tar and package:chunked_stream (#2932)
86bf8b20 Handle relative git-url-paths correctly when --directory (#2919)
3716a681 Let `pub add` fail if extra arguments are passed (#2927)
a03ac729 Minor cleanup to reduce risk of using path.current (#2924)
e87b7b66 Added null check for name in UserInfo class (#2918)
056a8c9a pub deps --json (#2896)
53a69e27 Fix .packages entries of relative path deps when using --directory (#2916)
d6308efc pub upgrade command shows count of discontinued packages (#2908)
51744805 Upgrade to the null safe versions of all dependencies (#2913)
e0d538c7 Introduce .pubignore (#2787)
79f3a8b9 pub outdated: added clear message when no outdated packages. (#2898)
22463872 `cache clean` (#2904)
11e7b2ce `publish --dry-run` informs that the server might do more checks (#2883)
b6977d50 Remove untrue assert (#2884)
35841f8d Merge branch 'cherry_picks_for_2_12'
0db3255b Don't fail on failed status listing (#2877)
53e8ecca Don't allow outdated taking arguments (#2872)
e83a1dc1 Enable asserts when testing pub (#2754)
178f2edb Add --directory option (#2876)
5aadb70e Don't fail on failed status listing (#2877)
4bf8a927 Remove unused field (#2878)
73ad5426 Don't allow outdated taking arguments (#2872)
9a70949e Use Dart library to read and write tar files (#2817)
2f74230c Do not recommend decativating packages (#2871)
b1697a27 Use full error message string in CommandResolutionFailedException (#2870)
16a6210d Upgrade `downgrade --help`: `downgrade` actually updates `pubspec.lock` (#2859)
6e240ea9 Use cached version listings as heuristic when prefetching (#2851)
58152f7c Allow trailing slash in PUB_HOSTED_URL (#2856)
b1bf9a33 Handle poor package-listing responses robustly. (#2847)
d941bd24 Fix request metadata when overriding dependencyType (#2848)
```
Change-Id: Id7cc4c09e74c02a92bcafe1a9d9bab9431900540
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199040
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Jonas Jensen <jonasfj@google.com>
The WebSql was dropped 5+ years ago and this library is unsupported.
This change adds the `@deprecated` annotation on the library and APIs in
dart:html that expose it (`window.openDatabase`). It also indicates to dartdoc
to skip it for the api.dart.dev site.
I run a `pub_crawl` process to verify that this is not in use. I checked 15K
packages, and only found 2 occurrances of an import to this library:
* One in a package marked as discontinued (used for migrating constants back
in Dart 2)
* Another in an example mock test (generated by mockito for mocking dart:html)
Also no library uses `window.openDatabase` either.
We will send a breaking change announcement soon and plan to delete this in a
future Dart release (possibly 2.15).
Fixes https://github.com/dart-lang/sdk/issues/45687
Fixes https://github.com/dart-lang/sdk/issues/45688
Change-Id: I8cd2bfa0ce64892c3f108bd6e24b8a0a3ec7c6ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196461
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>