| 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 library trydart.compilation; | 5 library trydart.compilation; |
| 6 | 6 |
| 7 import 'dart:html' show | 7 import 'dart:html' show |
| 8 Blob, | 8 Blob, |
| 9 Element, | 9 Element, |
| 10 ErrorEvent, | 10 ErrorEvent, |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 int end = diagnostic['end']; | 284 int end = diagnostic['end']; |
| 285 if (begin == null) return; | 285 if (begin == null) return; |
| 286 addDiagnostic(kind, message, begin, end); | 286 addDiagnostic(kind, message, begin, end); |
| 287 } | 287 } |
| 288 | 288 |
| 289 onCrash(data) { | 289 onCrash(data) { |
| 290 consolePrint(data); | 290 consolePrint(data); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void consolePrint(message) { | 293 void consolePrint(message) { |
| 294 if (window.parent != window) { |
| 295 // Test support. |
| 296 window.parent.postMessage('$message\n', '/'); |
| 297 } |
| 294 console.appendText('$message\n'); | 298 console.appendText('$message\n'); |
| 295 } | 299 } |
| 296 } | 300 } |
| 297 | 301 |
| 298 void compilerIsolate(SendPort port) { | 302 void compilerIsolate(SendPort port) { |
| 299 // TODO(ahe): Restore when restoring deferred loading. | 303 // TODO(ahe): Restore when restoring deferred loading. |
| 300 // lazy.load().then((_) => port.listen(compile)); | 304 // lazy.load().then((_) => port.listen(compile)); |
| 301 ReceivePort replyTo = new ReceivePort(); | 305 ReceivePort replyTo = new ReceivePort(); |
| 302 port.send(replyTo.sendPort); | 306 port.send(replyTo.sendPort); |
| 303 replyTo.listen((message) { | 307 replyTo.listen((message) { |
| 304 List list = message as List; | 308 List list = message as List; |
| 305 try { | 309 try { |
| 306 compile(list[0], list[1]); | 310 compile(list[0], list[1]); |
| 307 } catch (exception, stack) { | 311 } catch (exception, stack) { |
| 308 port.send('$exception\n$stack'); | 312 port.send('$exception\n$stack'); |
| 309 } | 313 } |
| 310 }); | 314 }); |
| 311 var notTrue = false; // Confuse the analyzer. | 315 var notTrue = false; // Confuse the analyzer. |
| 312 if (notTrue) { | 316 if (notTrue) { |
| 313 cacheCompiler.compilerFor(null); | 317 cacheCompiler.compilerFor(null); |
| 314 } | 318 } |
| 315 } | 319 } |
| OLD | NEW |