Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit c119194

Browse files
author
Dart CI
committed
Version 2.14.0-112.0.dev
Merge commit '2f85591b67d12f8bbbaa5ad86ceefadc4c150371' into 'dev'
2 parents 171876a + 2f85591 commit c119194

File tree

154 files changed

+1260
-6147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+1260
-6147
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Updated the Linter to `1.4.0`, which includes:
132132
}
133133
```
134134
135-
## 2.13.0
135+
## 2.13.0 - 2021-05-18
136136
137137
### Language
138138

DEPS

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -710,20 +710,4 @@ hooks = [
710710
'action': ['python3', 'sdk/build/vs_toolchain.py', 'update'],
711711
'condition': 'checkout_win'
712712
},
713-
{
714-
"name": "7zip",
715-
"pattern": ".",
716-
"action": [
717-
"download_from_google_storage",
718-
"--no_auth",
719-
"--no_resume",
720-
"--bucket",
721-
"dart-dependencies",
722-
"--platform=win32",
723-
"--extract",
724-
"-s",
725-
Var('dart_root') + "/third_party/7zip.tar.gz.sha1",
726-
],
727-
'condition': 'checkout_win'
728-
},
729713
]

pkg/analyzer/lib/src/dart/analysis/experiments.g.dart

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ final _knownFeatures = <String, ExperimentalFeature>{
2525
ExperimentalFeatures.nonfunction_type_aliases,
2626
EnableString.set_literals: ExperimentalFeatures.set_literals,
2727
EnableString.spread_collections: ExperimentalFeatures.spread_collections,
28+
EnableString.test_experiment: ExperimentalFeatures.test_experiment,
2829
EnableString.triple_shift: ExperimentalFeatures.triple_shift,
2930
EnableString.value_class: ExperimentalFeatures.value_class,
3031
EnableString.variance: ExperimentalFeatures.variance,
@@ -66,6 +67,9 @@ class EnableString {
6667
/// String to enable the experiment "spread-collections"
6768
static const String spread_collections = 'spread-collections';
6869

70+
/// String to enable the experiment "test-experiment"
71+
static const String test_experiment = 'test-experiment';
72+
6973
/// String to enable the experiment "triple-shift"
7074
static const String triple_shift = 'triple-shift';
7175

@@ -190,8 +194,19 @@ class ExperimentalFeatures {
190194
releaseVersion: Version.parse('2.0.0'),
191195
);
192196

193-
static final triple_shift = ExperimentalFeature(
197+
static final test_experiment = ExperimentalFeature(
194198
index: 11,
199+
enableString: EnableString.test_experiment,
200+
isEnabledByDefault: IsEnabledByDefault.test_experiment,
201+
isExpired: IsExpired.test_experiment,
202+
documentation:
203+
'Has no effect. Can be used for testing the --enable-experiment command line functionality.',
204+
experimentalReleaseVersion: null,
205+
releaseVersion: null,
206+
);
207+
208+
static final triple_shift = ExperimentalFeature(
209+
index: 12,
195210
enableString: EnableString.triple_shift,
196211
isEnabledByDefault: IsEnabledByDefault.triple_shift,
197212
isExpired: IsExpired.triple_shift,
@@ -201,7 +216,7 @@ class ExperimentalFeatures {
201216
);
202217

203218
static final value_class = ExperimentalFeature(
204-
index: 12,
219+
index: 13,
205220
enableString: EnableString.value_class,
206221
isEnabledByDefault: IsEnabledByDefault.value_class,
207222
isExpired: IsExpired.value_class,
@@ -211,7 +226,7 @@ class ExperimentalFeatures {
211226
);
212227

213228
static final variance = ExperimentalFeature(
214-
index: 13,
229+
index: 14,
215230
enableString: EnableString.variance,
216231
isEnabledByDefault: IsEnabledByDefault.variance,
217232
isExpired: IsExpired.variance,
@@ -257,6 +272,9 @@ class IsEnabledByDefault {
257272
/// Default state of the experiment "spread-collections"
258273
static const bool spread_collections = true;
259274

275+
/// Default state of the experiment "test-experiment"
276+
static const bool test_experiment = false;
277+
260278
/// Default state of the experiment "triple-shift"
261279
static const bool triple_shift = true;
262280

@@ -304,6 +322,9 @@ class IsExpired {
304322
/// Expiration status of the experiment "spread-collections"
305323
static const bool spread_collections = true;
306324

325+
/// Expiration status of the experiment "test-experiment"
326+
static const bool test_experiment = false;
327+
307328
/// Expiration status of the experiment "triple-shift"
308329
static const bool triple_shift = false;
309330

@@ -354,6 +375,9 @@ mixin _CurrentState {
354375
bool get spread_collections =>
355376
isEnabled(ExperimentalFeatures.spread_collections);
356377

378+
/// Current state for the flag "test-experiment"
379+
bool get test_experiment => isEnabled(ExperimentalFeatures.test_experiment);
380+
357381
/// Current state for the flag "triple-shift"
358382
bool get triple_shift => isEnabled(ExperimentalFeatures.triple_shift);
359383

pkg/analyzer/lib/src/dart/element/element.dart

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6265,10 +6265,6 @@ class PrefixElementImpl extends _ExistingElementImpl implements PrefixElement {
62656265
PrefixElementImpl(String name, int nameOffset, {Reference? reference})
62666266
: super(name, nameOffset, reference: reference);
62676267

6268-
PrefixElementImpl.forLinkedNode(
6269-
ElementImpl enclosing, Reference reference, SimpleIdentifier linkedNode)
6270-
: super.forLinkedNode(enclosing, reference, linkedNode);
6271-
62726268
@override
62736269
String get displayName => name;
62746270

@@ -6281,20 +6277,9 @@ class PrefixElementImpl extends _ExistingElementImpl implements PrefixElement {
62816277

62826278
@override
62836279
String get name {
6284-
if (linkedNode != null) {
6285-
return reference!.name;
6286-
}
62876280
return super.name!;
62886281
}
62896282

6290-
@override
6291-
int get nameOffset {
6292-
if (linkedNode != null) {
6293-
return (linkedNode as SimpleIdentifier).offset;
6294-
}
6295-
return super.nameOffset;
6296-
}
6297-
62986283
@override
62996284
Scope get scope => _scope ??= PrefixScope(enclosingElement, this);
63006285

pkg/analyzer/lib/src/summary2/library_builder.dart

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,7 @@ class _ElementBuilder extends ThrowingAstVisitor<void> {
406406
}
407407

408408
@override
409-
void visitExportDirective(ast.ExportDirective node) {
410-
node as ast.ExportDirectiveImpl;
411-
409+
void visitExportDirective(covariant ast.ExportDirectiveImpl node) {
412410
var element = ExportElementImpl(node.keyword.offset);
413411
element.combinators = _buildCombinators(node.combinators);
414412
element.exportedLibrary = _selectLibrary(node);
@@ -420,9 +418,7 @@ class _ElementBuilder extends ThrowingAstVisitor<void> {
420418
}
421419

422420
@override
423-
void visitImportDirective(ast.ImportDirective node) {
424-
node as ast.ImportDirectiveImpl;
425-
421+
void visitImportDirective(covariant ast.ImportDirectiveImpl node) {
426422
var element = ImportElementImpl(node.keyword.offset);
427423
element.combinators = _buildCombinators(node.combinators);
428424
element.importedLibrary = _selectLibrary(node);

pkg/compiler/lib/src/commandline_options.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ class Flags {
7979
static const String noNativeNullAssertions = '--no-native-null-assertions';
8080

8181
static const String noSourceMaps = '--no-source-maps';
82+
83+
static const String omitLateNames = '--omit-late-names';
84+
static const String noOmitLateNames = '--no-omit-late-names';
85+
8286
static const String preserveUris = '--preserve-uris';
8387
static const String printLegacyStars = '--debug-print-legacy-stars';
8488
static const String showPackageWarnings = '--show-package-warnings';

pkg/compiler/lib/src/dart2js.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,8 @@ Future<api.CompilationResult> compile(List<String> argv,
512512
new OptionHandler(Flags.initializingFormalAccess, ignoreOption),
513513
new OptionHandler(Flags.minify, passThrough),
514514
new OptionHandler(Flags.noMinify, passThrough),
515+
new OptionHandler(Flags.omitLateNames, passThrough),
516+
new OptionHandler(Flags.noOmitLateNames, passThrough),
515517
new OptionHandler(Flags.preserveUris, ignoreOption),
516518
new OptionHandler(Flags.printLegacyStars, passThrough),
517519
new OptionHandler('--force-strip=.*', setStrip),
@@ -1122,6 +1124,11 @@ Supported options:
11221124
--no-source-maps
11231125
Do not generate a source map file.
11241126
1127+
--omit-late-names
1128+
Do not include names of late variables in error messages. This allows
1129+
dart2js to generate smaller code by removing late variable names from the
1130+
generated JavaScript.
1131+
11251132
-O<0,1,2,3,4>
11261133
Controls optimizations that can help reduce code-size and improve
11271134
performance of the generated code for deployment.
@@ -1149,6 +1156,7 @@ Supported options:
11491156
Equivalent to calling dart2js with these extra flags:
11501157
--minify
11511158
--lax-runtime-type-to-string
1159+
--omit-late-names
11521160
11531161
-O3
11541162
Enables optimizations that respect the language semantics only on

pkg/compiler/lib/src/ir/scope_visitor.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -983,17 +983,20 @@ class ScopeModelBuilder extends ir.Visitor<EvaluationComplexity>
983983
@override
984984
EvaluationComplexity visitConstructorInvocation(
985985
ir.ConstructorInvocation node) {
986+
ir.Constructor target = node.target;
987+
ir.Class enclosingClass = target.enclosingClass;
988+
986989
// TODO(45681): Investigate if other initializers should be made eager.
987990

988-
// Lazily invoking the `_Cell` constructor pessimizes certain uses of late
989-
// variables, so we ensure it gets called eagerly.
990-
if (node.target == _coreTypes.cellConstructor) {
991+
// Lazily constructing cells pessimizes certain uses of late variables, so
992+
// we ensure they get constructed eagerly.
993+
if (enclosingClass == _coreTypes.cellClass) {
991994
return EvaluationComplexity.eager();
992995
}
993996

994997
if (node.arguments.types.isNotEmpty) {
995998
visitNodesInContext(node.arguments.types,
996-
new VariableUse.constructorTypeArgument(node.target));
999+
new VariableUse.constructorTypeArgument(target));
9971000
}
9981001
visitArguments(node.arguments);
9991002
return node.isConst

pkg/compiler/lib/src/kernel/dart2js_target.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ class Dart2jsTarget extends Target {
7777
@override
7878
final String name;
7979

80+
final bool omitLateNames;
81+
8082
Map<String, ir.Class> _nativeClasses;
8183

82-
Dart2jsTarget(this.name, this.flags);
84+
Dart2jsTarget(this.name, this.flags, {this.omitLateNames = false});
8385

8486
@override
8587
bool get enableNoSuchMethodForwarders => true;
@@ -158,7 +160,8 @@ class Dart2jsTarget extends Target {
158160
_nativeClasses)
159161
.visitLibrary(library);
160162
}
161-
lowering.transformLibraries(libraries, coreTypes, hierarchy);
163+
lowering.transformLibraries(libraries, coreTypes, hierarchy,
164+
omitLateNames: omitLateNames);
162165
logger?.call("Lowering transformations performed");
163166
}
164167

pkg/compiler/lib/src/kernel/loader.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ class KernelLoaderTask extends CompilerTask {
136136
}
137137
} else {
138138
bool verbose = false;
139-
Target target = Dart2jsTarget(targetName, TargetFlags());
139+
Target target = Dart2jsTarget(targetName, TargetFlags(),
140+
omitLateNames: _options.omitLateNames);
140141
fe.FileSystem fileSystem = CompilerFileSystem(_compilerInput);
141142
fe.Verbosity verbosity = _options.verbosity;
142143
fe.DiagnosticMessageHandler onDiagnostic =

0 commit comments

Comments
 (0)