Version 2.14.0-37.0.dev
Merge commit 'b10a592341bec4a00379d5c674a417b6b8c781a6' into 'dev'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dbc15dc..95c301c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,17 @@
daylight saving changes that are not precisely one hour.
(No change on the Web which uses the JavaScript `Date` object.)
+#### `dart:web_sql`
+
+* `dart:web_sql` is marked deprecated and will be removed in an upcoming
+ release. Also the API `window.openDatabase` in `dart:html` is deprecated as
+ well.
+
+ This API and library was exposing the WebSQL proposed standard. The standard
+ was abandoned more than 5 years ago and is not supported by most browsers.
+ The `dart:web_sql` library has been documented as unsupported and deprecated
+ for many years as well and but wasn't annotated properly until now.
+
### Dart VM
* **Breaking Change** [#45071][]: `Dart_NewWeakPersistentHandle`'s and
diff --git a/benchmarks/Omnibus/dart/Omnibus.dart b/benchmarks/Omnibus/dart/Omnibus.dart
index a59342a..9965376 100644
--- a/benchmarks/Omnibus/dart/Omnibus.dart
+++ b/benchmarks/Omnibus/dart/Omnibus.dart
@@ -9,9 +9,11 @@
//
// -N: run benchmarks N times, defaults to once.
-import '../../ListCopy/dart/ListCopy.dart' as lib_ListCopy;
+// ignore_for_file: library_prefixes
+
import '../../BigIntParsePrint/dart/BigIntParsePrint.dart'
as lib_BigIntParsePrint;
+import '../../ListCopy/dart/ListCopy.dart' as lib_ListCopy;
import '../../MD5/dart/md5.dart' as lib_MD5;
import '../../RuntimeType/dart/RuntimeType.dart' as lib_RuntimeType;
import '../../SHA1/dart/sha1.dart' as lib_SHA1;
@@ -39,13 +41,13 @@
'Utf8Encode': () => lib_Utf8Encode.main([]),
};
-main(List<String> originalArguments) {
- List<String> args = List.of(originalArguments);
+void main(List<String> originalArguments) {
+ final List<String> args = List.of(originalArguments);
int repeats = 1;
for (final arg in args.toList()) {
- int? count = int.tryParse(arg);
+ final int? count = int.tryParse(arg);
if (count != null && count < 0) {
repeats = 0 - count;
args.remove(arg);
diff --git a/benchmarks/Omnibus/dart2/Omnibus.dart b/benchmarks/Omnibus/dart2/Omnibus.dart
index 72587cd..3224fd2 100644
--- a/benchmarks/Omnibus/dart2/Omnibus.dart
+++ b/benchmarks/Omnibus/dart2/Omnibus.dart
@@ -11,21 +11,23 @@
//
// -N: run benchmarks N times, defaults to once.
-import '../../ListCopy/dart/ListCopy.dart' as lib_ListCopy;
-import '../../BigIntParsePrint/dart/BigIntParsePrint.dart'
+// ignore_for_file: library_prefixes
+
+import '../../BigIntParsePrint/dart2/BigIntParsePrint.dart'
as lib_BigIntParsePrint;
-import '../../MD5/dart/md5.dart' as lib_MD5;
-import '../../RuntimeType/dart/RuntimeType.dart' as lib_RuntimeType;
-import '../../SHA1/dart/sha1.dart' as lib_SHA1;
-import '../../SHA256/dart/sha256.dart' as lib_SHA256;
-import '../../SkeletalAnimation/dart/SkeletalAnimation.dart'
+import '../../ListCopy/dart2/ListCopy.dart' as lib_ListCopy;
+import '../../MD5/dart2/md5.dart' as lib_MD5;
+import '../../RuntimeType/dart2/RuntimeType.dart' as lib_RuntimeType;
+import '../../SHA1/dart2/sha1.dart' as lib_SHA1;
+import '../../SHA256/dart2/sha256.dart' as lib_SHA256;
+import '../../SkeletalAnimation/dart2/SkeletalAnimation.dart'
as lib_SkeletalAnimation;
-import '../../SkeletalAnimationSIMD/dart/SkeletalAnimationSIMD.dart'
+import '../../SkeletalAnimationSIMD/dart2/SkeletalAnimationSIMD.dart'
as lib_SkeletalAnimationSIMD;
-import '../../TypedDataDuplicate/dart/TypedDataDuplicate.dart'
+import '../../TypedDataDuplicate/dart2/TypedDataDuplicate.dart'
as lib_TypedDataDuplicate;
-import '../../Utf8Decode/dart/Utf8Decode.dart' as lib_Utf8Decode;
-import '../../Utf8Encode/dart/Utf8Encode.dart' as lib_Utf8Encode;
+import '../../Utf8Decode/dart2/Utf8Decode.dart' as lib_Utf8Decode;
+import '../../Utf8Encode/dart2/Utf8Encode.dart' as lib_Utf8Encode;
final Map<String, Function()> benchmarks = {
'ListCopy': lib_ListCopy.main,
@@ -41,13 +43,13 @@
'Utf8Encode': () => lib_Utf8Encode.main([]),
};
-main(List<String> originalArguments) {
- List<String> args = List.of(originalArguments);
+void main(List<String> originalArguments) {
+ final List<String> args = List.of(originalArguments);
int repeats = 1;
for (final arg in args.toList()) {
- int count = int.tryParse(arg);
+ final int count = int.tryParse(arg);
if (count != null && count < 0) {
repeats = 0 - count;
args.remove(arg);
diff --git a/benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart b/benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart
index e31cfb6..3dc12f5 100644
--- a/benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart
+++ b/benchmarks/OmnibusDeferred/dart/OmnibusDeferred.dart
@@ -9,9 +9,11 @@
//
// -N: run benchmarks N times, defaults to once.
-import '../../ListCopy/dart/ListCopy.dart' deferred as lib_ListCopy;
+// ignore_for_file: library_prefixes
+
import '../../BigIntParsePrint/dart/BigIntParsePrint.dart'
deferred as lib_BigIntParsePrint;
+import '../../ListCopy/dart/ListCopy.dart' deferred as lib_ListCopy;
import '../../MD5/dart/md5.dart' deferred as lib_MD5;
import '../../RuntimeType/dart/RuntimeType.dart' deferred as lib_RuntimeType;
import '../../SHA1/dart/sha1.dart' deferred as lib_SHA1;
@@ -78,20 +80,20 @@
),
};
-main(List<String> originalArguments) async {
- List<String> args = List.of(originalArguments);
+void main(List<String> originalArguments) async {
+ final List<String> args = List.of(originalArguments);
int repeats = 1;
for (final arg in args.toList()) {
- int? count = int.tryParse(arg);
+ final int? count = int.tryParse(arg);
if (count != null && count < 0) {
repeats = 0 - count;
args.remove(arg);
}
}
- bool preload = args.remove('--preload');
+ final preload = args.remove('--preload');
List<Lib> libs = [];
@@ -109,7 +111,9 @@
if (libs.isEmpty) libs = benchmarks.values.toList();
if (preload) {
- for (final lib in libs) await lib.load();
+ for (final lib in libs) {
+ await lib.load();
+ }
}
for (var i = 0; i < repeats; i++) {
diff --git a/benchmarks/OmnibusDeferred/dart2/OmnibusDeferred.dart b/benchmarks/OmnibusDeferred/dart2/OmnibusDeferred.dart
index 20a28bf..9e743ea 100644
--- a/benchmarks/OmnibusDeferred/dart2/OmnibusDeferred.dart
+++ b/benchmarks/OmnibusDeferred/dart2/OmnibusDeferred.dart
@@ -11,21 +11,23 @@
//
// -N: run benchmarks N times, defaults to once.
-import '../../ListCopy/dart/ListCopy.dart' deferred as lib_ListCopy;
-import '../../BigIntParsePrint/dart/BigIntParsePrint.dart'
+// ignore_for_file: library_prefixes
+
+import '../../BigIntParsePrint/dart2/BigIntParsePrint.dart'
deferred as lib_BigIntParsePrint;
-import '../../MD5/dart/md5.dart' deferred as lib_MD5;
-import '../../RuntimeType/dart/RuntimeType.dart' deferred as lib_RuntimeType;
-import '../../SHA1/dart/sha1.dart' deferred as lib_SHA1;
-import '../../SHA256/dart/sha256.dart' deferred as lib_SHA256;
-import '../../SkeletalAnimation/dart/SkeletalAnimation.dart'
+import '../../ListCopy/dart2/ListCopy.dart' deferred as lib_ListCopy;
+import '../../MD5/dart2/md5.dart' deferred as lib_MD5;
+import '../../RuntimeType/dart2/RuntimeType.dart' deferred as lib_RuntimeType;
+import '../../SHA1/dart2/sha1.dart' deferred as lib_SHA1;
+import '../../SHA256/dart2/sha256.dart' deferred as lib_SHA256;
+import '../../SkeletalAnimation/dart2/SkeletalAnimation.dart'
deferred as lib_SkeletalAnimation;
-import '../../SkeletalAnimationSIMD/dart/SkeletalAnimationSIMD.dart'
+import '../../SkeletalAnimationSIMD/dart2/SkeletalAnimationSIMD.dart'
deferred as lib_SkeletalAnimationSIMD;
-import '../../TypedDataDuplicate/dart/TypedDataDuplicate.dart'
+import '../../TypedDataDuplicate/dart2/TypedDataDuplicate.dart'
deferred as lib_TypedDataDuplicate;
-import '../../Utf8Decode/dart/Utf8Decode.dart' deferred as lib_Utf8Decode;
-import '../../Utf8Encode/dart/Utf8Encode.dart' deferred as lib_Utf8Encode;
+import '../../Utf8Decode/dart2/Utf8Decode.dart' deferred as lib_Utf8Decode;
+import '../../Utf8Encode/dart2/Utf8Encode.dart' deferred as lib_Utf8Encode;
class Lib {
final Future Function() load;
@@ -80,20 +82,20 @@
),
};
-main(List<String> originalArguments) async {
- List<String> args = List.of(originalArguments);
+void main(List<String> originalArguments) async {
+ final List<String> args = List.of(originalArguments);
int repeats = 1;
for (final arg in args.toList()) {
- int count = int.tryParse(arg);
+ final int count = int.tryParse(arg);
if (count != null && count < 0) {
repeats = 0 - count;
args.remove(arg);
}
}
- bool preload = args.remove('--preload');
+ final preload = args.remove('--preload');
List<Lib> libs = [];
@@ -111,7 +113,9 @@
if (libs.isEmpty) libs = benchmarks.values.toList();
if (preload) {
- for (final lib in libs) await lib.load();
+ for (final lib in libs) {
+ await lib.load();
+ }
}
for (var i = 0; i < repeats; i++) {
diff --git a/pkg/analysis_server/lib/src/protocol_server.dart b/pkg/analysis_server/lib/src/protocol_server.dart
index d84f9cb..2492df0 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -166,7 +166,7 @@
var endColumn = endLocation.columnNumber;
return DiagnosticMessage(
- message.message,
+ message.messageText(includeUrl: true),
Location(
file, offset, length, startLine, startColumn, endLine, endColumn));
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart b/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart
index a39cc31..c21bf0b 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/abstract_producer.dart
@@ -323,7 +323,8 @@
/// Return the text of the error message being fixed, or `null` if there is
/// no diagnostic.
- String? get errorMessage => diagnostic?.problemMessage.message;
+ String? get errorMessage =>
+ diagnostic?.problemMessage.messageText(includeUrl: true);
/// Return the offset of the error message being fixed, or `null` if there is
/// no diagnostic.
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_required_argument.dart b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_required_argument.dart
index 6da748e..c3aa42d 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/add_missing_required_argument.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/add_missing_required_argument.dart
@@ -49,7 +49,8 @@
if (targetElement is ExecutableElement && argumentList != null) {
// Format: "Missing required argument 'foo'."
- var messageParts = diagnostic.problemMessage.message.split("'");
+ var messageParts =
+ diagnostic.problemMessage.messageText(includeUrl: false).split("'");
if (messageParts.length < 2) {
return;
}
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/extend_class_for_mixin.dart b/pkg/analysis_server/lib/src/services/correction/dart/extend_class_for_mixin.dart
index 10dbaad..52ed499 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/extend_class_for_mixin.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/extend_class_for_mixin.dart
@@ -28,7 +28,7 @@
if (declaration != null && declaration.extendsClause == null) {
// TODO(brianwilkerson) Find a way to pass in the name of the class
// without needing to parse the message.
- var message = diagnostic.problemMessage.message;
+ var message = diagnostic.problemMessage.messageText(includeUrl: false);
var endIndex = message.lastIndexOf("'");
var startIndex = message.lastIndexOf("'", endIndex - 1) + 1;
_typeName = message.substring(startIndex, endIndex);
diff --git a/pkg/analysis_server/lib/src/services/correction/dart/insert_semicolon.dart b/pkg/analysis_server/lib/src/services/correction/dart/insert_semicolon.dart
index 60ad47b..b50d526 100644
--- a/pkg/analysis_server/lib/src/services/correction/dart/insert_semicolon.dart
+++ b/pkg/analysis_server/lib/src/services/correction/dart/insert_semicolon.dart
@@ -20,7 +20,7 @@
}
var message = diagnostic.problemMessage;
- if (message.message.contains("';'")) {
+ if (message.messageText(includeUrl: false).contains("';'")) {
if (_isAwaitNode()) {
return;
}
diff --git a/pkg/analysis_server/test/protocol_server_test.dart b/pkg/analysis_server/test/protocol_server_test.dart
index 850b29a..f844d14 100644
--- a/pkg/analysis_server/test/protocol_server_test.dart
+++ b/pkg/analysis_server/test/protocol_server_test.dart
@@ -62,6 +62,7 @@
offset: 30,
length: 5,
message: 'context',
+ url: null,
),
);
var error = newAnalysisError_fromEngine(
diff --git a/pkg/analysis_server/test/utils/test_support.dart b/pkg/analysis_server/test/utils/test_support.dart
index c3f4888..a917926 100644
--- a/pkg/analysis_server/test/utils/test_support.dart
+++ b/pkg/analysis_server/test/utils/test_support.dart
@@ -33,7 +33,7 @@
return message.filePath == filePath &&
message.offset == offset &&
message.length == length &&
- (text == null || message.message == text);
+ (text == null || message.messageText(includeUrl: true) == text);
}
}
diff --git a/pkg/analyzer/lib/diagnostic/diagnostic.dart b/pkg/analyzer/lib/diagnostic/diagnostic.dart
index 424135c..5179104 100644
--- a/pkg/analyzer/lib/diagnostic/diagnostic.dart
+++ b/pkg/analyzer/lib/diagnostic/diagnostic.dart
@@ -37,12 +37,31 @@
/// The length of the source range associated with this message.
int get length;
- /// The text of the message.
+ /// Gets the text of the message.
+ ///
+ /// This getter exists for backwards compatibility with code that was written
+ /// prior to the addition of URLs to diagnostic messages. New clients should
+ /// use `messageText` instead.
+ @Deprecated('Use messageText(includeUrl: true) instead')
String get message;
/// The zero-based offset from the start of the file to the beginning of the
/// source range associated with this message.
int get offset;
+
+ /// The URL associated with this diagnostic message, if any.
+ String? get url;
+
+ /// Gets the text of the message.
+ ///
+ /// If [includeUrl] is `true`, and this diagnostic message has an associated
+ /// URL, it is included in the returned value in a human-readable way.
+ /// Clients that wish to present URLs as simple text can do this. If
+ /// [includeUrl] is `false`, no URL is included in the returned value.
+ /// Clients that have a special mechanism for presenting URLs (e.g. as a
+ /// clickable link) should do this and then consult the [url] getter to access
+ /// the URL.
+ String messageText({required bool includeUrl});
}
/// An indication of the severity of a [Diagnostic].
diff --git a/pkg/analyzer/lib/error/error.dart b/pkg/analyzer/lib/error/error.dart
index 0134b77..084d2b3 100644
--- a/pkg/analyzer/lib/error/error.dart
+++ b/pkg/analyzer/lib/error/error.dart
@@ -946,7 +946,8 @@
filePath: source.fullName,
length: length,
message: message,
- offset: offset);
+ offset: offset,
+ url: null);
}
/// Initialize a newly created analysis error with given values.
@@ -958,7 +959,8 @@
filePath: source.fullName,
length: length,
message: message,
- offset: offset);
+ offset: offset,
+ url: null);
}
/// Initialize a newly created analysis error. The error is associated with
@@ -980,6 +982,7 @@
length: length,
message: messageText,
offset: offset,
+ url: null,
);
}
@@ -1008,7 +1011,7 @@
/// Return the message to be displayed for this error. The message should
/// indicate what is wrong and why it is wrong.
- String get message => _problemMessage.message;
+ String get message => _problemMessage.messageText(includeUrl: true);
/// The character offset from the beginning of the source (zero based) where
/// the error occurred.
diff --git a/pkg/analyzer/lib/error/listener.dart b/pkg/analyzer/lib/error/listener.dart
index b37838a2..1d2df42 100644
--- a/pkg/analyzer/lib/error/listener.dart
+++ b/pkg/analyzer/lib/error/listener.dart
@@ -221,7 +221,8 @@
filePath: element.source!.fullName,
length: element.nameLength,
message: '$name is defined in ${element.source!.fullName}',
- offset: element.nameOffset));
+ offset: element.nameOffset,
+ url: null));
}
if (buffer != null) {
diff --git a/pkg/analyzer/lib/src/dart/analysis/driver.dart b/pkg/analyzer/lib/src/dart/analysis/driver.dart
index 37d2981..7be0e1b 100644
--- a/pkg/analyzer/lib/src/dart/analysis/driver.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/driver.dart
@@ -2393,12 +2393,14 @@
var contextMessages = <DiagnosticMessageImpl>[];
for (var message in error.contextMessages) {
+ var url = message.url;
contextMessages.add(
DiagnosticMessageImpl(
filePath: message.filePath,
length: message.length,
message: message.message,
offset: message.offset,
+ url: url.isEmpty ? null : url,
),
);
}
@@ -2421,8 +2423,9 @@
DiagnosticMessageBuilder(
filePath: message.filePath,
length: message.length,
- message: message.message,
+ message: message.messageText(includeUrl: false),
offset: message.offset,
+ url: message.url,
),
);
}
diff --git a/pkg/analyzer/lib/src/diagnostic/diagnostic.dart b/pkg/analyzer/lib/src/diagnostic/diagnostic.dart
index aeeb56e..39a6b98 100644
--- a/pkg/analyzer/lib/src/diagnostic/diagnostic.dart
+++ b/pkg/analyzer/lib/src/diagnostic/diagnostic.dart
@@ -12,18 +12,38 @@
@override
final int length;
- @override
- final String message;
+ final String _message;
@override
final int offset;
+ @override
+ final String? url;
+
/// Initialize a newly created message to represent a [message] reported in
/// the file at the given [filePath] at the given [offset] and with the given
/// [length].
DiagnosticMessageImpl(
{required this.filePath,
required this.length,
- required this.message,
- required this.offset});
+ required String message,
+ required this.offset,
+ required this.url})
+ : _message = message;
+
+ @override
+ String get message => messageText(includeUrl: true);
+
+ @override
+ String messageText({required bool includeUrl}) {
+ if (includeUrl && url != null) {
+ var result = StringBuffer(_message);
+ if (!_message.endsWith('.')) {
+ result.write('.');
+ }
+ result.write(' See $url');
+ return result.toString();
+ }
+ return _message;
+ }
}
diff --git a/pkg/analyzer/lib/src/diagnostic/diagnostic_factory.dart b/pkg/analyzer/lib/src/diagnostic/diagnostic_factory.dart
index d76f15c5..11ad6a2 100644
--- a/pkg/analyzer/lib/src/diagnostic/diagnostic_factory.dart
+++ b/pkg/analyzer/lib/src/diagnostic/diagnostic_factory.dart
@@ -29,7 +29,8 @@
filePath: source.fullName,
message: "The first element with this value.",
offset: originalElement.offset,
- length: originalElement.length)
+ length: originalElement.length,
+ url: null)
]);
}
@@ -43,7 +44,8 @@
filePath: source.fullName,
message: "The first key with this value.",
offset: originalKey.offset,
- length: originalKey.length)
+ length: originalKey.length,
+ url: null)
]);
}
@@ -62,7 +64,8 @@
filePath: source.fullName,
message: "The operator '$lexeme' is causing the short circuiting.",
offset: previousToken.offset,
- length: previousToken.length)
+ length: previousToken.length,
+ url: null)
]);
}
@@ -81,7 +84,8 @@
filePath: source.fullName,
message: "The declaration of '$name' is here.",
offset: declarationOffset,
- length: staticElement.nameLength)
+ length: staticElement.nameLength,
+ url: null)
];
}
return AnalysisError(
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 71ca8bb..2ccfebc 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -3424,9 +3424,10 @@
DiagnosticMessage? visitThisNotPromoted(ThisNotPromoted reason) {
return DiagnosticMessageImpl(
filePath: source.fullName,
- message: "'this' can't be promoted. See ${reason.documentationLink}",
+ message: "'this' can't be promoted",
offset: _errorEntity.offset,
- length: _errorEntity.length);
+ length: _errorEntity.length,
+ url: reason.documentationLink);
}
DiagnosticMessageImpl _contextMessageForProperty(
@@ -3435,10 +3436,11 @@
NonPromotionReason reason) {
return DiagnosticMessageImpl(
filePath: property.source.fullName,
- message: "'$propertyName' refers to a property so it couldn't be "
- "promoted. See ${reason.documentationLink}",
+ message:
+ "'$propertyName' refers to a property so it couldn't be promoted",
offset: property.nameOffset,
- length: property.nameLength);
+ length: property.nameLength,
+ url: reason.documentationLink);
}
DiagnosticMessageImpl _contextMessageForWrite(
@@ -3446,8 +3448,9 @@
return DiagnosticMessageImpl(
filePath: source.fullName,
message: "Variable '$variableName' could not be promoted due to an "
- "assignment. See ${reason.documentationLink}",
+ "assignment",
offset: node.offset,
- length: node.length);
+ length: node.length,
+ url: reason.documentationLink);
}
}
diff --git a/pkg/analyzer/lib/src/summary/format.dart b/pkg/analyzer/lib/src/summary/format.dart
index edf1d2f..6db5b7f 100644
--- a/pkg/analyzer/lib/src/summary/format.dart
+++ b/pkg/analyzer/lib/src/summary/format.dart
@@ -3777,6 +3777,7 @@
int? _length;
String? _message;
int? _offset;
+ String? _url;
@override
String get filePath => _filePath ??= '';
@@ -3813,12 +3814,25 @@
this._offset = value;
}
+ @override
+ String get url => _url ??= '';
+
+ /// The URL of the message, if any.
+ set url(String value) {
+ this._url = value;
+ }
+
DiagnosticMessageBuilder(
- {String? filePath, int? length, String? message, int? offset})
+ {String? filePath,
+ int? length,
+ String? message,
+ int? offset,
+ String? url})
: _filePath = filePath,
_length = length,
_message = message,
- _offset = offset;
+ _offset = offset,
+ _url = url;
/// Flush [informative] data recursively.
void flushInformative() {}
@@ -3829,11 +3843,13 @@
signatureSink.addInt(this._length ?? 0);
signatureSink.addString(this._message ?? '');
signatureSink.addInt(this._offset ?? 0);
+ signatureSink.addString(this._url ?? '');
}
fb.Offset finish(fb.Builder fbBuilder) {
fb.Offset? offset_filePath;
fb.Offset? offset_message;
+ fb.Offset? offset_url;
var filePath = _filePath;
if (filePath != null) {
offset_filePath = fbBuilder.writeString(filePath);
@@ -3842,6 +3858,10 @@
if (message != null) {
offset_message = fbBuilder.writeString(message);
}
+ var url = _url;
+ if (url != null) {
+ offset_url = fbBuilder.writeString(url);
+ }
fbBuilder.startTable();
if (offset_filePath != null) {
fbBuilder.addOffset(0, offset_filePath);
@@ -3851,6 +3871,9 @@
fbBuilder.addOffset(2, offset_message);
}
fbBuilder.addUint32(3, _offset, 0);
+ if (offset_url != null) {
+ fbBuilder.addOffset(4, offset_url);
+ }
return fbBuilder.endTable();
}
}
@@ -3875,6 +3898,7 @@
int? _length;
String? _message;
int? _offset;
+ String? _url;
@override
String get filePath {
@@ -3897,6 +3921,11 @@
int get offset {
return _offset ??= const fb.Uint32Reader().vTableGet(_bc, _bcOffset, 3, 0);
}
+
+ @override
+ String get url {
+ return _url ??= const fb.StringReader().vTableGet(_bc, _bcOffset, 4, '');
+ }
}
abstract class _DiagnosticMessageMixin implements idl.DiagnosticMessage {
@@ -3919,6 +3948,10 @@
if (local_offset != 0) {
_result["offset"] = local_offset;
}
+ var local_url = url;
+ if (local_url != '') {
+ _result["url"] = local_url;
+ }
return _result;
}
@@ -3928,6 +3961,7 @@
"length": length,
"message": message,
"offset": offset,
+ "url": url,
};
@override
diff --git a/pkg/analyzer/lib/src/summary/format.fbs b/pkg/analyzer/lib/src/summary/format.fbs
index 43b6eb4..55f086c 100644
--- a/pkg/analyzer/lib/src/summary/format.fbs
+++ b/pkg/analyzer/lib/src/summary/format.fbs
@@ -437,6 +437,9 @@
/// The zero-based offset from the start of the file to the beginning of the
/// source range associated with this message.
offset:uint (id: 3);
+
+ /// The URL of the message, if any.
+ url:string (id: 4);
}
/// Information about the Dartdoc directives in an [AvailableFile].
diff --git a/pkg/analyzer/lib/src/summary/idl.dart b/pkg/analyzer/lib/src/summary/idl.dart
index 58625f0..cc6271a 100644
--- a/pkg/analyzer/lib/src/summary/idl.dart
+++ b/pkg/analyzer/lib/src/summary/idl.dart
@@ -495,6 +495,10 @@
/// source range associated with this message.
@Id(3)
int get offset;
+
+ /// The URL of the message, if any.
+ @Id(4)
+ String get url;
}
/// Information about the Dartdoc directives in an [AvailableFile].
diff --git a/pkg/analyzer/test/generated/test_support.dart b/pkg/analyzer/test/generated/test_support.dart
index 97ca394..c8a5797 100644
--- a/pkg/analyzer/test/generated/test_support.dart
+++ b/pkg/analyzer/test/generated/test_support.dart
@@ -32,7 +32,7 @@
return message.filePath == filePath &&
message.offset == offset &&
message.length == length &&
- (text == null || message.message == text);
+ (text == null || message.messageText(includeUrl: true) == text);
}
}
diff --git a/pkg/analyzer_cli/lib/src/error_formatter.dart b/pkg/analyzer_cli/lib/src/error_formatter.dart
index 19fae89..16a2732 100644
--- a/pkg/analyzer_cli/lib/src/error_formatter.dart
+++ b/pkg/analyzer_cli/lib/src/error_formatter.dart
@@ -316,8 +316,11 @@
if (fileResult is FileResult) {
var lineInfo = fileResult?.lineInfo;
var location = lineInfo.getLocation(message.offset);
- contextMessages.add(ContextMessage(message.filePath, message.message,
- location.lineNumber, location.columnNumber));
+ contextMessages.add(ContextMessage(
+ message.filePath,
+ message.messageText(includeUrl: true),
+ location.lineNumber,
+ location.columnNumber));
}
}
}
@@ -392,7 +395,7 @@
contextMessages.add({
'location': location(contextMessage.filePath, contextMessage.offset,
contextMessage.length, lineInfo),
- 'message': contextMessage.message,
+ 'message': contextMessage.messageText(includeUrl: true),
});
}
var errorCode = error.errorCode;
@@ -404,7 +407,7 @@
'type': errorCode.type.name,
'location': location(problemMessage.filePath, problemMessage.offset,
problemMessage.length, lineInfo),
- 'problemMessage': problemMessage.message,
+ 'problemMessage': problemMessage.messageText(includeUrl: true),
if (error.correction != null) 'correctionMessage': error.correction,
if (contextMessages.isNotEmpty) 'contextMessages': contextMessages,
if (url != null) 'documentation': url,
diff --git a/pkg/analyzer_cli/test/mocks.dart b/pkg/analyzer_cli/test/mocks.dart
index 918b2d6..70fd581 100644
--- a/pkg/analyzer_cli/test/mocks.dart
+++ b/pkg/analyzer_cli/test/mocks.dart
@@ -42,7 +42,8 @@
filePath: source.fullName,
length: length,
message: message,
- offset: offset);
+ offset: offset,
+ url: null);
@override
Severity get severity => null;
diff --git a/pkg/analyzer_plugin/lib/utilities/analyzer_converter.dart b/pkg/analyzer_plugin/lib/utilities/analyzer_converter.dart
index cb31eac..87af1a3 100644
--- a/pkg/analyzer_plugin/lib/utilities/analyzer_converter.dart
+++ b/pkg/analyzer_plugin/lib/utilities/analyzer_converter.dart
@@ -106,7 +106,7 @@
endColumn = endLocation.columnNumber;
}
return plugin.DiagnosticMessage(
- message.message,
+ message.messageText(includeUrl: true),
plugin.Location(
file, offset, length, startLine, startColumn, endLine, endColumn));
}
diff --git a/pkg/analyzer_plugin/test/utilities/analyzer_converter_test.dart b/pkg/analyzer_plugin/test/utilities/analyzer_converter_test.dart
index 18c6333..75d5a34 100644
--- a/pkg/analyzer_plugin/test/utilities/analyzer_converter_test.dart
+++ b/pkg/analyzer_plugin/test/utilities/analyzer_converter_test.dart
@@ -84,7 +84,8 @@
filePath: source.fullName,
offset: 53,
length: 7,
- message: contextMessage));
+ message: contextMessage,
+ url: null));
}
return analyzer.AnalysisError(
source,
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 0dfdbc8..b25a9bd 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -33660,6 +33660,7 @@
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Creates('SqlDatabase')
+ @deprecated
SqlDatabase openDatabase(
String name, String version, String displayName, int estimatedSize,
[DatabaseCallback? creationCallback]) {
diff --git a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
index 4d7f936..863ba21 100644
--- a/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
+++ b/sdk/lib/web_sql/dart2js/web_sql_dart2js.dart
@@ -9,6 +9,7 @@
* The [dart:indexed_db] APIs is a recommended alternatives.
*
* {@category Web}
+ * {@nodoc}
*/
library dart.dom.web_sql;
@@ -23,6 +24,7 @@
// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
// Auto-generated dart:audio library.
+@deprecated
import 'dart:_js_helper'
show
applyExtension,
diff --git a/tools/VERSION b/tools/VERSION
index 816f32a..1a66e10 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 36
+PRERELEASE 37
PRERELEASE_PATCH 0
\ No newline at end of file
diff --git a/tools/dom/scripts/go.sh b/tools/dom/scripts/go.sh
index 609a9cd..71789cf 100755
--- a/tools/dom/scripts/go.sh
+++ b/tools/dom/scripts/go.sh
@@ -35,5 +35,7 @@
fi
fi
+# third_party IDL scripts are not compatible with python3, so use python2.7.
+
reset && \
-./dartdomgenerator.py --systems="$SYSTEMS" --logging=40 --update-dom-metadata --gen-interop "$ARG_OPTION"
+python2.7 ./dartdomgenerator.py --systems="$SYSTEMS" --logging=40 --update-dom-metadata --gen-interop "$ARG_OPTION"
diff --git a/tools/dom/templates/html/dart2js/web_sql_dart2js.darttemplate b/tools/dom/templates/html/dart2js/web_sql_dart2js.darttemplate
index 267eae2..8877f95 100644
--- a/tools/dom/templates/html/dart2js/web_sql_dart2js.darttemplate
+++ b/tools/dom/templates/html/dart2js/web_sql_dart2js.darttemplate
@@ -13,7 +13,9 @@
* The [dart:indexed_db] APIs is a recommended alternatives.
*
* {@category Web}
+ * {@nodoc}
*/
+@deprecated
library dart.dom.web_sql;
import 'dart:async';
diff --git a/tools/dom/templates/html/impl/impl_Window.darttemplate b/tools/dom/templates/html/impl/impl_Window.darttemplate
index 0c35a8b..98e07f0 100644
--- a/tools/dom/templates/html/impl/impl_Window.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Window.darttemplate
@@ -226,6 +226,7 @@
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Creates('SqlDatabase')
+ @deprecated
SqlDatabase openDatabase(
String name, String version, String displayName, int estimatedSize,
[DatabaseCallback$NULLABLE creationCallback]) {