Version 2.16.0-53.0.dev
Merge commit '4f6d813c3c626e40fe01b4bf24cc9a8fdd9c8c3f' into 'dev'
diff --git a/pkg/compiler/tool/modular_test_suite.dart b/pkg/compiler/tool/modular_test_suite.dart
index fa6b531..9257730 100644
--- a/pkg/compiler/tool/modular_test_suite.dart
+++ b/pkg/compiler/tool/modular_test_suite.dart
@@ -267,10 +267,9 @@
@override
List<DataId> get moduleDataNeeded => const [];
- // TODO(joshualitt): we need a --no-summary argument to cfe.
@override
List<String> get stepArguments =>
- ['--target', 'dart2js', '--no-summary-only'];
+ ['--target', 'dart2js', '--no-summary', '--no-summary-only'];
@override
DataId get inputData => dillSummaryId;
diff --git a/pkg/front_end/lib/src/api_unstable/bazel_worker.dart b/pkg/front_end/lib/src/api_unstable/bazel_worker.dart
index 7d167c4..217bb40 100644
--- a/pkg/front_end/lib/src/api_unstable/bazel_worker.dart
+++ b/pkg/front_end/lib/src/api_unstable/bazel_worker.dart
@@ -137,8 +137,9 @@
Future<CompilerResult> _compile(InitializedCompilerState compilerState,
List<Uri> inputs, DiagnosticMessageHandler diagnosticMessageHandler,
- {bool? summaryOnly, bool includeOffsets: true}) {
- summaryOnly ??= true;
+ {bool? buildSummary, bool? buildComponent, bool includeOffsets: true}) {
+ buildSummary ??= true;
+ buildComponent ??= true;
CompilerOptions options = compilerState.options;
options..onDiagnostic = diagnosticMessageHandler;
@@ -147,8 +148,8 @@
processedOpts.inputs.addAll(inputs);
return generateKernel(processedOpts,
- buildSummary: summaryOnly,
- buildComponent: !summaryOnly,
+ buildSummary: buildSummary,
+ buildComponent: buildComponent,
includeOffsets: includeOffsets);
}
@@ -157,15 +158,18 @@
{bool includeOffsets: false}) async {
CompilerResult result = await _compile(
compilerState, inputs, diagnosticMessageHandler,
- summaryOnly: true, includeOffsets: includeOffsets);
+ buildSummary: true,
+ buildComponent: false,
+ includeOffsets: includeOffsets);
return result.summary;
}
Future<Component?> compileComponent(InitializedCompilerState compilerState,
- List<Uri> inputs, DiagnosticMessageHandler diagnosticMessageHandler) async {
+ List<Uri> inputs, DiagnosticMessageHandler diagnosticMessageHandler,
+ {bool buildSummary: true}) async {
CompilerResult result = await _compile(
compilerState, inputs, diagnosticMessageHandler,
- summaryOnly: false);
+ buildSummary: buildSummary, buildComponent: true);
Component? component = result.component;
if (component != null) {
diff --git a/pkg/frontend_server/lib/compute_kernel.dart b/pkg/frontend_server/lib/compute_kernel.dart
index 9c08de2..ed3ba71 100644
--- a/pkg/frontend_server/lib/compute_kernel.dart
+++ b/pkg/frontend_server/lib/compute_kernel.dart
@@ -57,6 +57,10 @@
defaultsTo: true,
negatable: true,
help: 'Whether to only build summary files.')
+ ..addFlag('summary',
+ defaultsTo: true,
+ negatable: true,
+ help: 'Whether or not to build summary files.')
..addOption('target',
allowed: const [
'vm',
@@ -138,6 +142,10 @@
? fe.NnbdMode.Strong
: fe.NnbdMode.Weak;
var summaryOnly = parsedArgs['summary-only'] as bool;
+ var summary = parsedArgs['summary'] as bool;
+ if (summaryOnly && !summary) {
+ throw new ArgumentError('--summary-only conflicts with --no-summary');
+ }
var trackWidgetCreation = parsedArgs['track-widget-creation'] as bool;
// TODO(sigmund,jakemac): make target mandatory. We allow null to be backwards
@@ -324,8 +332,8 @@
kernel = await fe.compileSummary(state, sources, onDiagnostic,
includeOffsets: false);
} else {
- Component component =
- await fe.compileComponent(state, sources, onDiagnostic);
+ Component component = await fe
+ .compileComponent(state, sources, onDiagnostic, buildSummary: summary);
kernel = fe.serializeComponent(component,
filter: excludeNonSources
? (library) => sources.contains(library.importUri)
diff --git a/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart b/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart
index 73637d7..6b133cb 100644
--- a/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart
+++ b/sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart
@@ -2905,7 +2905,7 @@
* The [radix] argument must be an integer in the range 2 to 36.
*/
String toRadixString(int radix) {
- if (radix > 36) throw RangeError.range(radix, 2, 36);
+ if (radix < 2 || radix > 36) throw RangeError.range(radix, 2, 36);
if (_used == 0) return "0";
diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
index 57cdac3..6d4d129 100644
--- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
@@ -2816,7 +2816,7 @@
///
/// The [radix] argument must be an integer in the range 2 to 36.
String toRadixString(int radix) {
- if (radix > 36) throw new RangeError.range(radix, 2, 36);
+ if (radix < 2 || radix > 36) throw RangeError.range(radix, 2, 36);
if (_used == 0) return "0";
diff --git a/sdk/lib/_internal/vm/lib/bigint_patch.dart b/sdk/lib/_internal/vm/lib/bigint_patch.dart
index f040c45..9ab2e2f 100644
--- a/sdk/lib/_internal/vm/lib/bigint_patch.dart
+++ b/sdk/lib/_internal/vm/lib/bigint_patch.dart
@@ -2493,7 +2493,7 @@
* The [radix] argument must be an integer in the range 2 to 36.
*/
String toRadixString(int radix) {
- if (radix > 36) throw new RangeError.range(radix, 2, 36);
+ if (radix < 2 || radix > 36) throw new RangeError.range(radix, 2, 36);
if (_used == 0) return "0";
diff --git a/tests/corelib/bigint_test.dart b/tests/corelib/bigint_test.dart
index 93b6c16..39b8cdd 100644
--- a/tests/corelib/bigint_test.dart
+++ b/tests/corelib/bigint_test.dart
@@ -228,8 +228,10 @@
var m = BigInt.parse(
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",
radix: 16);
- var r = BigInt.parse("95929095851002583825372225918533539673793386278"
- "360575987103577151530201707061", radix: 10);
+ var r = BigInt.parse(
+ "95929095851002583825372225918533539673793386278"
+ "360575987103577151530201707061",
+ radix: 10);
test(x, m, r);
}
@@ -830,18 +832,10 @@
}
}
- var illegalRadices = [-1, 0, 1, 37];
- for (var radix in illegalRadices) {
- try {
- new BigInt.from(42).toRadixString(radix);
- Expect.fail("Exception expected");
- } on ArgumentError catch (e) {
- // Nothing to do.
- }
- }
-
// Try large numbers (regression test for issue 15316).
var bignums = [
+ BigInt.parse("0x8"),
+ BigInt.parse("0x80"),
BigInt.parse("0x80000000"),
BigInt.parse("0x100000000"),
BigInt.parse("0x10000000000000"),
@@ -871,6 +865,18 @@
bignum, result, "${bignum.toRadixString(16)} -> $digits/$radix");
}
}
+
+ const illegalRadices = [-2, -1, 0, 1, 37];
+ for (final bignum in bignums) {
+ for (final radix in illegalRadices) {
+ try {
+ bignum.toRadixString(radix);
+ Expect.fail("Exception expected for .toRadixString($radix)");
+ } on ArgumentError catch (e) {
+ // Nothing to do.
+ }
+ }
+ }
}
testToString() {
diff --git a/tests/corelib_2/bigint_test.dart b/tests/corelib_2/bigint_test.dart
index 053ddea..24b7ebd 100644
--- a/tests/corelib_2/bigint_test.dart
+++ b/tests/corelib_2/bigint_test.dart
@@ -230,8 +230,10 @@
var m = BigInt.parse(
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",
radix: 16);
- var r = BigInt.parse("95929095851002583825372225918533539673793386278"
- "360575987103577151530201707061", radix: 10);
+ var r = BigInt.parse(
+ "95929095851002583825372225918533539673793386278"
+ "360575987103577151530201707061",
+ radix: 10);
test(x, m, r);
}
@@ -832,18 +834,10 @@
}
}
- var illegalRadices = [-1, 0, 1, 37];
- for (var radix in illegalRadices) {
- try {
- new BigInt.from(42).toRadixString(radix);
- Expect.fail("Exception expected");
- } on ArgumentError catch (e) {
- // Nothing to do.
- }
- }
-
// Try large numbers (regression test for issue 15316).
var bignums = [
+ BigInt.parse("0x8"),
+ BigInt.parse("0x80"),
BigInt.parse("0x80000000"),
BigInt.parse("0x100000000"),
BigInt.parse("0x10000000000000"),
@@ -873,6 +867,18 @@
bignum, result, "${bignum.toRadixString(16)} -> $digits/$radix");
}
}
+
+ const illegalRadices = [-2, -1, 0, 1, 37];
+ for (final bignum in bignums) {
+ for (final radix in illegalRadices) {
+ try {
+ bignum.toRadixString(radix);
+ Expect.fail("Exception expected for .toRadixString($radix)");
+ } on ArgumentError catch (e) {
+ // Nothing to do.
+ }
+ }
+ }
}
testToString() {
diff --git a/tools/VERSION b/tools/VERSION
index 5fade91..bab89d6 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 16
PATCH 0
-PRERELEASE 52
+PRERELEASE 53
PRERELEASE_PATCH 0
\ No newline at end of file