| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Test of IsolateNatives.computeThisScript(). | 5 // Test of IsolateNatives.computeThisScript(). |
| 6 | 6 |
| 7 import 'dart:_isolate_helper'; | 7 import 'dart:_isolate_helper'; |
| 8 // The isolate helper library is not correctly set up if the dart:isolate |
| 9 // library hasn't been loaded. |
| 10 import 'dart:isolate'; |
| 8 | 11 |
| 9 main() { | 12 main() { |
| 13 // Need to use the isolate-library so dart2js correctly initializes the |
| 14 // library. |
| 15 Capability cab = new Capability(); |
| 10 String script = IsolateNatives.computeThisScript(); | 16 String script = IsolateNatives.computeThisScript(); |
| 11 | 17 |
| 12 // This is somewhat brittle and relies on an implementation detail | 18 // This is somewhat brittle and relies on an implementation detail |
| 13 // of our test runner, but I can think of no other way to test this. | 19 // of our test runner, but I can think of no other way to test this. |
| 14 // -- ahe | 20 // -- ahe |
| 15 if (!script.endsWith('/out.js')) { | 21 if (!script.endsWith('/out.js')) { |
| 16 throw 'Unexpected script: "$script"'; | 22 throw 'Unexpected script: "$script"'; |
| 17 } | 23 } |
| 18 } | 24 } |
| OLD | NEW |