diff --git a/nativescript-angular/zone-js/dist/zone-nativescript.js b/nativescript-angular/zone-js/dist/zone-nativescript.js index 7eb6799a8..95756327a 100644 --- a/nativescript-angular/zone-js/dist/zone-nativescript.js +++ b/nativescript-angular/zone-js/dist/zone-nativescript.js @@ -1019,41 +1019,42 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) { ZoneAwarePromise['all'] = ZoneAwarePromise.all; var NativePromise = global[symbolPromise] = global['Promise']; var ZONE_AWARE_PROMISE = Zone.__symbol__('ZoneAwarePromise'); - var desc = ObjectGetOwnPropertyDescriptor(global, 'Promise'); - if (!desc || desc.configurable) { - desc && delete desc.writable; - desc && delete desc.value; - if (!desc) { - desc = { configurable: true, enumerable: true }; - } - desc.get = function () { - // if we already set ZoneAwarePromise, use patched one - // otherwise return native one. - return global[ZONE_AWARE_PROMISE] ? global[ZONE_AWARE_PROMISE] : global[symbolPromise]; - }; - desc.set = function (NewNativePromise) { - if (NewNativePromise === ZoneAwarePromise) { - // if the NewNativePromise is ZoneAwarePromise - // save to global - global[ZONE_AWARE_PROMISE] = NewNativePromise; - } - else { - // if the NewNativePromise is not ZoneAwarePromise - // for example: after load zone.js, some library just - // set es6-promise to global, if we set it to global - // directly, assertZonePatched will fail and angular - // will not loaded, so we just set the NewNativePromise - // to global[symbolPromise], so the result is just like - // we load ES6 Promise before zone.js - global[symbolPromise] = NewNativePromise; - if (!NewNativePromise.prototype[symbolThen]) { - patchThen(NewNativePromise); - } - api.setNativePromise(NewNativePromise); - } - }; - ObjectDefineProperty(global, 'Promise', desc); - } + // NOTE(NativeScript): Defining the Promise property descriptor this way causes + // problems with V8 snapshot for Android. Just skip it. + // let desc = ObjectGetOwnPropertyDescriptor(global, 'Promise'); + // if (!desc || desc.configurable) { + // desc && delete desc.writable; + // desc && delete desc.value; + // if (!desc) { + // desc = {configurable: true, enumerable: true}; + // } + // desc.get = function() { + // // if we already set ZoneAwarePromise, use patched one + // // otherwise return native one. + // return global[ZONE_AWARE_PROMISE] ? global[ZONE_AWARE_PROMISE] : global[symbolPromise]; + // }; + // desc.set = function(NewNativePromise) { + // if (NewNativePromise === ZoneAwarePromise) { + // // if the NewNativePromise is ZoneAwarePromise + // // save to global + // global[ZONE_AWARE_PROMISE] = NewNativePromise; + // } else { + // // if the NewNativePromise is not ZoneAwarePromise + // // for example: after load zone.js, some library just + // // set es6-promise to global, if we set it to global + // // directly, assertZonePatched will fail and angular + // // will not loaded, so we just set the NewNativePromise + // // to global[symbolPromise], so the result is just like + // // we load ES6 Promise before zone.js + // global[symbolPromise] = NewNativePromise; + // if (!NewNativePromise.prototype[symbolThen]) { + // patchThen(NewNativePromise); + // } + // api.setNativePromise(NewNativePromise); + // } + // }; + // ObjectDefineProperty(global, 'Promise', desc); + // } global['Promise'] = ZoneAwarePromise; var symbolThenPatched = __symbol__('thenPatched'); function patchThen(Ctor) {