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

Side by Side Diff: site/try/src/leap.dart

Issue 408783002: Enable Try Dart to run on IE11. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: removed dynamic, marked one test as Fail on IE11 Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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.main; 5 library trydart.main;
6 6
7 import 'dart:html' show 7 import 'dart:html' show
8 HttpRequest, 8 HttpRequest,
9 LinkElement, 9 LinkElement,
10 querySelector, 10 querySelector,
(...skipping 13 matching lines...) Expand all
24 EXAMPLE_HELLO; 24 EXAMPLE_HELLO;
25 25
26 import 'ui.dart' show 26 import 'ui.dart' show
27 buildUI, 27 buildUI,
28 interaction, 28 interaction,
29 observer; 29 observer;
30 30
31 import 'user_option.dart' show 31 import 'user_option.dart' show
32 UserOption; 32 UserOption;
33 33
34 import 'settings.dart' show
35 alwaysRunInIframe,
36 communicateViaBlobs;
37
38 bool isBrowserIE() {
39 return window.navigator.userAgent.contains(' Trident/7.0;');
40 }
41
42 initHiddenSettings() {
43 alwaysRunInIframe.setIfNotInitialized(isBrowserIE);
44 communicateViaBlobs.setIfNotInitialized(() => !isBrowserIE());
45 }
46
34 int count = 0; 47 int count = 0;
35 48
36 main() { 49 main() {
37 UserOption.storage = window.localStorage; 50 UserOption.storage = window.localStorage;
38 if (currentSource == null) { 51 if (currentSource == null) {
39 currentSource = EXAMPLE_HELLO; 52 currentSource = EXAMPLE_HELLO;
40 } 53 }
41 54
55 initHiddenSettings();
56
42 buildUI(); 57 buildUI();
43 ReceivePort port = new ReceivePort(); 58 ReceivePort port = new ReceivePort();
44 Isolate.spawnUri( 59 Isolate.spawnUri(
45 Uri.base.resolve('compiler_isolate.dart.js'), 60 Uri.base.resolve('compiler_isolate.dart.js'),
46 const <String>[], port.sendPort).then((Isolate isolate) { 61 const <String>[], port.sendPort).then((Isolate isolate) {
47 LinkElement link = querySelector('link[rel="dart-sdk"]'); 62 LinkElement link = querySelector('link[rel="dart-sdk"]');
48 String sdk = link.href; 63 String sdk = link.href;
49 print('Using Dart SDK: $sdk'); 64 print('Using Dart SDK: $sdk');
50 int messageCount = 0; 65 int messageCount = 0;
51 SendPort sendPort; 66 SendPort sendPort;
(...skipping 10 matching lines...) Expand all
62 interaction.onMutation([], observer); 77 interaction.onMutation([], observer);
63 break; 78 break;
64 default: 79 default:
65 // TODO(ahe): Close [port]? 80 // TODO(ahe): Close [port]?
66 print('Unexpected message received: $message'); 81 print('Unexpected message received: $message');
67 break; 82 break;
68 } 83 }
69 }); 84 });
70 }); 85 });
71 } 86 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698