Skip to content
Snippets Groups Projects
Unverified Commit 26ba571a authored by Nate Bosch's avatar Nate Bosch Committed by GitHub
Browse files

Remove arguments to runInIsolate utility (#1169)

The `resolver` argument was only used from external packages which can
be migrated off this utility.

The `checked` argument was only used to allow `spawnHybrid` APIs to run
code without asserts, but we want all test code to run with asserts,
including server side utilities.
parent fefa66d0
No related branches found
No related tags found
No related merge requests found
## 0.3.1-dev
* Enable asserts in code running through `spawnHybrid` APIs.
## 0.3.0
* Bump minimum SDK to `2.4.0` for safer usage of for-loop elements.
......
......@@ -139,7 +139,7 @@ Future<Isolate> _spawnDataIsolate(String path, SendPort message) async {
var channel = serializeSuite(() => test.main);
IsolateChannel.connectSend(message).pipe(channel);
}
''', message, checked: true);
''', message);
}
Future<Isolate> _spawnPrecompiledIsolate(
......
......@@ -8,7 +8,6 @@ import 'dart:isolate';
// ignore: deprecated_member_use
import 'package:analyzer/analyzer.dart';
import 'package:package_resolver/package_resolver.dart';
import 'package:source_span/source_span.dart';
import 'string_literal_iterator.dart';
......@@ -19,20 +18,15 @@ import 'string_literal_iterator.dart';
/// they will be resolved in the same context as the host isolate. [message] is
/// passed to the [main] method of the code being run; the caller is responsible
/// for using this to establish communication with the isolate.
///
/// If [resolver] is passed, its package resolution strategy is used to resolve
/// code in the spawned isolate. It defaults to [PackageResolver.current].
Future<Isolate> runInIsolate(String code, message,
{PackageResolver resolver, bool checked, SendPort onExit}) async {
resolver ??= PackageResolver.current;
return await Isolate.spawnUri(
Uri.dataFromString(code, mimeType: 'application/dart', encoding: utf8),
[],
message,
packageConfig: await resolver.packageConfigUri,
checked: checked,
onExit: onExit);
}
Future<Isolate> runInIsolate(String code, Object message,
{SendPort onExit}) async =>
Isolate.spawnUri(
Uri.dataFromString(code, mimeType: 'application/dart', encoding: utf8),
[],
message,
packageConfig: await Isolate.packageConfig,
checked: true,
onExit: onExit);
/// Takes a span whose source is the value of a string that has been parsed from
/// a Dart file and returns the corresponding span from within that Dart file.
......
name: test_core
version: 0.3.0
version: 0.3.1-dev
description: A basic library for writing tests and running them on the VM.
homepage: https://github.com/dart-lang/test/blob/master/pkgs/test_core
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment