diff --git a/pkg/compiler/lib/src/common/names.dart b/pkg/compiler/lib/src/common/names.dart index 1237d5f71bd..5d1116cb5ce 100644 --- a/pkg/compiler/lib/src/common/names.dart +++ b/pkg/compiler/lib/src/common/names.dart @@ -229,10 +229,6 @@ class Uris { static final Uri dart__js_embedded_names = new Uri(scheme: 'dart', path: '_js_embedded_names'); - /// The URI for 'dart:_isolate_helper'. - static final Uri dart__isolate_helper = - new Uri(scheme: 'dart', path: '_isolate_helper'); - /// The URI for 'package:js'. static final Uri package_js = new Uri(scheme: 'package', path: 'js/js.dart'); } diff --git a/pkg/compiler/lib/src/common_elements.dart b/pkg/compiler/lib/src/common_elements.dart index 2e87df4f554..33819fad097 100644 --- a/pkg/compiler/lib/src/common_elements.dart +++ b/pkg/compiler/lib/src/common_elements.dart @@ -137,10 +137,6 @@ class CommonElements { LibraryEntity get foreignLibrary => _foreignLibrary ??= _env.lookupLibrary(Uris.dart__foreign_helper); - LibraryEntity _isolateHelperLibrary; - LibraryEntity get isolateHelperLibrary => - _isolateHelperLibrary ??= _env.lookupLibrary(Uris.dart__isolate_helper); - /// Reference to the internal library to lookup functions to always inline. LibraryEntity _internalLibrary; LibraryEntity get internalLibrary => _internalLibrary ??= diff --git a/pkg/compiler/lib/src/js_backend/backend_usage.dart b/pkg/compiler/lib/src/js_backend/backend_usage.dart index ed8dced8f72..3a626061008 100644 --- a/pkg/compiler/lib/src/js_backend/backend_usage.dart +++ b/pkg/compiler/lib/src/js_backend/backend_usage.dart @@ -154,8 +154,7 @@ class BackendUsageBuilderImpl implements BackendUsageBuilder { element.sourcePosition.uri.path .contains('_internal/js_runtime/lib/')) || element.library == _commonElements.jsHelperLibrary || - element.library == _commonElements.interceptorsLibrary || - element.library == _commonElements.isolateHelperLibrary) { + element.library == _commonElements.interceptorsLibrary) { // TODO(johnniwinther): We should be more precise about these. return true; } else { diff --git a/pkg/compiler/lib/src/kernel/dart2js_target.dart b/pkg/compiler/lib/src/kernel/dart2js_target.dart index 25e40917eb9..462ba79916e 100644 --- a/pkg/compiler/lib/src/kernel/dart2js_target.dart +++ b/pkg/compiler/lib/src/kernel/dart2js_target.dart @@ -80,7 +80,6 @@ const _requiredLibraries = const >{ 'dart:_foreign_helper', 'dart:_interceptors', 'dart:_internal', - 'dart:_isolate_helper', 'dart:_js_embedded_names', 'dart:_js_helper', 'dart:_js_names', @@ -103,7 +102,6 @@ const _requiredLibraries = const >{ 'dart:_foreign_helper', 'dart:_interceptors', 'dart:_internal', - 'dart:_isolate_helper', 'dart:_js_embedded_names', 'dart:_js_helper', 'dart:_js_names', diff --git a/pkg/compiler/lib/src/kernel/element_map_mixins.dart b/pkg/compiler/lib/src/kernel/element_map_mixins.dart index 3588b19d50d..a7f7901da80 100644 --- a/pkg/compiler/lib/src/kernel/element_map_mixins.dart +++ b/pkg/compiler/lib/src/kernel/element_map_mixins.dart @@ -158,7 +158,6 @@ abstract class KernelToElementMapBaseMixin implements KernelToElementMap { type ??= findIn(Uris.dart_core); type ??= findIn(Uris.dart__js_helper); type ??= findIn(Uris.dart__interceptors); - type ??= findIn(Uris.dart__isolate_helper); type ??= findIn(Uris.dart__native_typed_data); type ??= findIn(Uris.dart_collection); type ??= findIn(Uris.dart_math); diff --git a/pkg/compiler/lib/src/kernel/kernel_strategy.dart b/pkg/compiler/lib/src/kernel/kernel_strategy.dart index a0e7572a318..195881d5ebf 100644 --- a/pkg/compiler/lib/src/kernel/kernel_strategy.dart +++ b/pkg/compiler/lib/src/kernel/kernel_strategy.dart @@ -103,8 +103,8 @@ class KernelFrontEndStrategy extends FrontendStrategyBase { @override NativeClassFinder createNativeClassFinder(NativeBasicData nativeBasicData) { - return new BaseNativeClassFinder(_elementMap.elementEnvironment, - elementMap.commonElements, nativeBasicData); + return new BaseNativeClassFinder( + _elementMap.elementEnvironment, nativeBasicData); } NoSuchMethodResolver createNoSuchMethodResolver() { diff --git a/pkg/compiler/lib/src/native/resolver.dart b/pkg/compiler/lib/src/native/resolver.dart index fcc708e4e6a..e8af31103e9 100644 --- a/pkg/compiler/lib/src/native/resolver.dart +++ b/pkg/compiler/lib/src/native/resolver.dart @@ -388,22 +388,16 @@ abstract class NativeClassFinder { class BaseNativeClassFinder implements NativeClassFinder { final ElementEnvironment _elementEnvironment; - final CommonElements _commonElements; final NativeBasicData _nativeBasicData; Map _tagOwner = new Map(); - BaseNativeClassFinder( - this._elementEnvironment, this._commonElements, this._nativeBasicData); + BaseNativeClassFinder(this._elementEnvironment, this._nativeBasicData); Iterable computeNativeClasses( Iterable libraries) { Set nativeClasses = new Set(); libraries.forEach((l) => _processNativeClassesInLibrary(l, nativeClasses)); - if (_commonElements.isolateHelperLibrary != null) { - _processNativeClassesInLibrary( - _commonElements.isolateHelperLibrary, nativeClasses); - } _processSubclassesOfNativeClasses(libraries, nativeClasses); return nativeClasses; } @@ -512,7 +506,7 @@ class ResolutionNativeClassFinder extends BaseNativeClassFinder { ElementEnvironment elementEnvironment, CommonElements commonElements, NativeBasicData nativeBasicData) - : super(elementEnvironment, commonElements, nativeBasicData); + : super(elementEnvironment, nativeBasicData); void _processNativeClass( ClassElement classElement, Set nativeClasses) { diff --git a/sdk/lib/_internal/js_runtime/lib/async_patch.dart b/sdk/lib/_internal/js_runtime/lib/async_patch.dart index eef525c40e0..5ef35ee9812 100644 --- a/sdk/lib/_internal/js_runtime/lib/async_patch.dart +++ b/sdk/lib/_internal/js_runtime/lib/async_patch.dart @@ -14,8 +14,6 @@ import 'dart:_js_helper' wrapException, unwrapException; -import 'dart:_isolate_helper' show TimerImpl; - import 'dart:_foreign_helper' show JS, JS_GET_FLAG; import 'dart:_async_await_error_codes' as async_error_codes; @@ -111,7 +109,7 @@ class Timer { static Timer _createTimer(Duration duration, void callback()) { int milliseconds = duration.inMilliseconds; if (milliseconds < 0) milliseconds = 0; - return new TimerImpl(milliseconds, callback); + return new _TimerImpl(milliseconds, callback); } @patch @@ -119,10 +117,81 @@ class Timer { Duration duration, void callback(Timer timer)) { int milliseconds = duration.inMilliseconds; if (milliseconds < 0) milliseconds = 0; - return new TimerImpl.periodic(milliseconds, callback); + return new _TimerImpl.periodic(milliseconds, callback); } } +class _TimerImpl implements Timer { + final bool _once; + int _handle; + int _tick = 0; + + _TimerImpl(int milliseconds, void callback()) : _once = true { + if (_hasTimer()) { + void internalCallback() { + _handle = null; + this._tick = 1; + callback(); + } + + _handle = JS('int', 'self.setTimeout(#, #)', + convertDartClosureToJS(internalCallback, 0), milliseconds); + } else { + throw new UnsupportedError('`setTimeout()` not found.'); + } + } + + _TimerImpl.periodic(int milliseconds, void callback(Timer timer)) + : _once = false { + if (_hasTimer()) { + int start = JS('int', 'Date.now()'); + _handle = JS( + 'int', + 'self.setInterval(#, #)', + convertDartClosureToJS(() { + int tick = this._tick + 1; + if (milliseconds > 0) { + int duration = JS('int', 'Date.now()') - start; + if (duration > (tick + 1) * milliseconds) { + tick = duration ~/ milliseconds; + } + } + this._tick = tick; + callback(this); + }, 0), + milliseconds); + } else { + throw new UnsupportedError('Periodic timer.'); + } + } + + @override + bool get isActive => _handle != null; + + @override + int get tick => _tick; + + @override + void cancel() { + if (_hasTimer()) { + if (_handle == null) return; + if (_once) { + JS('void', 'self.clearTimeout(#)', _handle); + } else { + JS('void', 'self.clearInterval(#)', _handle); + } + _handle = null; + } else { + throw new UnsupportedError('Canceling a timer.'); + } + } +} + +bool _hasTimer() { + requiresPreamble(); + return JS('', 'self.setTimeout') != null; +} + class _AsyncAwaitCompleter implements Completer { final _completer = new Completer.sync(); bool isSync; diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart b/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart deleted file mode 100644 index 01f890b1eed..00000000000 --- a/sdk/lib/_internal/js_runtime/lib/isolate_helper.dart +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright (c) 2012, 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. - -library _isolate_helper; - -import 'dart:async'; -import 'dart:isolate'; - -import 'dart:_js_embedded_names' show CURRENT_SCRIPT; - -import 'dart:_js_helper' - show convertDartClosureToJS, random64, requiresPreamble; - -import 'dart:_foreign_helper' show JS, JS_EMBEDDED_GLOBAL; - -import 'dart:_interceptors' show JSExtendableArray; - -/// Returns true if we are currently in a worker context. -bool isWorker() { - requiresPreamble(); - return JS('', '!self.window && !!self.postMessage'); -} - -/// The src url for the script tag that loaded this code. -String thisScript = computeThisScript(); - -/// The src url for the script tag that loaded this function. -/// -/// Used to create JavaScript workers and load deferred libraries. -String computeThisScript() { - var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT); - if (currentScript != null) { - return JS('String', 'String(#.src)', currentScript); - } - // A worker has no script tag - so get an url from a stack-trace. - if (isWorker()) return _computeThisScriptFromTrace(); - // An isolate that doesn't support workers, but doesn't have a - // currentScript either. This is most likely a Chrome extension. - return null; -} - -String _computeThisScriptFromTrace() { - var stack = JS('String|Null', 'new Error().stack'); - if (stack == null) { - // According to Internet Explorer documentation, the stack - // property is not set until the exception is thrown. The stack - // property was not provided until IE10. - stack = JS( - 'String|Null', - '(function() {' - 'try { throw new Error() } catch(e) { return e.stack }' - '})()'); - if (stack == null) throw new UnsupportedError('No stack trace'); - } - var pattern, matches; - - // This pattern matches V8, Chrome, and Internet Explorer stack - // traces that look like this: - // Error - // at methodName (URI:LINE:COLUMN) - pattern = JS('', r'new RegExp("^ *at [^(]*\\((.*):[0-9]*:[0-9]*\\)$", "m")'); - - matches = JS('JSExtendableArray|Null', '#.match(#)', stack, pattern); - if (matches != null) return JS('String', '#[1]', matches); - - // This pattern matches Firefox stack traces that look like this: - // methodName@URI:LINE - pattern = JS('', r'new RegExp("^[^@]*@(.*):[0-9]*$", "m")'); - - matches = JS('JSExtendableArray|Null', '#.match(#)', stack, pattern); - if (matches != null) return JS('String', '#[1]', matches); - - throw new UnsupportedError('Cannot extract URI from "$stack"'); -} - -class ReceivePortImpl extends Stream implements ReceivePort { - ReceivePortImpl(); - - StreamSubscription listen(void onData(var event), - {Function onError, void onDone(), bool cancelOnError}) { - throw new UnsupportedError("ReceivePort.listen"); - } - - void close() {} - - SendPort get sendPort => throw new UnsupportedError("ReceivePort.sendPort"); -} - -class TimerImpl implements Timer { - final bool _once; - int _handle; - int _tick = 0; - - TimerImpl(int milliseconds, void callback()) : _once = true { - if (_hasTimer()) { - void internalCallback() { - _handle = null; - this._tick = 1; - callback(); - } - - _handle = JS('int', 'self.setTimeout(#, #)', - convertDartClosureToJS(internalCallback, 0), milliseconds); - } else { - throw new UnsupportedError('`setTimeout()` not found.'); - } - } - - TimerImpl.periodic(int milliseconds, void callback(Timer timer)) - : _once = false { - if (_hasTimer()) { - int start = JS('int', 'Date.now()'); - _handle = JS( - 'int', - 'self.setInterval(#, #)', - convertDartClosureToJS(() { - int tick = this._tick + 1; - if (milliseconds > 0) { - int duration = JS('int', 'Date.now()') - start; - if (duration > (tick + 1) * milliseconds) { - tick = duration ~/ milliseconds; - } - } - this._tick = tick; - callback(this); - }, 0), - milliseconds); - } else { - throw new UnsupportedError('Periodic timer.'); - } - } - - @override - bool get isActive => _handle != null; - - @override - int get tick => _tick; - - @override - void cancel() { - if (_hasTimer()) { - if (_handle == null) return; - if (_once) { - JS('void', 'self.clearTimeout(#)', _handle); - } else { - JS('void', 'self.clearInterval(#)', _handle); - } - _handle = null; - } else { - throw new UnsupportedError('Canceling a timer.'); - } - } -} - -bool _hasTimer() { - requiresPreamble(); - return JS('', 'self.setTimeout') != null; -} diff --git a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart index cdb840b4ef2..37e60907585 100644 --- a/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart +++ b/sdk/lib/_internal/js_runtime/lib/isolate_patch.dart @@ -7,7 +7,6 @@ import "dart:async"; import 'dart:_foreign_helper' show JS; import 'dart:_js_helper' show patch; -import 'dart:_isolate_helper' show ReceivePortImpl; @patch class Isolate { @@ -107,7 +106,7 @@ class Isolate { @patch class ReceivePort { @patch - factory ReceivePort() = ReceivePortImpl; + factory ReceivePort() = _ReceivePortImpl; @patch factory ReceivePort.fromRawReceivePort(RawReceivePort rawPort) { @@ -115,6 +114,17 @@ class ReceivePort { } } +class _ReceivePortImpl extends Stream implements ReceivePort { + StreamSubscription listen(void onData(var event), + {Function onError, void onDone(), bool cancelOnError}) { + throw new UnsupportedError("ReceivePort.listen"); + } + + void close() {} + + SendPort get sendPort => throw new UnsupportedError("ReceivePort.sendPort"); +} + @patch class RawReceivePort { @patch diff --git a/sdk/lib/_internal/js_runtime/lib/js_helper.dart b/sdk/lib/_internal/js_runtime/lib/js_helper.dart index 1055a64fb11..b5a370f868b 100644 --- a/sdk/lib/_internal/js_runtime/lib/js_helper.dart +++ b/sdk/lib/_internal/js_runtime/lib/js_helper.dart @@ -25,8 +25,6 @@ import 'dart:_js_embedded_names' import 'dart:collection'; -import 'dart:_isolate_helper' show thisScript, isWorker; - import 'dart:async' show Completer, DeferredLoadException, Future; import 'dart:_foreign_helper' @@ -3778,6 +3776,64 @@ String _computeCspNonce() { return JS('String', 'String(#.nonce)', currentScript); } +/// Returns true if we are currently in a worker context. +bool _isWorker() { + requiresPreamble(); + return JS('', '!self.window && !!self.postMessage'); +} + +/// The src url for the script tag that loaded this code. +String thisScript = _computeThisScript(); + +/// The src url for the script tag that loaded this function. +/// +/// Used to create JavaScript workers and load deferred libraries. +String _computeThisScript() { + var currentScript = JS_EMBEDDED_GLOBAL('', CURRENT_SCRIPT); + if (currentScript != null) { + return JS('String', 'String(#.src)', currentScript); + } + // A worker has no script tag - so get an url from a stack-trace. + if (_isWorker()) return _computeThisScriptFromTrace(); + // An isolate that doesn't support workers, but doesn't have a + // currentScript either. This is most likely a Chrome extension. + return null; +} + +String _computeThisScriptFromTrace() { + var stack = JS('String|Null', 'new Error().stack'); + if (stack == null) { + // According to Internet Explorer documentation, the stack + // property is not set until the exception is thrown. The stack + // property was not provided until IE10. + stack = JS( + 'String|Null', + '(function() {' + 'try { throw new Error() } catch(e) { return e.stack }' + '})()'); + if (stack == null) throw new UnsupportedError('No stack trace'); + } + var pattern, matches; + + // This pattern matches V8, Chrome, and Internet Explorer stack + // traces that look like this: + // Error + // at methodName (URI:LINE:COLUMN) + pattern = JS('', r'new RegExp("^ *at [^(]*\\((.*):[0-9]*:[0-9]*\\)$", "m")'); + + matches = JS('JSExtendableArray|Null', '#.match(#)', stack, pattern); + if (matches != null) return JS('String', '#[1]', matches); + + // This pattern matches Firefox stack traces that look like this: + // methodName@URI:LINE + pattern = JS('', r'new RegExp("^[^@]*@(.*):[0-9]*$", "m")'); + + matches = JS('JSExtendableArray|Null', '#.match(#)', stack, pattern); + if (matches != null) return JS('String', '#[1]', matches); + + throw new UnsupportedError('Cannot extract URI from "$stack"'); +} + Future _loadHunk(String hunkName) { Future future = _loadingLibraries[hunkName]; _eventLog.add(' - _loadHunk: $hunkName'); @@ -3823,7 +3879,7 @@ Future _loadHunk(String hunkName) { } catch (error, stackTrace) { failure(error, "invoking dartDeferredLibraryLoader hook", stackTrace); } - } else if (isWorker()) { + } else if (_isWorker()) { // We are in a web worker. Load the code with an XMLHttpRequest. int index = uri.lastIndexOf('/'); uri = '${uri.substring(0, index + 1)}$hunkName'; diff --git a/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart b/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart index d6c32e03b1d..5e1c046246c 100644 --- a/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart +++ b/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart @@ -157,11 +157,6 @@ const Map libraries = const { categories: "", documented: false, platforms: DART2JS_PLATFORM), - "_isolate_helper": const LibraryInfo( - "_internal/js_runtime/lib/isolate_helper.dart", - categories: "", - documented: false, - platforms: DART2JS_PLATFORM), "_js_names": const LibraryInfo("_internal/js_runtime/lib/js_names.dart", categories: "", documented: false, platforms: DART2JS_PLATFORM), "_js_primitives": const LibraryInfo( diff --git a/sdk/lib/dart_client.platform b/sdk/lib/dart_client.platform index 7002d786529..805ac5c4f3d 100644 --- a/sdk/lib/dart_client.platform +++ b/sdk/lib/dart_client.platform @@ -47,7 +47,6 @@ _internal: internal/internal.dart _js_helper: _internal/js_runtime/lib/js_helper.dart _interceptors: _internal/js_runtime/lib/interceptors.dart _foreign_helper: _internal/js_runtime/lib/foreign_helper.dart -_isolate_helper: _internal/js_runtime/lib/isolate_helper.dart _js_names: _internal/js_runtime/lib/js_names.dart _js_primitives: _internal/js_runtime/lib/js_primitives.dart _js_embedded_names: _internal/js_runtime/lib/shared/embedded_names.dart diff --git a/sdk/lib/dart_server.platform b/sdk/lib/dart_server.platform index 7b72e6760c3..290e1ef6544 100644 --- a/sdk/lib/dart_server.platform +++ b/sdk/lib/dart_server.platform @@ -44,7 +44,6 @@ _internal: internal/internal.dart _js_helper: _internal/js_runtime/lib/js_helper.dart _interceptors: _internal/js_runtime/lib/interceptors.dart _foreign_helper: _internal/js_runtime/lib/foreign_helper.dart -_isolate_helper: _internal/js_runtime/lib/isolate_helper.dart _js_names: _internal/js_runtime/lib/js_names.dart _js_primitives: _internal/js_runtime/lib/js_primitives.dart _js_embedded_names: _internal/js_runtime/lib/shared/embedded_names.dart diff --git a/sdk/lib/dart_shared.platform b/sdk/lib/dart_shared.platform index b9006e12938..e8aa11c21fd 100644 --- a/sdk/lib/dart_shared.platform +++ b/sdk/lib/dart_shared.platform @@ -41,7 +41,6 @@ _internal: internal/internal.dart _js_helper: _internal/js_runtime/lib/js_helper.dart _interceptors: _internal/js_runtime/lib/interceptors.dart _foreign_helper: _internal/js_runtime/lib/foreign_helper.dart -_isolate_helper: _internal/js_runtime/lib/isolate_helper.dart _js_names: _internal/js_runtime/lib/js_names.dart _js_primitives: _internal/js_runtime/lib/js_primitives.dart _js_embedded_names: _internal/js_runtime/lib/shared/embedded_names.dart diff --git a/sdk/lib/libraries.json b/sdk/lib/libraries.json index 966cd97f10d..9f3f684db43 100644 --- a/sdk/lib/libraries.json +++ b/sdk/lib/libraries.json @@ -245,9 +245,6 @@ "patches": "_internal/js_runtime/lib/convert_patch.dart", "uri": "convert/convert.dart" }, - "_isolate_helper": { - "uri": "_internal/js_runtime/lib/isolate_helper.dart" - }, "math": { "patches": "_internal/js_runtime/lib/math_patch.dart", "uri": "math/math.dart" @@ -342,9 +339,6 @@ "patches": "_internal/js_runtime/lib/convert_patch.dart", "uri": "convert/convert.dart" }, - "_isolate_helper": { - "uri": "_internal/js_runtime/lib/isolate_helper.dart" - }, "math": { "patches": "_internal/js_runtime/lib/math_patch.dart", "uri": "math/math.dart" diff --git a/sdk/lib/libraries.yaml b/sdk/lib/libraries.yaml index 09e8e6ff8d3..92c2391acff 100644 --- a/sdk/lib/libraries.yaml +++ b/sdk/lib/libraries.yaml @@ -242,9 +242,6 @@ dart2js: _foreign_helper: uri: "_internal/js_runtime/lib/foreign_helper.dart" - _isolate_helper: - uri: "_internal/js_runtime/lib/isolate_helper.dart" - _js_names: uri: "_internal/js_runtime/lib/js_names.dart" @@ -334,9 +331,6 @@ dart2js_server: _foreign_helper: uri: "_internal/js_runtime/lib/foreign_helper.dart" - _isolate_helper: - uri: "_internal/js_runtime/lib/isolate_helper.dart" - _js_names: uri: "_internal/js_runtime/lib/js_names.dart" diff --git a/tests/compiler/dart2js_extra/dummy_compiler_test.dart b/tests/compiler/dart2js_extra/dummy_compiler_test.dart index 3e3a64f1489..0c13dbb4d6c 100644 --- a/tests/compiler/dart2js_extra/dummy_compiler_test.dart +++ b/tests/compiler/dart2js_extra/dummy_compiler_test.dart @@ -27,8 +27,6 @@ String libProvider(Uri uri) { return buildLibrarySource(DEFAULT_INTERCEPTORS_LIBRARY); } else if (uri.path.endsWith('js_helper.dart')) { return buildLibrarySource(DEFAULT_JS_HELPER_LIBRARY); - } else if (uri.path.endsWith('isolate_helper.dart')) { - return buildLibrarySource(DEFAULT_ISOLATE_HELPER_LIBRARY); } else if (uri.path.endsWith('/async.dart')) { return buildLibrarySource(DEFAULT_ASYNC_LIBRARY); } else { diff --git a/tests/compiler/dart2js_extra/mock_libraries.dart b/tests/compiler/dart2js_extra/mock_libraries.dart index f5f6e63ec4c..025f221354d 100644 --- a/tests/compiler/dart2js_extra/mock_libraries.dart +++ b/tests/compiler/dart2js_extra/mock_libraries.dart @@ -13,7 +13,6 @@ async:async/async.dart _js_helper:_internal/js_runtime/lib/js_helper.dart _interceptors:_internal/js_runtime/lib/interceptors.dart _internal:internal/internal.dart -_isolate_helper:_internal/js_runtime/lib/isolate_helper.dart """; String buildLibrarySource(Map elementMap, @@ -130,7 +129,6 @@ class Symbol implements core.Symbol { const String DEFAULT_PATCH_CORE_SOURCE = r''' import 'dart:_js_helper'; import 'dart:_interceptors'; -import 'dart:_isolate_helper'; import 'dart:async'; @patch @@ -436,14 +434,6 @@ const Map DEFAULT_INTERCEPTORS_LIBRARY = const { 'JavaScriptFunction': 'class JavaScriptFunction {}', }; -const Map DEFAULT_ISOLATE_HELPER_LIBRARY = - const { - 'startRootIsolate': 'void startRootIsolate(entry, args) {}', - '_currentIsolate': 'var _currentIsolate;', - '_callInIsolate': 'var _callInIsolate;', - '_WorkerBase': 'class _WorkerBase {}', -}; - const Map DEFAULT_ASYNC_LIBRARY = const { 'DeferredLibrary': 'class DeferredLibrary {}', 'Future': ''' diff --git a/tests/compiler/dart2js_native/compute_this_script_test.dart b/tests/compiler/dart2js_native/compute_this_script_test.dart index 2cdfb5279ba..fcf45391c0c 100644 --- a/tests/compiler/dart2js_native/compute_this_script_test.dart +++ b/tests/compiler/dart2js_native/compute_this_script_test.dart @@ -2,17 +2,15 @@ // 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. -// Test of IsolateNatives.computeThisScript(). +// Test of _computeThisScript(). -import 'dart:_isolate_helper'; +import 'dart:_js_helper' show thisScript; main() { - String script = computeThisScript(); - // This is somewhat brittle and relies on an implementation detail // of our test runner, but I can think of no other way to test this. // -- ahe - if (!script.endsWith('/out.js')) { - throw 'Unexpected script: "$script"'; + if (!thisScript.endsWith('/out.js')) { + throw 'Unexpected script: "$thiscript"'; } }