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

Unified Diff: pkg/browser/lib/interop.js

Issue 16592002: Move interop js code out of dart.js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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
« no previous file with comments | « pkg/browser/lib/dart.js ('k') | tools/testing/dart/browser_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/browser/lib/interop.js
diff --git a/runtime/bin/vmstats/packages/browser/dart.js b/pkg/browser/lib/interop.js
similarity index 84%
copy from runtime/bin/vmstats/packages/browser/dart.js
copy to pkg/browser/lib/interop.js
index bf60f52cc0f53be9a7bf74855d34f0dbfe34d3e7..52cc966cdb200a57402da7387b8e4aa5012f5be8 100644
--- a/runtime/bin/vmstats/packages/browser/dart.js
+++ b/pkg/browser/lib/interop.js
@@ -1,41 +1,9 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// Bootstrap support for Dart scripts on the page as this script.
-if (navigator.webkitStartDart) {
- if (!navigator.webkitStartDart()) {
- document.body.innerHTML = 'This build has expired. Please download a new Dartium at http://www.dartlang.org/dartium/index.html';
- }
-} else {
- // TODO:
- // - Support in-browser compilation.
- // - Handle inline Dart scripts.
- window.addEventListener("DOMContentLoaded", function (e) {
- // Fall back to compiled JS. Run through all the scripts and
- // replace them if they have a type that indicate that they source
- // in Dart code.
- //
- // <script type="application/dart" src="..."></script>
- //
- var scripts = document.getElementsByTagName("script");
- var length = scripts.length;
- for (var i = 0; i < length; ++i) {
- if (scripts[i].type == "application/dart") {
- // Remap foo.dart to foo.dart.js.
- if (scripts[i].src && scripts[i].src != '') {
- var script = document.createElement('script');
- script.src = scripts[i].src + '.js';
- var parent = scripts[i].parentNode;
- parent.replaceChild(script, scripts[i]);
- }
- }
- }
- }, false);
-}
-
// ---------------------------------------------------------------------------
-// Experimental support for JS interoperability
+// Support for JS interoperability
// ---------------------------------------------------------------------------
function SendPortSync() {
}
« no previous file with comments | « pkg/browser/lib/dart.js ('k') | tools/testing/dart/browser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698