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

Unified Diff: dart/tests/try/web/incremental_compilation_update.html

Issue 641143002: Perform incremental compilation, and run the updated program. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r41074. Created 6 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: dart/tests/try/web/incremental_compilation_update.html
diff --git a/dart/tests/try/web/incremental_compilation_update.html b/dart/tests/try/web/incremental_compilation_update.html
index d929ba9d14acdfd93233e1fe3ec9dbdf70349d24..54e929f61e5155cc4fb0f991096b8ee4ada8d320 100644
--- a/dart/tests/try/web/incremental_compilation_update.html
+++ b/dart/tests/try/web/incremental_compilation_update.html
@@ -13,16 +13,20 @@
<pre id="console"></pre>
<script type="application/javascript" src="print.js"></script>
<script type="application/javascript">
-/// Invoked by JavaScript code generated by dart2js when the program is ready
-/// to invoke main.
-function dartMainRunner(main) {
- // Invoke the "main" method of the Dart program.
- main();
-
- // Let the sandbox embedder know that main is done running.
- window.parent.postMessage('iframe-dart-main-done', '*');
-}
(function() {
+ var dartMainClosure;
+
+ /// Invoked by JavaScript code generated by dart2js when the program is ready
+ /// to invoke main.
+ self.dartMainRunner = function dartMainRunner(main) {
+ dartMainClosure = main;
+
+ // Invoke the "main" method of the Dart program.
+ main();
+
+ // Let the sandbox embedder know that main is done running.
+ window.parent.postMessage('iframe-dart-main-done', '*');
+ }
/// Invoked when a 'message' event is received. Message events are generated
/// with Window.postMessage and used to communicate between this iframe and
@@ -35,6 +39,13 @@ function dartMainRunner(main) {
script.src = e.data[1];
script.type = 'application/javascript';
document.body.appendChild(script);
+ } else if (e.data[0] === 'apply-update') {
+ self.$dart_unsafe_eval.patch(e.data[1]);
+
+ dartMainClosure();
+
+ // Let the sandbox embedder know that main is done running.
+ window.parent.postMessage('iframe-dart-updated-main-done', '*');
} else {
// Other messages are just logged.
console.log(e);
« no previous file with comments | « dart/pkg/dart2js_incremental/lib/library_updater.dart ('k') | dart/tests/try/web/incremental_compilation_update_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698