Version 2.10.0-38.0.dev
Merge commit '7c59511e4499ca9b485e97b4e76ffcac0f42df88' into 'dev'
diff --git a/DEPS b/DEPS
index d3ee93d..f16ed79 100644
--- a/DEPS
+++ b/DEPS
@@ -112,11 +112,11 @@
"idl_parser_rev": "5fb1ebf49d235b5a70c9f49047e83b0654031eb7",
"intl_tag": "0.16.1",
"jinja2_rev": "2222b31554f03e62600cd7e383376a7c187967a1",
- "json_rpc_2_rev": "413ee9d1d1841c23ebfd2248abc4fc950e0d6946",
+ "json_rpc_2_rev": "995611cf006c927d51cc53cb28f1aa4356d5414f",
"linter_tag": "0.1.118",
"logging_rev": "9561ba016ae607747ae69b846c0e10958ca58ed4",
"markupsafe_rev": "8f45f5cfa0009d2a70589bcda0349b8cb2b72783",
- "markdown_rev": "acaddfe74217f62498b5cf0cf5429efa6a700be3",
+ "markdown_rev": "dbeafd47759e7dd0a167602153bb9c49fb5e5fe7",
"matcher_rev": "9cae8faa7868bf3a88a7ba45eb0bd128e66ac515",
"mime_rev": "179b5e6a88f4b63f36dc1b8fcbc1e83e5e0cd3a7",
"mockito_rev": "d39ac507483b9891165e422ec98d9fb480037c8b",
diff --git a/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart b/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
index 72328fa..bb4ce51 100644
--- a/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
+++ b/pkg/analysis_server/lib/src/services/correction/bulk_fix_processor.dart
@@ -29,6 +29,7 @@
import 'package:analysis_server/src/services/correction/dart/remove_empty_else.dart';
import 'package:analysis_server/src/services/correction/dart/remove_empty_statement.dart';
import 'package:analysis_server/src/services/correction/dart/remove_initializer.dart';
+import 'package:analysis_server/src/services/correction/dart/remove_interpolation_braces.dart';
import 'package:analysis_server/src/services/correction/dart/remove_method_declaration.dart';
import 'package:analysis_server/src/services/correction/dart/remove_operator.dart';
import 'package:analysis_server/src/services/correction/dart/remove_this_expression.dart';
@@ -98,6 +99,8 @@
LintNames.slash_for_doc_comments: ConvertDocumentationIntoLine.newInstance,
LintNames.type_init_formals: RemoveTypeAnnotation.newInstance,
LintNames.unawaited_futures: AddAwait.newInstance,
+ LintNames.unnecessary_brace_in_string_interps:
+ RemoveInterpolationBraces.newInstance,
LintNames.unnecessary_const: RemoveUnnecessaryConst.newInstance,
LintNames.unnecessary_lambdas: ReplaceWithTearOff.newInstance,
LintNames.unnecessary_new: RemoveUnnecessaryNew.newInstance,
diff --git a/pkg/analysis_server/test/src/services/correction/fix/bulk/remove_interpolation_braces_test.dart b/pkg/analysis_server/test/src/services/correction/fix/bulk/remove_interpolation_braces_test.dart
new file mode 100644
index 0000000..5060050
--- /dev/null
+++ b/pkg/analysis_server/test/src/services/correction/fix/bulk/remove_interpolation_braces_test.dart
@@ -0,0 +1,35 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+import 'package:analysis_server/src/services/linter/lint_names.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
+import 'bulk_fix_processor.dart';
+
+void main() {
+ defineReflectiveSuite(() {
+ defineReflectiveTests(RemoveInterpolationBracesTest);
+ });
+}
+
+@reflectiveTest
+class RemoveInterpolationBracesTest extends BulkFixProcessorTest {
+ @override
+ String get lintCode => LintNames.unnecessary_brace_in_string_interps;
+
+ Future<void> test_singleFile() async {
+ await resolveTestUnit(r'''
+main() {
+ var v = 42;
+ print('v: ${ v}, ${ v}');
+}
+''');
+ await assertHasFix(r'''
+main() {
+ var v = 42;
+ print('v: $v, $v');
+}
+''');
+ }
+}
diff --git a/pkg/analysis_server/test/src/services/correction/fix/bulk/test_all.dart b/pkg/analysis_server/test/src/services/correction/fix/bulk/test_all.dart
index b7a2148..7f0b31c 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/bulk/test_all.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/bulk/test_all.dart
@@ -28,6 +28,7 @@
import 'remove_empty_else_test.dart' as remove_empty_else;
import 'remove_empty_statement_test.dart' as remove_empty_statement;
import 'remove_initializer_test.dart' as remove_initializer;
+import 'remove_interpolation_braces_test.dart' as remove_interpolation_braces;
import 'remove_method_declaration_test.dart' as remove_method_declaration;
import 'remove_operator_test.dart' as remove_operator;
import 'remove_this_expression_test.dart' as remove_this_expression;
@@ -67,6 +68,7 @@
remove_empty_constructor_body.main();
remove_empty_else.main();
remove_empty_statement.main();
+ remove_interpolation_braces.main();
remove_method_declaration.main();
remove_operator.main();
remove_this_expression.main();
diff --git a/pkg/analyzer/test/src/dart/resolution/assignment_test.dart b/pkg/analyzer/test/src/dart/resolution/assignment_test.dart
index 7ce888a..dffe753 100644
--- a/pkg/analyzer/test/src/dart/resolution/assignment_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/assignment_test.dart
@@ -13,11 +13,15 @@
main() {
defineReflectiveSuite(() {
defineReflectiveTests(AssignmentDriverResolutionTest);
+ defineReflectiveTests(AssignmentDriverResolutionWithNullSafetyTest);
});
}
@reflectiveTest
-class AssignmentDriverResolutionTest extends PubPackageResolutionTest {
+class AssignmentDriverResolutionTest extends PubPackageResolutionTest
+ with AssignmentDriverResolutionTestCases {}
+
+mixin AssignmentDriverResolutionTestCases on PubPackageResolutionTest {
test_compound_indexExpression() async {
await resolveTestCode(r'''
main() {
@@ -692,8 +696,9 @@
}
test_simpleIdentifier_parameter_compound_ifNull() async {
- await assertNoErrorsInCode(r'''
-void f(num x) {
+ var question = typeToStringWithNullability ? '?' : '';
+ await assertNoErrorsInCode('''
+void f(num$question x) {
x ??= 0;
}
''');
@@ -709,19 +714,21 @@
assignment.leftHandSide,
readElement: findElement.parameter('x'),
writeElement: findElement.parameter('x'),
- type: 'num',
+ type: 'num$question',
);
assertType(assignment.rightHandSide, 'int');
}
test_simpleIdentifier_parameter_compound_ifNull_notAssignableType() async {
- await assertErrorsInCode(r'''
-void f(double a, int b) {
+ var question = typeToStringWithNullability ? '?' : '';
+ var code = '''
+void f(double$question a, int b) {
a ??= b;
}
-''', [
- error(CompileTimeErrorCode.INVALID_ASSIGNMENT, 34, 1),
+''';
+ await assertErrorsInCode(code, [
+ error(CompileTimeErrorCode.INVALID_ASSIGNMENT, code.indexOf('b;'), 1),
]);
var assignment = findNode.assignment('a ??=');
@@ -735,7 +742,7 @@
assignment.leftHandSide,
readElement: findElement.parameter('a'),
writeElement: findElement.parameter('a'),
- type: 'double',
+ type: 'double$question',
);
assertSimpleIdentifier(
@@ -1471,3 +1478,8 @@
assertType(assignment.rightHandSide, 'int');
}
}
+
+@reflectiveTest
+class AssignmentDriverResolutionWithNullSafetyTest
+ extends PubPackageResolutionTest
+ with WithNullSafetyMixin, AssignmentDriverResolutionTestCases {}
diff --git a/pkg/dartdev/lib/src/commands/test.dart b/pkg/dartdev/lib/src/commands/test.dart
index cf40ee1..ef2a9a2 100644
--- a/pkg/dartdev/lib/src/commands/test.dart
+++ b/pkg/dartdev/lib/src/commands/test.dart
@@ -3,6 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
+import 'dart:io';
+import 'dart:math' as math;
import 'package:args/args.dart';
@@ -12,25 +14,16 @@
import '../vm_interop_handler.dart';
class TestCommand extends DartdevCommand<int> {
- TestCommand() : super('test', 'Runs tests in this project.');
-
- @override
- final ArgParser argParser = ArgParser.allowAnything();
+ TestCommand() : super('test', 'Runs tests in this project.') {
+ generateParser(argParser);
+ }
@override
void printUsage() {
if (!Sdk.checkArtifactExists(sdk.pub)) {
return;
}
- if ((project.packageConfig != null) &&
- !project.packageConfig.hasDependency('test')) {
- _printPackageTestInstructions();
- }
- final command = sdk.pub;
- final args = ['run', 'test', '--help'];
-
- log.trace('$command ${args.join(' ')}');
- VmInteropHandler.run(command, args);
+ super.printUsage();
}
@override
@@ -78,4 +71,307 @@
adding package:test, and https://dart.dev/guides/testing for general
information on testing.''');
}
+
+ /// This content has been copied from and kept in sync with
+ /// https://github.com/dart-lang/test, by having a copy in dartdev itself,
+ /// help is faster and more robust, see
+ /// https://github.com/dart-lang/sdk/issues/42014.
+ void generateParser(ArgParser parser) {
+ // Set in test/pkgs/test_core/lib/src/runner/configuration/values.dart:
+ final defaultConcurrency = math.max(1, Platform.numberOfProcessors ~/ 2);
+
+ /// The parser used to parse the command-line arguments.
+ var allRuntimes = Runtime.builtIn.toList()..remove(Runtime.vm);
+ if (!Platform.isMacOS) allRuntimes.remove(Runtime.safari);
+ if (!Platform.isWindows) allRuntimes.remove(Runtime.internetExplorer);
+
+// parser.addFlag('help',
+// abbr: 'h', negatable: false, help: 'Shows this usage information.');
+ parser.addFlag('version',
+ negatable: false, help: "Shows the package's version.");
+
+ // Note that defaultsTo declarations here are only for documentation
+ // purposes.
+ // We pass null instead of the default so that it merges properly with the
+ // config file.
+
+ parser.addSeparator('======== Selecting Tests');
+ parser.addMultiOption('name',
+ abbr: 'n',
+ help: 'A substring of the name of the test to run.\n'
+ 'Regular expression syntax is supported.\n'
+ 'If passed multiple times, tests must match all substrings.',
+ splitCommas: false);
+ parser.addMultiOption('plain-name',
+ abbr: 'N',
+ help: 'A plain-text substring of the name of the test to run.\n'
+ 'If passed multiple times, tests must match all substrings.',
+ splitCommas: false);
+ parser.addMultiOption('tags',
+ abbr: 't',
+ help: 'Run only tests with all of the specified tags.\n'
+ 'Supports boolean selector syntax.');
+ parser.addMultiOption('tag', hide: true);
+ parser.addMultiOption('exclude-tags',
+ abbr: 'x',
+ help: "Don't run tests with any of the specified tags.\n"
+ 'Supports boolean selector syntax.');
+ parser.addMultiOption('exclude-tag', hide: true);
+ parser.addFlag('run-skipped',
+ help: 'Run skipped tests instead of skipping them.');
+
+ parser.addSeparator('======== Running Tests');
+
+ // The UI term "platform" corresponds with the implementation term "runtime".
+ // The [Runtime] class used to be called [TestPlatform], but it was changed to
+ // avoid conflicting with [SuitePlatform]. We decided not to also change the
+ // UI to avoid a painful migration.
+ parser.addMultiOption('platform',
+ abbr: 'p',
+ help: 'The platform(s) on which to run the tests.\n'
+ '[vm (default), '
+ '${allRuntimes.map((runtime) => runtime.identifier).join(", ")}]');
+ parser.addMultiOption('preset',
+ abbr: 'P', help: 'The configuration preset(s) to use.');
+ parser.addOption('concurrency',
+ abbr: 'j',
+ help: 'The number of concurrent test suites run.',
+ defaultsTo: defaultConcurrency.toString(),
+ valueHelp: 'threads');
+ parser.addOption('total-shards',
+ help: 'The total number of invocations of the test runner being run.');
+ parser.addOption('shard-index',
+ help: 'The index of this test runner invocation (of --total-shards).');
+ parser.addOption('pub-serve',
+ help: 'The port of a pub serve instance serving "test/".',
+ valueHelp: 'port');
+ parser.addOption('timeout',
+ help: 'The default test timeout. For example: 15s, 2x, none',
+ defaultsTo: '30s');
+ parser.addFlag('pause-after-load',
+ help: 'Pauses for debugging before any tests execute.\n'
+ 'Implies --concurrency=1, --debug, and --timeout=none.\n'
+ 'Currently only supported for browser tests.',
+ negatable: false);
+ parser.addFlag('debug',
+ help: 'Runs the VM and Chrome tests in debug mode.', negatable: false);
+ parser.addOption('coverage',
+ help: 'Gathers coverage and outputs it to the specified directory.\n'
+ 'Implies --debug.',
+ valueHelp: 'directory');
+ parser.addFlag('chain-stack-traces',
+ help: 'Chained stack traces to provide greater exception details\n'
+ 'especially for asynchronous code. It may be useful to disable\n'
+ 'to provide improved test performance but at the cost of\n'
+ 'debuggability.',
+ defaultsTo: true);
+ parser.addFlag('no-retry',
+ help: "Don't re-run tests that have retry set.",
+ defaultsTo: false,
+ negatable: false);
+ parser.addOption('test-randomize-ordering-seed',
+ help: 'The seed to randomize the execution order of test cases.\n'
+ 'Must be a 32bit unsigned integer or "random".\n'
+ 'If "random", pick a random seed to use.\n'
+ 'If not passed, do not randomize test case execution order.');
+
+ var defaultReporter = 'compact';
+ var reporterDescriptions = <String, String>{
+ 'compact': 'A single line, updated continuously.',
+ 'expanded': 'A separate line for each update.',
+ 'json': 'A machine-readable format (see https://goo.gl/gBsV1a).'
+ };
+
+ parser.addSeparator('======== Output');
+ parser.addOption('reporter',
+ abbr: 'r',
+ help: 'The runner used to print test results.',
+ defaultsTo: defaultReporter,
+ allowed: reporterDescriptions.keys.toList(),
+ allowedHelp: reporterDescriptions);
+ parser.addOption('file-reporter',
+ help: 'The reporter used to write test results to a file.\n'
+ 'Should be in the form <reporter>:<filepath>, '
+ 'e.g. "json:reports/tests.json"');
+ parser.addFlag('verbose-trace',
+ negatable: false,
+ help: 'Whether to emit stack traces with core library frames.');
+ parser.addFlag('js-trace',
+ negatable: false,
+ help: 'Whether to emit raw JavaScript stack traces for browser tests.');
+ parser.addFlag('color',
+ help: 'Whether to use terminal colors.\n(auto-detected by default)');
+
+ /// The following options are used only by the internal Google test runner.
+ /// They're hidden and not supported as stable API surface outside Google.
+ parser.addOption('configuration',
+ help: 'The path to the configuration file.', hide: true);
+ parser.addOption('dart2js-path',
+ help: 'The path to the dart2js executable.', hide: true);
+ parser.addMultiOption('dart2js-args',
+ help: 'Extra arguments to pass to dart2js.', hide: true);
+
+ // If we're running test/dir/my_test.dart, we'll look for
+ // test/dir/my_test.dart.html in the precompiled directory.
+ parser.addOption('precompiled',
+ help: 'The path to a mirror of the package directory containing HTML '
+ 'that points to precompiled JS.',
+ hide: true);
+ }
+}
+
+/// An enum of all Dart runtimes supported by the test runner.
+class Runtime {
+ // When adding new runtimes, be sure to update the baseline and derived
+ // variable tests in test/backend/platform_selector/evaluate_test.
+
+ /// The command-line Dart VM.
+ static const Runtime vm = Runtime('VM', 'vm', isDartVM: true);
+
+ /// Google Chrome.
+ static const Runtime chrome =
+ Runtime('Chrome', 'chrome', isBrowser: true, isJS: true, isBlink: true);
+
+ /// PhantomJS.
+ static const Runtime phantomJS = Runtime('PhantomJS', 'phantomjs',
+ isBrowser: true, isJS: true, isBlink: true, isHeadless: true);
+
+ /// Mozilla Firefox.
+ static const Runtime firefox =
+ Runtime('Firefox', 'firefox', isBrowser: true, isJS: true);
+
+ /// Apple Safari.
+ static const Runtime safari =
+ Runtime('Safari', 'safari', isBrowser: true, isJS: true);
+
+ /// Microsoft Internet Explorer.
+ static const Runtime internetExplorer =
+ Runtime('Internet Explorer', 'ie', isBrowser: true, isJS: true);
+
+ /// The command-line Node.js VM.
+ static const Runtime nodeJS = Runtime('Node.js', 'node', isJS: true);
+
+ /// The platforms that are supported by the test runner by default.
+ static const List<Runtime> builtIn = [
+ Runtime.vm,
+ Runtime.chrome,
+ Runtime.phantomJS,
+ Runtime.firefox,
+ Runtime.safari,
+ Runtime.internetExplorer,
+ Runtime.nodeJS
+ ];
+
+ /// The human-friendly name of the platform.
+ final String name;
+
+ /// The identifier used to look up the platform.
+ final String identifier;
+
+ /// The parent platform that this is based on, or `null` if there is no
+ /// parent.
+ final Runtime parent;
+
+ /// Returns whether this is a child of another platform.
+ bool get isChild => parent != null;
+
+ /// Whether this platform runs the Dart VM in any capacity.
+ final bool isDartVM;
+
+ /// Whether this platform is a browser.
+ final bool isBrowser;
+
+ /// Whether this platform runs Dart compiled to JavaScript.
+ final bool isJS;
+
+ /// Whether this platform uses the Blink rendering engine.
+ final bool isBlink;
+
+ /// Whether this platform has no visible window.
+ final bool isHeadless;
+
+ /// Returns the platform this is based on, or [this] if it's not based on
+ /// anything.
+ ///
+ /// That is, returns [parent] if it's non-`null` or [this] if it's `null`.
+ Runtime get root => parent ?? this;
+
+ const Runtime(this.name, this.identifier,
+ {this.isDartVM = false,
+ this.isBrowser = false,
+ this.isJS = false,
+ this.isBlink = false,
+ this.isHeadless = false})
+ : parent = null;
+
+ Runtime._child(this.name, this.identifier, Runtime parent)
+ : isDartVM = parent.isDartVM,
+ isBrowser = parent.isBrowser,
+ isJS = parent.isJS,
+ isBlink = parent.isBlink,
+ isHeadless = parent.isHeadless,
+ parent = parent;
+
+ /// Converts a JSON-safe representation generated by [serialize] back into a
+ /// [Runtime].
+ factory Runtime.deserialize(Object serialized) {
+ if (serialized is String) {
+ return builtIn
+ .firstWhere((platform) => platform.identifier == serialized);
+ }
+
+ var map = serialized as Map;
+ var parent = map['parent'];
+ if (parent != null) {
+ // Note that the returned platform's [parent] won't necessarily be `==` to
+ // a separately-deserialized parent platform. This should be fine, though,
+ // since we only deserialize platforms in the remote execution context
+ // where they're only used to evaluate platform selectors.
+ return Runtime._child(map['name'] as String, map['identifier'] as String,
+ Runtime.deserialize(parent as Object));
+ }
+
+ return Runtime(map['name'] as String, map['identifier'] as String,
+ isDartVM: map['isDartVM'] as bool,
+ isBrowser: map['isBrowser'] as bool,
+ isJS: map['isJS'] as bool,
+ isBlink: map['isBlink'] as bool,
+ isHeadless: map['isHeadless'] as bool);
+ }
+
+ /// Converts [this] into a JSON-safe object that can be converted back to a
+ /// [Runtime] using [Runtime.deserialize].
+ Object serialize() {
+ if (builtIn.contains(this)) return identifier;
+
+ if (parent != null) {
+ return {
+ 'name': name,
+ 'identifier': identifier,
+ 'parent': parent.serialize()
+ };
+ }
+
+ return {
+ 'name': name,
+ 'identifier': identifier,
+ 'isDartVM': isDartVM,
+ 'isBrowser': isBrowser,
+ 'isJS': isJS,
+ 'isBlink': isBlink,
+ 'isHeadless': isHeadless
+ };
+ }
+
+ /// Returns a child of [this] that counts as both this platform's identifier
+ /// and the new [identifier].
+ ///
+ /// This may not be called on a platform that's already a child.
+ Runtime extend(String name, String identifier) {
+ if (parent == null) return Runtime._child(name, identifier, this);
+ throw StateError('A child platform may not be extended.');
+ }
+
+ @override
+ String toString() => name;
}
diff --git a/pkg/dartdev/test/commands/test_test.dart b/pkg/dartdev/test/commands/test_test.dart
index a3b5265..9dbb186 100644
--- a/pkg/dartdev/test/commands/test_test.dart
+++ b/pkg/dartdev/test/commands/test_test.dart
@@ -17,16 +17,13 @@
test('--help', () {
p = project();
-
- var result = p.runSync('pub', ['get', '--offline']);
+ var result = p.runSync('test', ['--help']);
expect(result.exitCode, 0);
-
- result = p.runSync('test', ['--help']);
-
- expect(result.exitCode, 0);
- expect(result.stdout, contains('Runs tests in this package'));
expect(result.stderr, isEmpty);
- }, skip: 'https://github.com/dart-lang/sdk/issues/40854');
+ expect(result.stdout, contains('Runs tests in this project.'));
+ expect(result.stdout, contains('Usage: dart test [arguments]'));
+ expect(result.stdout, contains('======== Selecting Tests'));
+ });
test('no dependency', () {
p = project(mainSrc: 'int get foo => 1;\n');
diff --git a/runtime/tests/vm/dart/regress_flutter63819_test.dart b/runtime/tests/vm/dart/regress_flutter63819_test.dart
new file mode 100644
index 0000000..56d2412
--- /dev/null
+++ b/runtime/tests/vm/dart/regress_flutter63819_test.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Verify that 'is' test of a nullable type accepts null.
+// Regression test for https://github.com/flutter/flutter/issues/63819.
+
+import 'package:expect/expect.dart';
+
+abstract class A {}
+
+class B extends A {}
+
+class C extends A {}
+
+@pragma('vm:never-inline')
+bool foo(A? x) {
+ if (x is C?) {
+ print('$x is C?');
+ return true;
+ }
+ print('$x is not C?');
+ return false;
+}
+
+void main() {
+ B();
+ C();
+ Expect.isFalse(foo(B()));
+ Expect.isTrue(foo(null));
+}
diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc
index d066f11..5f51a5b 100644
--- a/runtime/vm/compiler/backend/il.cc
+++ b/runtime/vm/compiler/backend/il.cc
@@ -453,6 +453,12 @@
intptr_t* lower_limit,
intptr_t* upper_limit) {
ASSERT(CompilerState::Current().is_aot());
+ if (type.IsNullable()) {
+ // 'is' test for nullable types should accept null cid in addition to the
+ // class range. In most cases it is not possible to extend class range to
+ // include kNullCid.
+ return false;
+ }
if (CanUseSubtypeRangeCheckFor(type)) {
const Class& type_class =
Class::Handle(thread()->zone(), type.type_class());
diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc
index 0d7ffce..a17e9c6 100644
--- a/runtime/vm/runtime_entry.cc
+++ b/runtime/vm/runtime_entry.cc
@@ -1161,8 +1161,10 @@
demangled = &String::Handle(
Function::DemangleDynamicInvocationForwarderName(target_name));
}
+ const bool is_getter = Field::IsGetterName(*demangled);
Function& result = Function::Handle();
- if (!ResolveCallThroughGetter(receiver_class, target_name, *demangled,
+ if (is_getter ||
+ !ResolveCallThroughGetter(receiver_class, target_name, *demangled,
args_descriptor, &result)) {
ArgumentsDescriptor desc(args_descriptor);
const Function& target_function =
diff --git a/sdk/lib/io/socket.dart b/sdk/lib/io/socket.dart
index 10b1918..4cdd14f 100644
--- a/sdk/lib/io/socket.dart
+++ b/sdk/lib/io/socket.dart
@@ -801,12 +801,10 @@
{sourceAddress, Duration? timeout}) {
final IOOverrides? overrides = IOOverrides.current;
if (overrides == null) {
- // TODO(b/162514236): This breaks internal device lab tests for Fuchsia.
- //
- // if (!isInsecureConnectionAllowed(host)) {
- // throw new SocketException(
- // "Insecure socket connections are disallowed by platform: $host");
- // }
+ if (!isInsecureConnectionAllowed(host)) {
+ throw new SocketException(
+ "Insecure socket connections are disallowed by platform: $host");
+ }
return Socket._connect(host, port,
sourceAddress: sourceAddress, timeout: timeout);
}
@@ -821,12 +819,10 @@
{sourceAddress}) {
final IOOverrides? overrides = IOOverrides.current;
if (overrides == null) {
- // TODO(b/162514236): This breaks internal device lab tests for Fuchsia.
- //
- // if (!isInsecureConnectionAllowed(host)) {
- // throw new SocketException(
- // "Insecure socket connections are disallowed by platform: $host");
- // }
+ if (!isInsecureConnectionAllowed(host)) {
+ throw new SocketException(
+ "Insecure socket connections are disallowed by platform: $host");
+ }
return Socket._startConnect(host, port, sourceAddress: sourceAddress);
}
return overrides.socketStartConnect(host, port,
diff --git a/tests/standalone/io/network_policy_configuration_test.dart b/tests/standalone/io/network_policy_configuration_test.dart
index 6ee1bf0..49e6c56 100644
--- a/tests/standalone/io/network_policy_configuration_test.dart
+++ b/tests/standalone/io/network_policy_configuration_test.dart
@@ -24,9 +24,17 @@
void main() {
// These have no policy but the default is false.
- _checkDenies(["mailfoobar.com", "abc.com", "oobar.com", "foobar.co"]);
+ _checkDenies([
+ "mailfoobar.com",
+ "abc.com",
+ "oobar.com",
+ "foobar.co",
+ "128.221.55.31",
+ "fe80::4607:0bff:fea0:7747%invalid",
+ ]);
// These are explicitly denied.
_checkDenies(["baz.foobar.com"]);
_checkAllows(
["foobar.com", "test.baz.foobar.com", "test2.test.baz.foobar.com"]);
+ _checkAllows(["::1", "localhost"]);
}
diff --git a/tests/standalone/standalone_kernel.status b/tests/standalone/standalone_kernel.status
index a45b3d0..5eca181 100644
--- a/tests/standalone/standalone_kernel.status
+++ b/tests/standalone/standalone_kernel.status
@@ -7,8 +7,6 @@
fragmentation_test: Pass, Slow # GC heavy
fragmentation_typed_data_test: Pass, Slow # GC heavy
io/process_sync_test: Pass, Slow # Spawns synchronously subprocesses in sequence.
-io/socket_network_policy_test: Skip # Temporarily disabled.
-io/socket_network_policy_localhost_test: Skip # Temporarily disabled.
[ $compiler == dartkb ]
no_lazy_dispatchers_test: SkipByDesign # KBC interpreter doesn't support --no_lazy_dispatchers
diff --git a/tests/standalone_2/io/network_policy_configuration_test.dart b/tests/standalone_2/io/network_policy_configuration_test.dart
index 6ee1bf0..49e6c56 100644
--- a/tests/standalone_2/io/network_policy_configuration_test.dart
+++ b/tests/standalone_2/io/network_policy_configuration_test.dart
@@ -24,9 +24,17 @@
void main() {
// These have no policy but the default is false.
- _checkDenies(["mailfoobar.com", "abc.com", "oobar.com", "foobar.co"]);
+ _checkDenies([
+ "mailfoobar.com",
+ "abc.com",
+ "oobar.com",
+ "foobar.co",
+ "128.221.55.31",
+ "fe80::4607:0bff:fea0:7747%invalid",
+ ]);
// These are explicitly denied.
_checkDenies(["baz.foobar.com"]);
_checkAllows(
["foobar.com", "test.baz.foobar.com", "test2.test.baz.foobar.com"]);
+ _checkAllows(["::1", "localhost"]);
}
diff --git a/tests/standalone_2/standalone_2_kernel.status b/tests/standalone_2/standalone_2_kernel.status
index a45b3d0..5eca181 100644
--- a/tests/standalone_2/standalone_2_kernel.status
+++ b/tests/standalone_2/standalone_2_kernel.status
@@ -7,8 +7,6 @@
fragmentation_test: Pass, Slow # GC heavy
fragmentation_typed_data_test: Pass, Slow # GC heavy
io/process_sync_test: Pass, Slow # Spawns synchronously subprocesses in sequence.
-io/socket_network_policy_test: Skip # Temporarily disabled.
-io/socket_network_policy_localhost_test: Skip # Temporarily disabled.
[ $compiler == dartkb ]
no_lazy_dispatchers_test: SkipByDesign # KBC interpreter doesn't support --no_lazy_dispatchers
diff --git a/tools/VERSION b/tools/VERSION
index caa91be..afa83d0 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 10
PATCH 0
-PRERELEASE 37
+PRERELEASE 38
PRERELEASE_PATCH 0
\ No newline at end of file