Index: sdk/lib/html/html_common/conversions_dart2js.dart |
diff --git a/sdk/lib/html/html_common/conversions_dart2js.dart b/sdk/lib/html/html_common/conversions_dart2js.dart |
index d0b7d77e217a968c4d22fccfa6867c41efa33dc8..ac5b7554de34e5956e2ec596a4299dd9d1850916 100644 |
--- a/sdk/lib/html/html_common/conversions_dart2js.dart |
+++ b/sdk/lib/html/html_common/conversions_dart2js.dart |
@@ -81,7 +81,8 @@ bool isJavaScriptSimpleObject(value) { |
} |
bool isImmutableJavaScriptArray(value) => |
JS('bool', r'!!(#.immutable$list)', value); |
-bool isJavaScriptPromise(value) => JS('bool', r'# instanceof Promise', value); |
+bool isJavaScriptPromise(value) => |
+ JS('bool', r'typeof Promise != "undefined" && # instanceof Promise', value); |
Future convertNativePromiseToDartFuture(promise) { |
var completer = new Completer(); |