Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/lib/isolate_patch.dart

Issue 11412242: Fix a use of native JS code to avoid substituting lvalues with '#'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Patch file for the dart:isolate library. 5 // Patch file for the dart:isolate library.
6 6
7 import 'dart:uri'; 7 import 'dart:uri';
8 8
9 /** 9 /**
10 * Called by the compiler to support switching 10 * Called by the compiler to support switching
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 topEventLoop = new _EventLoop(); 181 topEventLoop = new _EventLoop();
182 isolates = new Map<int, _IsolateContext>(); 182 isolates = new Map<int, _IsolateContext>();
183 managers = new Map<int, _ManagerStub>(); 183 managers = new Map<int, _ManagerStub>();
184 if (isWorker) { // "if we are not the main manager ourself" is the intent. 184 if (isWorker) { // "if we are not the main manager ourself" is the intent.
185 mainManager = new _MainManagerStub(); 185 mainManager = new _MainManagerStub();
186 _nativeInitWorkerMessageHandler(); 186 _nativeInitWorkerMessageHandler();
187 } 187 }
188 } 188 }
189 189
190 void _nativeDetectEnvironment() { 190 void _nativeDetectEnvironment() {
191 JS("void", r"#.isWorker = $isWorker", this); 191 isWorker = JS("bool", r"$isWorker");
192 JS("void", r"#.supportsWorkers = $supportsWorkers", this); 192 supportsWorkers = JS("bool", r"$supportsWorkers");
193 JS("void", r"#.fromCommandLine = typeof(window) == 'undefined'", this); 193 fromCommandLine = JS("bool", r"typeof(window) == 'undefined'");
194 } 194 }
195 195
196 void _nativeInitWorkerMessageHandler() { 196 void _nativeInitWorkerMessageHandler() {
197 JS("void", r""" 197 JS("void", r"""
198 $globalThis.onmessage = function (e) { 198 $globalThis.onmessage = function (e) {
199 _IsolateNatives._processWorkerMessage(this.mainManager, e); 199 _IsolateNatives._processWorkerMessage(this.mainManager, e);
200 }"""); 200 }""");
201 } 201 }
202 /*: TODO: check that _processWorkerMessage is not discarded while treeshaking. 202 /*: TODO: check that _processWorkerMessage is not discarded while treeshaking.
203 """ { 203 """ {
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 _window.clearTimeout(_handle); 1281 _window.clearTimeout(_handle);
1282 } else { 1282 } else {
1283 _window.clearInterval(_handle); 1283 _window.clearInterval(_handle);
1284 } 1284 }
1285 } 1285 }
1286 } 1286 }
1287 1287
1288 Timer _timerFactory(int millis, void callback(Timer timer), bool repeating) => 1288 Timer _timerFactory(int millis, void callback(Timer timer), bool repeating) =>
1289 repeating ? new _Timer.repeating(millis, callback) 1289 repeating ? new _Timer.repeating(millis, callback)
1290 : new _Timer(millis, callback); 1290 : new _Timer(millis, callback);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698