This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree 4 files changed +18
-12
lines changed
4 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -1135,12 +1135,13 @@ module.exports = {
1135
1135
// TODO(vicb): Create a benchmark for the different methods & the usage of the queue
1136
1136
// see https://github.com/angular/zone.js/issues/97
1137
1137
1138
- var hasNativePromise = false ;
1139
1138
var len = 0 ;
1140
1139
1141
- if ( typeof Promise == ! "undefined" && Promise . toString ( ) . indexOf ( "[native code]" ) !== - 1 ) {
1142
- hasNativePromise = true ;
1143
- }
1140
+ var hasNativePromise = typeof Promise == ! "undefined" &&
1141
+ Promise . toString ( ) . indexOf ( "[native code]" ) !== - 1 ;
1142
+
1143
+ var isFirefox = global . navigator &&
1144
+ global . navigator . userAgent . toLowerCase ( ) . indexOf ( 'firefox' ) > - 1 ;
1144
1145
1145
1146
function asap ( callback ) {
1146
1147
queue [ len ] = callback ;
@@ -1206,7 +1207,9 @@ function flush() {
1206
1207
1207
1208
var scheduleFlush ;
1208
1209
// Decide what async method to use to triggering processing of queued callbacks:
1209
- if ( hasNativePromise ) {
1210
+ if ( hasNativePromise && ! isFirefox ) {
1211
+ // TODO(vicb): remove '!isFirefox' when the bug is fixed:
1212
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=1162013
1210
1213
scheduleFlush = usePromise ( ) ;
1211
1214
} else if ( BrowserMutationObserver ) {
1212
1215
scheduleFlush = useMutationObserver ( ) ;
You can’t perform that action at this time.
0 commit comments