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

Commit 3061b1d

Browse files
author
Dart CI
committed
Version 2.16.0-154.0.dev
Merge commit '2f222990dcda6081059e1d31870f24ebd3409066' into 'dev'
2 parents b364e48 + 2f22299 commit 3061b1d

File tree

141 files changed

+4080
-1913
lines changed

Some content is hidden

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

141 files changed

+4080
-1913
lines changed

.dart_tool/package_config.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"constraint, update this by running tools/generate_package_config.dart."
1212
],
1313
"configVersion": 2,
14-
"generated": "2021-12-10T17:31:54.553345",
14+
"generated": "2021-12-22T16:24:00.538300",
1515
"generator": "tools/generate_package_config.dart",
1616
"packages": [
1717
{
@@ -629,7 +629,7 @@
629629
"name": "source_span",
630630
"rootUri": "../third_party/pkg/source_span",
631631
"packageUri": "lib/",
632-
"languageVersion": "2.12"
632+
"languageVersion": "2.14"
633633
},
634634
{
635635
"name": "sourcemap_testing",
@@ -817,4 +817,4 @@
817817
"languageVersion": "2.12"
818818
}
819819
]
820-
}
820+
}

DEPS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ vars = {
118118
"http_io_rev": "2fa188caf7937e313026557713f7feffedd4978b",
119119
"http_multi_server_rev": "de1b312164c24a1690b46c6e97bd47eff40c4649",
120120
"http_parser_rev": "202391286ddc13c4c3c284ac5b511f04697250ed",
121-
"http_rev": "f35d1e1467092f6a5edb2abf7071c4a99e8c737a",
121+
"http_rev": "1e42ffa181b263f7790f276a5465832bff7ce615",
122122
"icu_rev" : "81d656878ec611cb0b42d52c82e9dae93920d9ba",
123123
"intl_tag": "0.17.0-nullsafety",
124124
"jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
@@ -152,7 +152,7 @@ vars = {
152152
"source_map_stack_trace_rev": "1c3026f69d9771acf2f8c176a1ab750463309cce",
153153
"source_maps-0.9.4_rev": "38524",
154154
"source_maps_rev": "6499ee3adac8d469e2953e2e8ba4bdb4c2fbef90",
155-
"source_span_rev": "1be3c44045a06dff840d2ed3a13e6082d7a03a23",
155+
"source_span_rev": "dc189b455d823e2919667f6c5dcb41ab7483bce0",
156156
"sse_rev": "9084339389eb441d0c0518cddac211a097e78657",
157157
"stack_trace_rev": "5220580872625ddee41e9ca9a5f3364789b2f0f6",
158158
"stream_channel_rev": "3fa3e40c75c210d617b8b943b9b8f580e9866a89",

pkg/_fe_analyzer_shared/lib/src/macros/executor.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
import 'api.dart';
66

7+
/// Exposes a platform specific [MacroExecutor], through a top level
8+
/// `Future<MacroExecutor> start()` function.
9+
///
10+
/// TODO: conditionally load isolate_mirrors_executor.dart once conditional
11+
/// imports of mirrors are supported in AOT (issue #48057).
12+
import 'fake_executor/fake_executor.dart' as executor_impl show start;
13+
714
/// The interface used by Dart language implementations, in order to load
815
/// and execute macros, as well as produce library augmentations from those
916
/// macro applications.
@@ -12,6 +19,11 @@ import 'api.dart';
1219
/// during macro discovery and expansion, and unifies how augmentation libraries
1320
/// are produced.
1421
abstract class MacroExecutor {
22+
/// Returns a platform specific [MacroExecutor]. On unsupported platforms this
23+
/// will be a fake executor object, which will throw an [UnsupportedError] if
24+
/// used.
25+
static Future<MacroExecutor> start() => executor_impl.start();
26+
1527
/// Invoked when an implementation discovers a new macro definition in a
1628
/// [library] with [name], and prepares this executor to run the macro.
1729
///
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import '../executor.dart';
6+
7+
/// The only public api exposed by this library, returns a [_FakeMacroExecutor].
8+
Future<MacroExecutor> start() async => new _FakeMacroExecutor();
9+
10+
/// A [MacroExecutor] implementation which throws an [UnsupportedError] in all
11+
/// methods.
12+
class _FakeMacroExecutor implements MacroExecutor {
13+
@override
14+
dynamic noSuchMethod(Invocation invocation) {
15+
throw new UnsupportedError(
16+
'Macro expansion is not supported on this platform.');
17+
}
18+
}

pkg/_fe_analyzer_shared/lib/src/macros/isolate_mirrors_executor/isolate_mirrors_executor.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ import 'protocol.dart';
1111
import '../executor.dart';
1212
import '../api.dart';
1313

14+
/// Returns an instance of [_IsolateMirrorMacroExecutor].
15+
///
16+
/// This is the only public api exposed by this library.
17+
Future<MacroExecutor> start() => _IsolateMirrorMacroExecutor.start();
18+
1419
/// A [MacroExecutor] implementation which relies on [IsolateMirror.loadUri]
1520
/// in order to load macros libraries.
1621
///
1722
/// All actual work happens in a separate [Isolate], and this class serves as
1823
/// a bridge between that isolate and the language frontends.
19-
class IsolateMirrorMacroExecutor implements MacroExecutor {
24+
class _IsolateMirrorMacroExecutor implements MacroExecutor {
2025
/// The actual isolate doing macro loading and execution.
2126
final Isolate _macroIsolate;
2227

@@ -33,7 +38,7 @@ class IsolateMirrorMacroExecutor implements MacroExecutor {
3338
/// to perform any necessary cleanup.
3439
final void Function() _onClose;
3540

36-
IsolateMirrorMacroExecutor._(
41+
_IsolateMirrorMacroExecutor._(
3742
this._macroIsolate, this._sendPort, this._responseStream, this._onClose) {
3843
_responseStream.listen((event) {
3944
Completer<GenericResponse>? completer =
@@ -63,7 +68,7 @@ class IsolateMirrorMacroExecutor implements MacroExecutor {
6368
}).onDone(responseStreamController.close);
6469
Isolate macroIsolate = await Isolate.spawn(spawn, receivePort.sendPort);
6570

66-
return new IsolateMirrorMacroExecutor._(
71+
return new _IsolateMirrorMacroExecutor._(
6772
macroIsolate,
6873
await sendPortCompleter.future,
6974
responseStreamController.stream,

0 commit comments

Comments
 (0)