Skip to content

Commit

Permalink
Version 3.5.0-76.0.dev
Browse files Browse the repository at this point in the history
Merge 6011eb9 into dev
  • Loading branch information
Dart CI committed Apr 19, 2024
2 parents 62b85ea + 6011eb9 commit a46161e
Show file tree
Hide file tree
Showing 36 changed files with 546 additions and 407 deletions.
52 changes: 52 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,58 @@ advantage of these improvements, set your package's
[devtools-2-32-0]: https://docs.flutter.dev/tools/devtools/release-notes/release-notes-2.32.0
[devtools-2-33-0]: https://docs.flutter.dev/tools/devtools/release-notes/release-notes-2.33.0

## 3.3.4 - 2024-04-17

This is a patch release that:

- Fixes an issue with JS interop in dart2wasm where JS interop methods that used
the enclosing library's `@JS` annotation were actually using the invocation's
enclosing library's `@JS` annotation. (issue [#55430]).

[#55430]: https://github.com/dart-lang/sdk/issues/55430

## 3.3.3 - 2024-03-27

This is a patch release that:

- Fixes an issue where dart vm crashed when running on pre-SSE41 older CPUs on Windows (issue [#55211][]).

[#55211]: https://github.com/dart-lang/sdk/issues/55211

## 3.3.2 - 2024-03-20

This is a patch release that:

- Fixes an issue in the CFE that placed some structural parameter references out
of their context in the code restored from dill files, causing crashes in the
incremental compiler whenever it restored a typedef from dill such that the
typedef contained a generic function type on its right-hand side (issue
[#55158][]).
- Fixes an issue in the CFE that prevented redirecting factories from being
resolved in initializers of extension types (issue [#55194][]).
- Fixes an issues with VM's implementation of `DateTime.timeZoneName`
on Windows, which was checking whether current date is in the summer or
standard time rather than checking if the given moment is in the summer or
standard time (issue [#55240][]).

[#55158]: https://github.com/dart-lang/sdk/issues/55158
[#55194]: https://github.com/dart-lang/sdk/issues/55194
[#55240]: https://github.com/dart-lang/sdk/issues/55240

## 3.3.1 - 2024-03-06

This is a patch release that:

- Fixes an issue in dart2js where object literal constructors in interop
extension types would fail to compile without an `@JS` annotation on the
library (issue [#55057][]).
- Disallows certain types involving extension types from being used as the
operand of an `await` expression, unless the extension type itself implements
`Future` (issue [#55095][]).

[#55057]: https://github.com/dart-lang/sdk/issues/55057
[#55095]: https://github.com/dart-lang/sdk/issues/55095

## 3.3.0

### Language
Expand Down
8 changes: 4 additions & 4 deletions DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ vars = {
#
# For more details, see https://github.com/dart-lang/sdk/issues/30164.
"dart_style_rev": "a6ad7693555a9add6f98ad6fd94de80d35c89415", # disable tools/rev_sdk_deps.dart
"dartdoc_rev": "f339b094b123a18c88f277fd997a590a9431973c",
"dartdoc_rev": "592694e0557122c59f9eaf007dd8139d84d411d8",
"ecosystem_rev": "9fabe464ea1d8408774de74d2ac759c1f90ae480",
"file_rev": "f858c6fe9d1b0167b944aa62dd9b4321036b5238",
"fixnum_rev": "dec16eb715f70f2fe0ed509da2e118354bea21d8",
Expand Down Expand Up @@ -188,12 +188,12 @@ vars = {
"test_reflective_loader_rev": "d7167a2375d8a0c02c12b960c059a115a777f238",
"tools_rev": "d86ea23c79d2e9dc622d3376aa80d94fbf30bf60",
"typed_data_rev": "8c7393cbbbba7a5d38c6772371f92d6b38e433fc",
"usage_rev": "09cab899c2759c2e1c84ab49098f58beab3c149f",
"usage_rev": "2847cdb94e238a921c600e81b52c91baf4ea0b50",
"vector_math_rev": "43f2a77bb0be812b027a68a11792d563713b42a1",
"watcher_rev": "1bd2f20d0d924c8422aa2b9afdb165bff4f053c0",
"web_rev": "9d8c802d13b785b1a5b201c4a43605d640841c98",
"web_socket_channel_rev": "ced3a37193f89d5ee95792f342eeb15d3d55d8c1",
"webdev_rev": "7d0d2d46bf4249e73298ddafa4f323f8609d08da",
"web_socket_channel_rev": "b612fc2caa9f4c3c8947b4ffbb274bce33c54a04",
"webdev_rev": "3a10b76f3937fb9b50e7971fb15f82b65dfe05ef",
"webdriver_rev": "c80e01e6ce121e55c31e33a31e5d3950023e6bc9",
"webkit_inspection_protocol_rev": "153fea4fe5ac45bebf0c2e76bb3d76b0f1fcdaae",
"yaml_rev": "5a1c4be2437bc4122ccf08a3a0f06a7683e62f30",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,21 @@ class ConvertToSwitchExpression extends ResolvedCorrectionProducer {
return deletion;
}

/// Adds [level] indents to each line.
String indentRight(String text, {int level = 1}) {
var buffer = StringBuffer();
var indent = utils.oneIndent * level;
var eol = utils.endOfLine;
var lines = text.split(eol);
for (var line in lines) {
if (buffer.isNotEmpty) {
buffer.write(eol);
}
buffer.write('$indent$line');
}
return buffer.toString();
}

bool isEffectivelyExhaustive(SwitchStatement node, DartType? expressionType) {
if (expressionType == null) return false;
if ((typeSystem as TypeSystemImpl).isAlwaysExhaustive(expressionType)) {
Expand Down Expand Up @@ -420,7 +435,7 @@ class ConvertToSwitchExpression extends ResolvedCorrectionProducer {

switch (indentation) {
case _IndentationFullFirstRightAll():
var indentedText = utils.indentRight(
var indentedText = indentRight(
nextLinePrefix + text,
level: indentation.level,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import 'package:analysis_server/src/services/correction/dart/abstract_producer.dart';
import 'package:analysis_server/src/services/correction/fix.dart';
import 'package:analysis_server/src/services/correction/util.dart';
import 'package:analysis_server/src/utilities/extensions/ast.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/token.dart';
import 'package:analyzer/dart/ast/visitor.dart';
Expand Down Expand Up @@ -139,7 +139,7 @@ class _ExpressionEncoder {
final Map<Element, int> _elementIds = {};

String encode(Expression node) {
var tokens = TokenUtils.getNodeTokens(node);
var tokens = node.tokens;

var tokenToElementMap = Map<Token, Element>.identity();
node.accept(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,33 @@ class RemoveComparison extends ResolvedCorrectionProducer {
}
}

/// Splits [text] into lines, and removes one level of indent from each line.
///
/// Lines that don't start with indentation are left as is.
String indentLeft(String text) {
var buffer = StringBuffer();
var indent = utils.oneIndent;
var eol = utils.endOfLine;
var lines = text.split(eol);
for (var line in lines) {
if (buffer.isNotEmpty) {
buffer.write(eol);
}
String updatedLine;
if (line.startsWith(indent)) {
updatedLine = line.substring(indent.length);
} else {
updatedLine = line;
}
buffer.write(updatedLine);
}
return buffer.toString();
}

Future<void> _ifElement(IfElement node, ChangeBuilder builder) async {
Future<void> replaceWithElement(CollectionElement element) async {
var text = _textWithLeadingComments(element);
var unIndented = utils.indentLeft(text);
var unIndented = indentLeft(text);
await builder.addDartFileEdit(file, (builder) {
builder.addSimpleReplacement(range.node(node), unIndented);
});
Expand Down Expand Up @@ -123,7 +146,7 @@ class RemoveComparison extends ResolvedCorrectionProducer {
),
),
);
var unIndented = utils.indentLeft(text);
var unIndented = indentLeft(text);
await builder.addDartFileEdit(file, (builder) {
builder.addSimpleReplacement(
utils.getLinesRangeStatements([node]),
Expand All @@ -134,7 +157,7 @@ class RemoveComparison extends ResolvedCorrectionProducer {

Future<void> replaceWithStatement(Statement replacement) async {
var text = _textWithLeadingComments(replacement);
var unIndented = utils.indentLeft(text);
var unIndented = indentLeft(text);
await builder.addDartFileEdit(file, (builder) {
builder.addSimpleReplacement(range.node(node), unIndented);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
# issue created for it.
#
# Stats:
# - 18 "needsEvaluation"
# - 362 "needsFix"
# - 366 "hasFix"
# - 490 "noFix"
# - 40 "needsEvaluation"
# - 387 "needsFix"
# - 370 "hasFix"
# - 509 "noFix"

AnalysisOptionsErrorCode.INCLUDED_FILE_PARSE_ERROR:
status: noFix
Expand Down Expand Up @@ -434,6 +434,8 @@ CompileTimeErrorCode.CONST_EVAL_TYPE_INT:
status: noFix
CompileTimeErrorCode.CONST_EVAL_TYPE_NUM:
status: noFix
CompileTimeErrorCode.CONST_EVAL_TYPE_NUM_STRING:
status: noFix
CompileTimeErrorCode.CONST_EVAL_TYPE_STRING:
status: noFix
CompileTimeErrorCode.CONST_EVAL_TYPE_TYPE:
Expand Down
Loading

0 comments on commit a46161e

Please sign in to comment.