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

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

Issue 10781019: Fix compilation for Opera. (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
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 2b361b8349feeae8a49a01e948dbddd84356d95b..1d786cefdfc9abcc62b259eec7353bf1d00c52dd 100644
--- a/lib/compiler/implementation/lib/native_helper.dart
+++ b/lib/compiler/implementation/lib/native_helper.dart
@@ -9,6 +9,12 @@ String typeNameInChrome(obj) {
return name;
}
+String typeNameInOpera(obj) {
+ String name = constructorNameFallback(obj);
+ if (name == 'Window') return 'DOMWindow';
+ return name;
+}
+
String typeNameInFirefox(obj) {
String name = constructorNameFallback(obj);
if (name == 'Window') return 'DOMWindow';
@@ -49,7 +55,8 @@ String constructorNameFallback(obj) {
// below in that case.
if (JS('String', "typeof(#)", name) === 'string'
&& !name.isEmpty()
- && name !== 'Object') {
+ && name !== 'Object'
+ && name !== 'Function.prototype') { // Can happen in Opera.
return name;
}
}
@@ -72,6 +79,8 @@ Function getFunctionForTypeNameOf() {
return typeNameInFirefox;
} else if (userAgent.contains('MSIE')) {
return typeNameInIE;
+ } else if (userAgent.contains('Opera')) {
+ return typeNameInOpera;
} else {
return constructorNameFallback;
}
« lib/compiler/implementation/emitter.dart ('K') | « lib/compiler/implementation/emitter.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698