mirror of
https://github.com/dart-lang/sdk
synced 2024-09-20 05:31:31 +00:00
Make sure isolate library is initialized before using isolate natives.
The compiler only adds 'startRootIsolate' if we use the dart:isolate library. === if (hasIsolateSupport()) { enqueuer.codegen.addToWorkList( isolateHelperLibrary.find(Compiler.START_ROOT_ISOLATE)); enqueuer.codegen.registerGetOfStaticFunction(main); } === However the isolate-native library requires some of the startRootIsolate elements to be resolved. Therefore we must use the dart:isolate library in the native-isolate tests. Review URL: https://codereview.chromium.org//167493002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32709 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
2883d99e8e
commit
b9dd61f71b
|
@ -501,6 +501,8 @@ typedef _MainFunction();
|
|||
typedef _MainFunctionArgs(args);
|
||||
typedef _MainFunctionArgsMessage(args, message);
|
||||
|
||||
/// Note: IsolateNatives depends on _globalState which is only set up correctly
|
||||
/// when 'dart:isolate' has been imported.
|
||||
class IsolateNatives {
|
||||
|
||||
static String thisScript = computeThisScript();
|
||||
|
|
|
@ -5,8 +5,14 @@
|
|||
// Test of IsolateNatives.computeThisScript().
|
||||
|
||||
import 'dart:_isolate_helper';
|
||||
// The isolate helper library is not correctly set up if the dart:isolate
|
||||
// library hasn't been loaded.
|
||||
import 'dart:isolate';
|
||||
|
||||
main() {
|
||||
// Need to use the isolate-library so dart2js correctly initializes the
|
||||
// library.
|
||||
Capability cab = new Capability();
|
||||
String script = IsolateNatives.computeThisScript();
|
||||
|
||||
// This is somewhat brittle and relies on an implementation detail
|
||||
|
|
|
@ -22,6 +22,3 @@ only_pass_on_d8_test: Fail, OK # This test should only pass on D8.
|
|||
|
||||
[ $browser || $runtime == d8 ]
|
||||
only_pass_on_jsshell_test: Fail, OK # This test should only pass on jsshell.
|
||||
|
||||
[ $compiler == dart2js && $checked && $runtime == d8 ]
|
||||
compute_this_script_test: Crash # TODO(floitsch): Mark as failing while debugging.
|
||||
|
|
Loading…
Reference in a new issue