Partial static mode changes for vm-service and tests (part 4).

Bug: https://github.com/dart-lang/sdk/issues/31587
Bug: https://github.com/dart-lang/sdk/issues/31696
Change-Id: I2b37ad97da0520db08f43981fdbc48b094942a0e
Reviewed-on: https://dart-review.googlesource.com/34306
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
This commit is contained in:
Ryan Macnak 2018-01-12 20:12:41 +00:00 committed by commit-bot@chromium.org
parent 87e5a57b9a
commit 9cf7d6fa93
22 changed files with 126 additions and 172 deletions

View file

@ -9,7 +9,7 @@ part of cli;
// line from the pieces.
List<String> _splitLine(String line) {
line = line.trimLeft();
var args = [];
var args = <String>[];
int pos = 0;
while (pos < line.length) {
int startPos = pos;
@ -44,7 +44,7 @@ abstract class _CommandBase {
}
// A command may optionally have sub-commands.
List<Command> _children = [];
List<Command> _children = <Command>[];
_CommandBase _parent;
int get _depth => (_parent == null ? 0 : _parent._depth + 1);
@ -53,7 +53,8 @@ abstract class _CommandBase {
//
// Given a list of arguments to this command, provide a list of
// possible completions for those arguments.
Future<List<String>> complete(List<String> args) => new Future.value([]);
Future<List<String>> complete(List<String> args) =>
new Future.value(<String>[]);
// Override in subclasses to provide command-specific execution.
Future run(List<String> args);
@ -77,12 +78,12 @@ abstract class _CommandBase {
// arguments.
List<Command> _match(List<String> args, bool preferExact) {
if (args.isEmpty) {
return [];
return <Command>[];
}
bool lastArg = (args.length == 1);
var matches = _matchLocal(args[0], !lastArg || preferExact);
if (matches.isEmpty) {
return [];
return <Command>[];
} else if (matches.length == 1) {
var childMatches = matches[0]._match(args.sublist(1), preferExact);
if (childMatches.isEmpty) {
@ -104,7 +105,7 @@ abstract class _CommandBase {
args[args.length - 1] == '') {
// Special case allowance for an empty particle at the end of
// the command.
completions = [''];
completions = <String>[''];
}
var prefix = _concatArgs(args, _depth);
return completions.map((str) => '${prefix}${str}').toList();
@ -134,7 +135,7 @@ class RootCommand extends _CommandBase {
var commands = _match(args, false);
if (commands.isEmpty) {
// No matching commands.
return new Future.value([]);
return new Future.value(<String>[]);
}
int matchLen = commands[0]._depth;
if (matchLen < args.length) {
@ -147,7 +148,7 @@ class RootCommand extends _CommandBase {
} else {
// An ambiguous prefix match leaves us nowhere. The user is
// typing a bunch of stuff that we don't know how to complete.
return new Future.value([]);
return new Future.value(<String>[]);
}
}

View file

@ -458,6 +458,8 @@ abstract class ServiceObjectOwner extends ServiceObject {
abstract class Location implements M.Location {
Script get script;
int get tokenPos;
Future<int> getLine();
Future<int> getColumn();
}
/// A [SourceLocation] represents a location or range in the source code.
@ -1362,7 +1364,7 @@ class Isolate extends ServiceObjectOwner implements M.Isolate {
static const kPossibleBreakpointsReport = 'PossibleBreakpoints';
static const kProfileReport = '_Profile';
Future<ServiceMap> getSourceReport(List<String> report_kinds,
Future<ServiceObject> getSourceReport(List<String> report_kinds,
[Script script, int startPos, int endPos]) {
var params = <String, dynamic>{'reports': report_kinds};
if (script != null) {
@ -2448,7 +2450,8 @@ class Library extends HeapObject implements M.Library {
functions.sort(ServiceObject.LexicalSortName);
}
Future<ServiceObject> evaluate(String expression, {Map scope}) {
Future<ServiceObject> evaluate(String expression,
{Map<String, ServiceObject> scope}) {
return isolate.eval(this, expression, scope: scope);
}
@ -2626,7 +2629,8 @@ class Class extends HeapObject implements M.Class {
subclasses.sort(ServiceObject.LexicalSortName);
}
Future<ServiceObject> evaluate(String expression, {Map scope}) {
Future<ServiceObject> evaluate(String expression,
{Map<String, ServiceObject> scope}) {
return isolate.eval(this, expression, scope: scope);
}
@ -2991,7 +2995,8 @@ class Instance extends HeapObject implements M.Instance {
return 'a ${clazz.name}';
}
Future<ServiceObject> evaluate(String expression, {Map scope}) {
Future<ServiceObject> evaluate(String expression,
{Map<String, ServiceObject> scope}) {
return isolate.eval(this, expression, scope: scope);
}
@ -3588,7 +3593,7 @@ class Script extends HeapObject implements M.Script {
library = map['library'];
}
void _parseTokenPosTable(List<List<int>> table) {
void _parseTokenPosTable(List/*<List<int>>*/ table) {
if (table == null) {
return;
}
@ -4398,7 +4403,7 @@ class Code extends HeapObject implements M.Code {
}
}
void _processDescriptors(List<Map> descriptors) {
void _processDescriptors(List/*<Map>*/ descriptors) {
for (Map descriptor in descriptors) {
var pcOffset = int.parse(descriptor['pcOffset'], radix: 16);
var address = startAddress + pcOffset;
@ -4558,7 +4563,7 @@ class ServiceMetric extends ServiceObject implements M.Metric {
String toString() => "ServiceMetric($_id)";
}
Future<Null> printFrames(List<Frame> frames) async {
Future<Null> printFrames(List/*<Frame>*/ frames) async {
for (int i = 0; i < frames.length; i++) {
final Frame frame = frames[i];
String frameText = await frame.toUserString();

View file

@ -62,13 +62,15 @@ var tests = <IsolateTest>[
expect(await futureBpt2.location.getColumn(), equals(3));
// The first breakpoint hits before value is modified.
expect((await rootLib.evaluate('value')).valueAsString, equals('0'));
Instance result = await rootLib.evaluate('value');
expect(result.valueAsString, equals('0'));
isolate.resume();
await hasStoppedAtBreakpoint(isolate);
// The second breakpoint hits after value has been modified once.
expect((await rootLib.evaluate('value')).valueAsString, equals('1'));
result = await rootLib.evaluate('value');
expect(result.valueAsString, equals('1'));
// Remove the breakpoints.
expect(

View file

@ -1,7 +1,7 @@
// Copyright (c) 2015, 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.
// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
// VMOptions=--error_on_bad_type --error_on_bad_override
import 'package:observatory/object_graph.dart';
import 'package:unittest/unittest.dart';

View file

@ -4,24 +4,25 @@
// VMOptions=--error_on_bad_type --error_on_bad_override --verbose-debug
// VMOptions=--error_on_bad_type --error_on_bad_override --verbose-debug --stacktrace-every=55 --stress-async-stacks
import 'dart:async';
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
import 'test_helper.dart';
printSync() {
print('sync'); // Line 11
print('sync'); // Line 12
}
printAsync() async {
print('async'); // Line 15
print('async'); // Line 16
}
printAsyncStar() async* {
print('async*'); // Line 19
print('async*'); // Line 20
}
printSyncStar() sync* {
print('sync*'); // Line 23
print('sync*'); // Line 24
}
var testerReady = false;
@ -38,38 +39,38 @@ testeeDo() {
var stream = printAsyncStar();
var iterator = printSyncStar();
print('middle'); // Line 41
print('middle'); // Line 42
future.then((v) => print(v));
stream.toList();
iterator.toList();
}
testAsync(Isolate isolate) async {
Future testAsync(Isolate isolate) async {
await isolate.rootLibrary.load();
var script = isolate.rootLibrary.scripts[0];
var bp1 = await isolate.addBreakpoint(script, 11);
var bp1 = await isolate.addBreakpoint(script, 12);
expect(bp1, isNotNull);
expect(bp1 is Breakpoint, isTrue);
var bp2 = await isolate.addBreakpoint(script, 15);
var bp2 = await isolate.addBreakpoint(script, 16);
expect(bp2, isNotNull);
expect(bp2 is Breakpoint, isTrue);
var bp3 = await isolate.addBreakpoint(script, 19);
var bp3 = await isolate.addBreakpoint(script, 20);
expect(bp3, isNotNull);
expect(bp3 is Breakpoint, isTrue);
var bp4 = await isolate.addBreakpoint(script, 23);
var bp4 = await isolate.addBreakpoint(script, 24);
expect(bp4, isNotNull);
expect(bp4 is Breakpoint, isTrue);
var bp5 = await isolate.addBreakpoint(script, 41);
var bp5 = await isolate.addBreakpoint(script, 42);
print("BP5 - $bp5");
expect(bp5, isNotNull);
expect(bp5 is Breakpoint, isTrue);
var hits = [];
isolate.rootLibrary.evaluate('testerReady = true;').then((Instance result) {
expect(result.valueAsString, equals('true'));
isolate.rootLibrary.evaluate('testerReady = true;').then((result) {
expect((result as Instance).valueAsString, equals('true'));
});
var stream = await isolate.vm.getEventStream(VM.kDebugStream);

View file

@ -66,9 +66,9 @@ var tests = <IsolateTest>[
);
// Observe that it failed.
expect(response['success'], isFalse);
List<Map<String, dynamic>> notices = response['details']['notices'];
List/*<Map<String, dynamic>>*/ notices = response['details']['notices'];
expect(notices.length, equals(1));
Map<String, dynamic> reasonForCancelling = notices[0];
Map/*<String, dynamic>*/ reasonForCancelling = notices[0];
expect(reasonForCancelling['type'], equals('ReasonForCancelling'));
expect(reasonForCancelling['message'], contains('library_isnt_here_man'));

View file

@ -9,7 +9,7 @@ import 'package:unittest/unittest.dart';
void testBadWebSocket() {
var vm = new WebSocketVM(new WebSocketVMTarget('ws://karatekid/ws'));
vm.load().catchError(expectAsync((error) {
vm.load().then<dynamic>((_) => null).catchError(expectAsync((error) {
expect(error, new isInstanceOf<NetworkRpcException>());
}));
}

View file

@ -1,7 +1,7 @@
// Copyright (c) 2015, 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.
// VMOptions=--compile_all --error_on_bad_type --error_on_bad_override
// VMOptions=--error_on_bad_type --error_on_bad_override
import 'dart:async';
import 'dart:developer';

View file

@ -36,18 +36,18 @@ class TestCompleteCommand extends Command {
void testCommandComplete() {
RootCommand cmd = new RootCommand([
new TestCommand(null, 'alpha', []),
new TestCommand(null, 'game', [
new TestCommand(null, 'checkers', []),
new TestCommand(null, 'chess', [])
new TestCommand(null, 'alpha', <Command>[]),
new TestCommand(null, 'game', <Command>[
new TestCommand(null, 'checkers', <Command>[]),
new TestCommand(null, 'chess', <Command>[])
]),
new TestCommand(null, 'gamera', [
new TestCommand(null, 'london', []),
new TestCommand(null, 'tokyo', []),
new TestCommand(null, 'topeka', [])
new TestCommand(null, 'gamera', <Command>[
new TestCommand(null, 'london', <Command>[]),
new TestCommand(null, 'tokyo', <Command>[]),
new TestCommand(null, 'topeka', <Command>[])
]),
new TestCompleteCommand(
null, 'count', [new TestCommand(null, 'chocula', [])])
null, 'count', <Command>[new TestCommand(null, 'chocula', <Command>[])])
]);
// Show all commands.
@ -147,7 +147,8 @@ void testCommandComplete() {
void testCommandRunSimple() {
// Run a simple command.
StringBuffer out = new StringBuffer();
RootCommand cmd = new RootCommand([new TestCommand(out, 'alpha', [])]);
RootCommand cmd =
new RootCommand([new TestCommand(out, 'alpha', <Command>[])]);
// Full name dispatch works. Argument passing works.
cmd.runCommand('alpha dog').then(expectAsync((_) {
@ -164,8 +165,10 @@ void testCommandRunSubcommand() {
// Run a simple command.
StringBuffer out = new StringBuffer();
RootCommand cmd = new RootCommand([
new TestCommand(out, 'alpha',
[new TestCommand(out, 'beta', []), new TestCommand(out, 'gamma', [])])
new TestCommand(out, 'alpha', [
new TestCommand(out, 'beta', <Command>[]),
new TestCommand(out, 'gamma', <Command>[])
])
]);
cmd.runCommand('a b').then(expectAsync((_) {
@ -180,7 +183,8 @@ void testCommandRunSubcommand() {
void testCommandRunNotFound() {
// Run a simple command.
StringBuffer out = new StringBuffer();
RootCommand cmd = new RootCommand([new TestCommand(out, 'alpha', [])]);
RootCommand cmd =
new RootCommand([new TestCommand(out, 'alpha', <Command>[])]);
cmd.runCommand('goose').catchError(expectAsync((e) {
expect(e.toString(), equals("No such command: 'goose'"));
@ -190,8 +194,10 @@ void testCommandRunNotFound() {
void testCommandRunAmbiguous() {
// Run a simple command.
StringBuffer out = new StringBuffer();
RootCommand cmd = new RootCommand(
[new TestCommand(out, 'alpha', []), new TestCommand(out, 'ankle', [])]);
RootCommand cmd = new RootCommand([
new TestCommand(out, 'alpha', <Command>[]),
new TestCommand(out, 'ankle', <Command>[])
]);
cmd.runCommand('a 55').catchError(expectAsync((e) {
expect(e.toString(), equals("Command 'a 55' is ambiguous: [alpha, ankle]"));
@ -205,10 +211,10 @@ void testCommandRunAmbiguous() {
void testCommandRunAlias() {
// Run a simple command.
StringBuffer out = new StringBuffer();
var aliasCmd = new TestCommand(out, 'alpha', []);
var aliasCmd = new TestCommand(out, 'alpha', <Command>[]);
aliasCmd.alias = 'a';
RootCommand cmd =
new RootCommand([aliasCmd, new TestCommand(out, 'ankle', [])]);
new RootCommand([aliasCmd, new TestCommand(out, 'ankle', <Command>[])]);
cmd.runCommand('a 55').then(expectAsync((_) {
expect(out.toString(), equals('executing alpha([55])\n'));

View file

@ -156,7 +156,7 @@ main(args, msg) {
result = await vm.invokeRpcNoUpgrade('_spawnUri', {
'token': 'mySpawnToken1',
'uri': '${fsUri}${filePaths[1]}',
'args': ['one', 'two', 'three']
'args': <String>['one', 'two', 'three']
});
expect(result['type'], equals('Success'));
spawnedIsolate = await completer.future;

View file

@ -12,7 +12,7 @@ var tests = <IsolateTest>[
Class classLibrary = await root.clazz.load();
print(classLibrary);
var result = await classLibrary.evaluate('3 + 4');
dynamic result = await classLibrary.evaluate('3 + 4');
print(result);
expect(result is DartError, isTrue);
expect(result.message, contains('Cannot evaluate'));
@ -24,7 +24,7 @@ var tests = <IsolateTest>[
expect(result is DartError, isTrue);
expect(result.message, contains('Cannot evaluate'));
var someArray = await root.evaluate("new List(2)");
Instance someArray = await root.evaluate("new List(2)");
print(someArray);
expect(someArray is Instance, isTrue);
Class classArray = await someArray.clazz.load();

View file

@ -6,6 +6,7 @@
// Tests that expressions evaluated in a frame see the same scope as the
// frame's method.
import 'dart:async';
import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
import 'test_helper.dart';
@ -28,7 +29,7 @@ testeeDo() {
obj.test();
}
testerDo(Isolate isolate) async {
Future testerDo(Isolate isolate) async {
await hasStoppedAtBreakpoint(isolate);
// Make sure we are in the right place.
@ -39,7 +40,7 @@ testerDo(Isolate isolate) async {
expect(stack['frames'][topFrame].function.dartOwner.name,
equals('Superclass&Klass'));
var result;
Instance result;
result = await isolate.evalFrame(topFrame, '_local');
print(result);

View file

@ -7,6 +7,7 @@ import 'package:observatory/service_io.dart';
import 'package:unittest/unittest.dart';
import 'test_helper.dart';
import 'dart:async';
import 'dart:math' as math;
breakHere() {}
@ -67,7 +68,7 @@ class C {
}
}
testMethod(Isolate isolate) async {
Future testMethod(Isolate isolate) async {
// silence analyzer.
expect(math.sqrt(4), equals(2));
Library rootLib = await isolate.rootLibrary.load();
@ -118,7 +119,7 @@ testMethod(Isolate isolate) async {
expect(hitBreakpoint, isTrue);
}
testMethod2(Isolate isolate) async {
Future testMethod2(Isolate isolate) async {
Library rootLib = await isolate.rootLibrary.load();
ServiceFunction function =
rootLib.functions.singleWhere((f) => f.name == 'breakHere');
@ -167,7 +168,7 @@ testMethod2(Isolate isolate) async {
expect(hitBreakpoint, isTrue);
}
testMethod3(Isolate isolate) async {
Future testMethod3(Isolate isolate) async {
Library rootLib = await isolate.rootLibrary.load();
ServiceFunction function =
rootLib.functions.singleWhere((f) => f.name == 'breakHere');
@ -209,7 +210,7 @@ testMethod3(Isolate isolate) async {
}
testMethod4(Isolate isolate) async {
Future testMethod4(Isolate isolate) async {
Library rootLib = await isolate.rootLibrary.load();
ServiceFunction function =
rootLib.functions.singleWhere((f) => f.name == 'breakHere');

View file

@ -27,7 +27,7 @@ var tests = <IsolateTest>[
expect(stack.type, equals('Stack'));
expect(await stack['frames'][topFrame].location.getLine(), 16);
var result = await isolate.evalFrame(topFrame, "x");
Instance result = await isolate.evalFrame(topFrame, "x");
print(result);
expect(result.valueAsString, equals("3"));
},
@ -40,7 +40,7 @@ var tests = <IsolateTest>[
expect(stack.type, equals('Stack'));
expect(await stack['frames'][topFrame].location.getLine(), 18);
var result = await isolate.evalFrame(topFrame, "z");
Instance result = await isolate.evalFrame(topFrame, "z");
print(result);
expect(result.valueAsString, equals("7"));
},

View file

@ -31,7 +31,7 @@ var tests = <IsolateTest>[
expect(stack.type, equals('Stack'));
expect(await stack['frames'][topFrame].location.getLine(), 15);
var result = await isolate.evalFrame(topFrame, "x");
Instance result = await isolate.evalFrame(topFrame, "x");
print(result);
expect(result.valueAsString, equals("3"));
},
@ -44,7 +44,7 @@ var tests = <IsolateTest>[
expect(stack.type, equals('Stack'));
expect(await stack['frames'][topFrame].location.getLine(), 18);
var result = await isolate.evalFrame(topFrame, "z");
Instance result = await isolate.evalFrame(topFrame, "z");
print(result);
expect(result.valueAsString, equals("7"));
},

View file

@ -45,25 +45,26 @@ var tests = <IsolateTest>[
var thing2 = thing2Field.staticValue;
print(thing2);
var result = await isolate
.evalFrame(0, "x + y + a + b", scope: {"a": thing1, "b": thing2});
Instance result = await isolate.evalFrame(0, "x + y + a + b",
scope: <String, ServiceObject>{"a": thing1, "b": thing2});
print(result);
expect(result.valueAsString, equals('2033'));
result = await isolate
.evalFrame(0, "local + a + b", scope: {"a": thing1, "b": thing2});
result = await isolate.evalFrame(0, "local + a + b",
scope: <String, ServiceObject>{"a": thing1, "b": thing2});
print(result);
expect(result.valueAsString, equals('2033'));
// Note the eval's scope is shadowing the locals' scope.
result =
await isolate.evalFrame(0, "x + y", scope: {"x": thing1, "y": thing2});
result = await isolate.evalFrame(0, "x + y",
scope: <String, ServiceObject>{"x": thing1, "y": thing2});
print(result);
expect(result.valueAsString, equals('7'));
bool didThrow = false;
try {
await lib.evaluate("x + y", scope: {"x": lib, "y": lib});
await lib.evaluate("x + y",
scope: <String, ServiceObject>{"x": lib, "y": lib});
} catch (e) {
didThrow = true;
expect(e.toString(),
@ -73,8 +74,8 @@ var tests = <IsolateTest>[
didThrow = false;
try {
result =
await lib.evaluate("x + y", scope: {"not&an&identifier": thing1});
result = await lib.evaluate("x + y",
scope: <String, ServiceObject>{"not&an&identifier": thing1});
print(result);
} catch (e) {
didThrow = true;

View file

@ -31,7 +31,7 @@ var tests = <IsolateTest>[
expect(stack.type, equals('Stack'));
expect(await stack['frames'][topFrame].location.getLine(), 15);
var result = await isolate.evalFrame(topFrame, "x");
Instance result = await isolate.evalFrame(topFrame, "x");
print(result);
expect(result.valueAsString, equals("3"));
},
@ -44,7 +44,7 @@ var tests = <IsolateTest>[
expect(stack.type, equals('Stack'));
expect(await stack['frames'][topFrame].location.getLine(), 18);
var result = await isolate.evalFrame(topFrame, "z");
Instance result = await isolate.evalFrame(topFrame, "z");
print(result);
expect(result.valueAsString, equals("7"));
},

View file

@ -27,12 +27,14 @@ var tests = <IsolateTest>[
var thing2 = thing2Field.staticValue;
print(thing2);
var result = await lib.evaluate("x + y", scope: {"x": thing1, "y": thing2});
Instance result = await lib.evaluate("x + y",
scope: <String, ServiceObject>{"x": thing1, "y": thing2});
expect(result.valueAsString, equals('7'));
bool didThrow = false;
try {
result = await lib.evaluate("x + y", scope: {"x": lib, "y": lib});
result = await lib.evaluate("x + y",
scope: <String, ServiceObject>{"x": lib, "y": lib});
print(result);
} catch (e) {
didThrow = true;
@ -43,8 +45,8 @@ var tests = <IsolateTest>[
didThrow = false;
try {
result =
await lib.evaluate("x + y", scope: {"not&an&identifier": thing1});
result = await lib.evaluate("x + y",
scope: <String, ServiceObject>{"not&an&identifier": thing1});
print(result);
} catch (e) {
didThrow = true;

View file

@ -5,28 +5,25 @@
# Kernel works slightly different. There are kernel specific versions.
# These are the non-kernel specific versions so skip tests and allow errors.
[ $compiler == dartk ]
*_reload_*: Skip # no reload support for now
add_breakpoint_rpc_test: SkipByDesign # non-kernel specific version of add_breakpoint_rpc_kernel_test.
address_mapper_test: CompileTimeError # These 3 tests fail with 'dart:vmservice_io': error: [...] native function 'VMServiceIO_Shutdown' (0 arguments) cannot be found because of '--compile_all'
address_mapper_test: Crash
async_generator_breakpoint_test: Skip # Issue 29158, Async debugging
async_single_step_out_test: RuntimeError # Issue 29158, Async debugging
async_star_single_step_into_test: RuntimeError # Issue 29158, Async debugging
async_star_step_out_test: RuntimeError # Issue 29158, Async debugging
async_step_out_test: RuntimeError # Issue 29158, Async debugging
awaiter_async_stack_contents_test: RuntimeError # Issue 29158, Async debugging
capture_stdio_test: CompileTimeError # These 3 tests fail with 'dart:vmservice_io': error: [...] native function 'VMServiceIO_Shutdown' (0 arguments) cannot be found because of '--compile_all'
capture_stdio_test: Crash
complex_reload_test: RuntimeError
developer_extension_test: CompileTimeError
eval_internal_class_test: Skip # no evaluation test for now
evaluate_*: Skip # no evaluation test for now
eval_internal_class_test: RuntimeError
evaluate_activation_in_method_class_test: RuntimeError
evaluate_activation_test/instance: RuntimeError
evaluate_activation_test/scope: RuntimeError
evaluate_in_sync_star_activation_test: RuntimeError
get_isolate_after_language_error_test: CompileTimeError
isolate_lifecycle_test: Pass, RuntimeError # Inherited from service.status
library_dependency_test: CompileTimeError # Deferred loading kernel issue 28335.
pause_on_unhandled_async_exceptions2_test: RuntimeError # --pause-isolates-on-unhandled-exceptions doesn't currently work. Issue #29056
pause_on_unhandled_async_exceptions_test: RuntimeError # --pause-isolates-on-unhandled-exceptions doesn't currently work. Issue #29056
step_through_arithmetic_test: RuntimeError # probably constant evaluator pre-evaluating e.g. 1+2
vm_restart_test: Crash
unused_changes_in_last_reload_test: RuntimeError
[ $compiler == dartkp ]
*: Skip # Non-kernel also skips precompiled mode.
@ -42,81 +39,10 @@ pause_idle_isolate_test: Skip # Flaky
[ $compiler == dartk && $mode == debug && $strong ]
external_service_disappear_test: Crash # Issue 31587
# Issue 31587
[ $compiler == dartk && $strong ]
add_breakpoint_rpc_kernel_test: CompileTimeError
async_next_test: RuntimeError
async_scope_test: RuntimeError
async_single_step_exception_test: RuntimeError
async_single_step_into_test: RuntimeError
awaiter_async_stack_contents_test: RuntimeError
bad_web_socket_address_test: CompileTimeError
break_on_function_test: RuntimeError
breakpoint_in_parts_class_test: RuntimeError
breakpoint_two_args_checked_test: CompileTimeError
caching_test: RuntimeError
causal_async_stack_contents_test: RuntimeError
causal_async_stack_presence_test: RuntimeError
causal_async_star_stack_contents_test: RuntimeError
causal_async_star_stack_presence_test: RuntimeError
code_test: RuntimeError
command_test: CompileTimeError
debugger_location_second_test: RuntimeError
debugger_location_test: RuntimeError
debugging_inlined_finally_test: RuntimeError
debugging_test: RuntimeError
dev_fs_spawn_test: RuntimeError
external_service_asynchronous_invocation_test: CompileTimeError
external_service_disappear_test: CompileTimeError
external_service_notification_invocation_test: CompileTimeError
external_service_registration_test: CompileTimeError
external_service_registration_via_notification_test: CompileTimeError
external_service_synchronous_invocation_test: CompileTimeError
get_object_store_rpc_test: RuntimeError
get_stack_rpc_test: RuntimeError
issue_25465_test: CompileTimeError
issue_27238_test: RuntimeError
issue_27287_test: RuntimeError
local_variable_declaration_test: RuntimeError
mixin_break_test: RuntimeError
next_through_assign_call_test: RuntimeError
next_through_assign_int_test: RuntimeError
next_through_call_on_field_in_class_test: RuntimeError
next_through_call_on_field_test: RuntimeError
next_through_call_on_static_field_in_class_test: RuntimeError
next_through_catch_test: RuntimeError
next_through_closure_test: RuntimeError
next_through_create_list_and_map_test: RuntimeError
next_through_for_each_loop_test: RuntimeError
next_through_for_loop_with_break_and_continue_test: RuntimeError
next_through_function_expression_test: RuntimeError
next_through_implicit_call_test: RuntimeError
next_through_is_and_as_test: RuntimeError
next_through_multi_catch_test: RuntimeError
next_through_new_test: RuntimeError
next_through_operator_bracket_on_super_test: RuntimeError
next_through_operator_bracket_on_this_test: RuntimeError
next_through_operator_bracket_test: RuntimeError
next_through_simple_async_with_returns_test: RuntimeError
next_through_simple_linear_2_test: RuntimeError
next_through_simple_linear_test: RuntimeError
parameters_in_scope_at_entry_test: RuntimeError
positive_token_pos_test: RuntimeError
regress_28443_test: RuntimeError
rewind_optimized_out_test: RuntimeError
rewind_test: RuntimeError
set_library_debuggable_test: RuntimeError
steal_breakpoint_test: RuntimeError
step_into_async_no_await_test: RuntimeError
step_over_await_test: RuntimeError
step_through_arithmetic_test: RuntimeError
step_through_constructor_calls_test: RuntimeError
step_through_constructor_test: RuntimeError
step_through_function_2_test: RuntimeError
step_through_function_test: RuntimeError
step_through_getter_test: RuntimeError
step_through_property_get_test: RuntimeError
step_through_property_set_test: RuntimeError
step_through_setter_test: RuntimeError
step_through_switch_test: RuntimeError
step_through_switch_with_continue_test: RuntimeError
external_service_asynchronous_invocation_test: CompileTimeError # Issue 31696
external_service_disappear_test: CompileTimeError # Issue 31696
external_service_notification_invocation_test: CompileTimeError # Issue 31696
external_service_registration_test: CompileTimeError # Issue 31696
external_service_registration_via_notification_test: CompileTimeError # Issue 31696
external_service_synchronous_invocation_test: CompileTimeError # Issue 31696

View file

@ -20,7 +20,7 @@ main(List args, SendPort replyPort) {
""";
RawReceivePort receivePort;
receivePort = new RawReceivePort(expectAsync((int message) {
receivePort = new RawReceivePort(expectAsync((message) {
expect(message, equals(42));
receivePort.close();
}));

View file

@ -326,7 +326,6 @@ cc/Parser_AllocateVariables_NestedCapturedVar: Crash
cc/Parser_AllocateVariables_TwoChains: Crash
[ $compiler == dartk && $strong ]
dart/data_uri_spawn_test: CompileTimeError # Issue 31586
dart/optimized_stacktrace_line_and_column_test: CompileTimeError # Issue 31586
dart/optimized_stacktrace_line_test: CompileTimeError # Issue 31586

View file

@ -511,12 +511,21 @@ class VMService extends MessageRouter {
return encodeInvalidParamError(message, 'uri');
}
var args = message.params['args'];
if (args != null && args is! List<String>) {
return encodeInvalidParamError(message, 'args');
var argsOfString = new List<String>();
if (args != null) {
if (args is! List) {
return encodeInvalidParamError(message, 'args');
}
for (var arg in args) {
if (arg is! String) {
return encodeInvalidParamError(message, 'args');
}
argsOfString.add(arg);
}
}
var msg = message.params['message'];
Isolate.spawnUri(Uri.parse(uri), args, msg).then((isolate) {
Isolate.spawnUri(Uri.parse(uri), argsOfString, msg).then((isolate) {
_spawnUriNotify(isolate.controlPort, token);
}).catchError((e) {
_spawnUriNotify(e.toString(), token);