| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 onError(event.message); | 236 onError(event.message); |
| 237 }); | 237 }); |
| 238 } | 238 } |
| 239 | 239 |
| 240 onDiagnostic(Map<String, dynamic> diagnostic) { | 240 onDiagnostic(Map<String, dynamic> diagnostic) { |
| 241 String kind = diagnostic['kind']; | 241 String kind = diagnostic['kind']; |
| 242 String message = diagnostic['message']; | 242 String message = diagnostic['message']; |
| 243 if (kind == 'verbose info') { | 243 if (kind == 'verbose info') { |
| 244 if (verboseCompiler) { | 244 if (verboseCompiler) { |
| 245 consolePrint(message); | 245 consolePrint(message); |
| 246 } else { |
| 247 console.appendText('.'); |
| 246 } | 248 } |
| 247 return; | 249 return; |
| 248 } | 250 } |
| 249 String uri = diagnostic['uri']; | 251 String uri = diagnostic['uri']; |
| 250 if (uri == null) { | 252 if (uri == null) { |
| 251 clear(); | 253 clear(); |
| 252 consolePrint(message); | 254 consolePrint(message); |
| 253 return; | 255 return; |
| 254 } | 256 } |
| 255 if (uri != 'memory:/main.dart') return; | 257 if (uri != 'memory:/main.dart') return; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 276 port.send(replyTo.sendPort); | 278 port.send(replyTo.sendPort); |
| 277 replyTo.listen((message) { | 279 replyTo.listen((message) { |
| 278 List list = message as List; | 280 List list = message as List; |
| 279 try { | 281 try { |
| 280 compile(list[0], list[1]); | 282 compile(list[0], list[1]); |
| 281 } catch (exception, stack) { | 283 } catch (exception, stack) { |
| 282 port.send('$exception\n$stack'); | 284 port.send('$exception\n$stack'); |
| 283 } | 285 } |
| 284 }); | 286 }); |
| 285 } | 287 } |
| OLD | NEW |