Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 /** | 5 /** |
| 6 * Compiles Dart Web Components from within a Chrome extension. | 6 * Compiles Dart Web Components from within a Chrome extension. |
| 7 * The Chrome extension logic exists outside of Dart as Dart does not support | 7 * The Chrome extension logic exists outside of Dart as Dart does not support |
| 8 * Chrome extension APIs at this time. | 8 * Chrome extension APIs at this time. |
| 9 */ | 9 */ |
| 10 library dwc_browser; | 10 library dwc_browser; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 // TODO(jacobr): provide a way to pass in options. | 43 // TODO(jacobr): provide a way to pass in options. |
| 44 var options = CompilerOptions.parse(['--no-colors', uri.path]); | 44 var options = CompilerOptions.parse(['--no-colors', uri.path]); |
| 45 messages = new Messages(options: options); | 45 messages = new Messages(options: options); |
| 46 asyncTime('Compiled $sourceUri', () { | 46 asyncTime('Compiled $sourceUri', () { |
| 47 var compiler = new Compiler(fileSystem, options); | 47 var compiler = new Compiler(fileSystem, options); |
| 48 return compiler.run().chain((_) { | 48 return compiler.run().chain((_) { |
| 49 for (var file in compiler.output) { | 49 for (var file in compiler.output) { |
| 50 fileSystem.writeString(file.path, file.contents); | 50 fileSystem.writeString(file.path, file.contents); |
| 51 } | 51 } |
| 52 var ret = fileSystem.flush(); | 52 var ret = fileSystem.flush(); |
| 53 js.scoped(() { | |
| 54 js.context.proxyMessages(sourcePagePort, | |
|
Jennifer Messerly
2012/12/06 04:00:08
out of curiousity, can you inline proxyMessages?
Siggi Cherem (dart-lang)
2012/12/06 18:46:42
yes, I believe so, I wasn't sure if 'map' worked o
| |
| 55 js.array(messages.messages.map((m) => m.toString()))); | |
| 56 }); | |
| 53 js.release(sourcePagePort); | 57 js.release(sourcePagePort); |
| 54 return ret; | 58 return ret; |
| 55 }); | 59 }); |
| 56 }, printTime: true); | 60 }, printTime: true); |
| 57 } | 61 } |
| OLD | NEW |