Skip to content

Commit

Permalink
Version 2.12.0-219.0.dev
Browse files Browse the repository at this point in the history
Merge commit '93706517736022cf0d63e9b4a731cb879a22f4d8' into 'dev'
  • Loading branch information
Dart CI committed Jan 12, 2021
2 parents 4f75c89 + 9370651 commit ef8bf7f
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 40 deletions.
21 changes: 20 additions & 1 deletion pkg/nnbd_migration/lib/migration_cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,26 @@ sources' action.
/// return additional paths that aren't inside the user's project, but doesn't
/// override this method, then those additional paths will be analyzed but not
/// migrated.
bool shouldBeMigrated(DriverBasedAnalysisContext context, String path) {
///
/// Note: in a future version of the code, the [context] argument will be
/// removed; to ease the transition, clients should stop overriding this
/// method and should override [shouldBeMigrated2] instead.
bool shouldBeMigrated(DriverBasedAnalysisContext context, String path) =>
shouldBeMigrated2(path);

/// Determines whether a migrated version of the file at [path] should be
/// output by the migration too. May be overridden by a derived class.
///
/// This method should return `false` for files that are being considered by
/// the migration tool for information only (for example generated files, or
/// usages of the code-to-be-migrated by one one of its clients).
///
/// By default returns `true` if the file is contained within the context
/// root. This means that if a client overrides [computePathsToProcess] to
/// return additional paths that aren't inside the user's project, but doesn't
/// override this method, then those additional paths will be analyzed but not
/// migrated.
bool shouldBeMigrated2(String path) {
return analysisContext.contextRoot.isAnalyzed(path);
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/nnbd_migration/test/migration_cli_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ class _MigrationCliRunner extends MigrationCliRunner {
}

@override
bool shouldBeMigrated(DriverBasedAnalysisContext context, String path) =>
bool shouldBeMigrated2(String path) =>
cli._test.overrideShouldBeMigrated?.call(path) ??
super.shouldBeMigrated(context, path);
super.shouldBeMigrated2(path);

/// Sorts the paths in [paths] for repeatability of migration tests.
Set<String> _sortPaths(Set<String> paths) {
Expand Down
19 changes: 10 additions & 9 deletions sdk/lib/convert/base64.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ part of dart.convert;
/// does not allow invalid characters and requires padding.
///
/// Examples:
///
/// var encoded = base64.encode([0x62, 0x6c, 0xc3, 0xa5, 0x62, 0xc3, 0xa6,
/// 0x72, 0x67, 0x72, 0xc3, 0xb8, 0x64]);
/// var decoded = base64.decode("YmzDpWLDpnJncsO4ZAo=");
///
/// ```dart
/// var encoded = base64.encode([0x62, 0x6c, 0xc3, 0xa5, 0x62, 0xc3, 0xa6,
/// 0x72, 0x67, 0x72, 0xc3, 0xb8, 0x64]);
/// var decoded = base64.decode("YmzDpWLDpnJncsO4ZAo=");
/// ```
/// The top-level [base64Encode] and [base64Decode] functions may be used
/// instead if a local variable shadows the [base64] constant.
const Base64Codec base64 = Base64Codec();
Expand All @@ -27,10 +27,11 @@ const Base64Codec base64 = Base64Codec();
/// does not allow invalid characters and requires padding.
///
/// Examples:
///
/// var encoded = base64Url.encode([0x62, 0x6c, 0xc3, 0xa5, 0x62, 0xc3, 0xa6,
/// 0x72, 0x67, 0x72, 0xc3, 0xb8, 0x64]);
/// var decoded = base64Url.decode("YmzDpWLDpnJncsO4ZAo=");
/// ```dart
/// var encoded = base64Url.encode([0x62, 0x6c, 0xc3, 0xa5, 0x62, 0xc3, 0xa6,
/// 0x72, 0x67, 0x72, 0xc3, 0xb8, 0x64]);
/// var decoded = base64Url.decode("YmzDpWLDpnJncsO4ZAo=");
/// ```
const Base64Codec base64Url = Base64Codec.urlSafe();

/// Encodes [bytes] using [base64](https://tools.ietf.org/html/rfc4648) encoding.
Expand Down
30 changes: 15 additions & 15 deletions sdk/lib/convert/convert.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
/// chain and to use with streams.
///
/// To use this library in your code:
///
/// import 'dart:convert';
///
/// ```dart
/// import 'dart:convert';
/// ```
/// Two commonly used converters are the top-level instances of
/// [JsonCodec] and [Utf8Codec], named [json] and [utf8], respectively.
///
Expand All @@ -34,19 +34,19 @@
/// as it's read from a file,
/// The second is an instance of [LineSplitter],
/// which splits the data on newline boundaries.
/// ```dart
/// var lineNumber = 1;
/// var stream = File('quotes.txt').openRead();
///
/// var lineNumber = 1;
/// var stream = File('quotes.txt').openRead();
///
/// stream.transform(utf8.decoder)
/// .transform(const LineSplitter())
/// .listen((line) {
/// if (showLineNumbers) {
/// stdout.write('${lineNumber++} ');
/// }
/// stdout.writeln(line);
/// });
///
/// stream.transform(utf8.decoder)
/// .transform(const LineSplitter())
/// .listen((line) {
/// if (showLineNumbers) {
/// stdout.write('${lineNumber++} ');
/// }
/// stdout.writeln(line);
/// });
/// ```
/// See the documentation for the [Codec] and [Converter] classes
/// for information about creating your own converters.
///
Expand Down
17 changes: 9 additions & 8 deletions sdk/lib/convert/json.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ class JsonCyclicError extends JsonUnsupportedObjectError {
/// use cases.
///
/// Examples:
///
/// var encoded = json.encode([1, 2, { "a": null }]);
/// var decoded = json.decode('["foo", { "bar": 499 }]');
///
/// ```dart
/// var encoded = json.encode([1, 2, { "a": null }]);
/// var decoded = json.decode('["foo", { "bar": 499 }]');
/// ```
/// The top-level [jsonEncode] and [jsonDecode] functions may be used instead if
/// a local variable shadows the [json] constant.
const JsonCodec json = JsonCodec();
Expand Down Expand Up @@ -99,9 +99,10 @@ dynamic jsonDecode(String source,
/// JSON objects.
///
/// Examples:
///
/// var encoded = json.encode([1, 2, { "a": null }]);
/// var decoded = json.decode('["foo", { "bar": 499 }]');
/// ```dart
/// var encoded = json.encode([1, 2, { "a": null }]);
/// var decoded = json.decode('["foo", { "bar": 499 }]');
/// ```
class JsonCodec extends Codec<Object?, String> {
final Object? Function(Object? key, Object? value)? _reviver;
final Object? Function(dynamic)? _toEncodable;
Expand Down Expand Up @@ -246,7 +247,7 @@ class JsonEncoder extends Converter<Object?, String> {
/// If the conversion throws, or returns a value that is not directly
/// serializable, a [JsonUnsupportedObjectError] exception is thrown.
/// If the call throws, the error is caught and stored in the
/// [JsonUnsupportedObjectError]'s [:cause:] field.
/// [JsonUnsupportedObjectError]'s `cause` field.
///
/// If a [List] or [Map] contains a reference to itself, directly or through
/// other lists or maps, it cannot be serialized and a [JsonCyclicError] is
Expand Down
9 changes: 5 additions & 4 deletions sdk/lib/convert/utf.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ const int unicodeBomCharacterRune = 0xFEFF;
/// use cases.
///
/// Examples:
///
/// var encoded = utf8.encode("Îñţérñåţîöñåļîžåţîờñ");
/// var decoded = utf8.decode([0x62, 0x6c, 0xc3, 0xa5, 0x62, 0xc3, 0xa6,
/// 0x72, 0x67, 0x72, 0xc3, 0xb8, 0x64]);
/// ```dart
/// var encoded = utf8.encode("Îñţérñåţîöñåļîžåţîờñ");
/// var decoded = utf8.decode([0x62, 0x6c, 0xc3, 0xa5, 0x62, 0xc3, 0xa6,
/// 0x72, 0x67, 0x72, 0xc3, 0xb8, 0x64]);
/// ```
const Utf8Codec utf8 = Utf8Codec();

/// A [Utf8Codec] encodes strings to utf-8 code units (bytes) and decodes
Expand Down
2 changes: 1 addition & 1 deletion tools/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ CHANNEL dev
MAJOR 2
MINOR 12
PATCH 0
PRERELEASE 218
PRERELEASE 219
PRERELEASE_PATCH 0

0 comments on commit ef8bf7f

Please sign in to comment.