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

Unified Diff: lib/compiler/implementation/lib/native_helper.dart

Issue 10836079: Compatibility fix for Safari 6 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/native_helper.dart
diff --git a/lib/compiler/implementation/lib/native_helper.dart b/lib/compiler/implementation/lib/native_helper.dart
index 1b62d327897997d632d87173d6d26f10d37e57f8..5c42d048773b9ef80f7e5b8a3c7ce46e10c0b8ad 100644
--- a/lib/compiler/implementation/lib/native_helper.dart
+++ b/lib/compiler/implementation/lib/native_helper.dart
@@ -10,6 +10,15 @@ String typeNameInChrome(obj) {
return name;
}
+String typeNameInSafari(obj) {
+ String name = constructorNameFallback(obj);
+ // Safari is very similar to Chrome.
+ if (name == 'Window') return 'DOMWindow';
+ if (name == 'CanvasPixelArray') return 'Uint8ClampedArray';
+ if (name == 'WebKitMutationObserver') return 'MutationObserver';
+ return name;
+}
+
String typeNameInOpera(obj) {
String name = constructorNameFallback(obj);
if (name == 'Window') return 'DOMWindow';
@@ -84,6 +93,8 @@ Function getFunctionForTypeNameOf() {
return typeNameInIE;
} else if (userAgent.contains('Opera')) {
return typeNameInOpera;
+ } else if (userAgent.contains('Safari')) {
+ return typeNameInSafari;
} else {
return constructorNameFallback;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698