@@ -1019,41 +1019,42 @@ Zone.__load_patch('ZoneAwarePromise', function (global, Zone, api) {
1019
1019
ZoneAwarePromise [ 'all' ] = ZoneAwarePromise . all ;
1020
1020
var NativePromise = global [ symbolPromise ] = global [ 'Promise' ] ;
1021
1021
var ZONE_AWARE_PROMISE = Zone . __symbol__ ( 'ZoneAwarePromise' ) ;
1022
- var desc = ObjectGetOwnPropertyDescriptor ( global , 'Promise' ) ;
1023
- if ( ! desc || desc . configurable ) {
1024
- desc && delete desc . writable ;
1025
- desc && delete desc . value ;
1026
- if ( ! desc ) {
1027
- desc = { configurable : true , enumerable : true } ;
1028
- }
1029
- desc . get = function ( ) {
1030
- // if we already set ZoneAwarePromise, use patched one
1031
- // otherwise return native one.
1032
- return global [ ZONE_AWARE_PROMISE ] ? global [ ZONE_AWARE_PROMISE ] : global [ symbolPromise ] ;
1033
- } ;
1034
- desc . set = function ( NewNativePromise ) {
1035
- if ( NewNativePromise === ZoneAwarePromise ) {
1036
- // if the NewNativePromise is ZoneAwarePromise
1037
- // save to global
1038
- global [ ZONE_AWARE_PROMISE ] = NewNativePromise ;
1039
- }
1040
- else {
1041
- // if the NewNativePromise is not ZoneAwarePromise
1042
- // for example: after load zone.js, some library just
1043
- // set es6-promise to global, if we set it to global
1044
- // directly, assertZonePatched will fail and angular
1045
- // will not loaded, so we just set the NewNativePromise
1046
- // to global[symbolPromise], so the result is just like
1047
- // we load ES6 Promise before zone.js
1048
- global [ symbolPromise ] = NewNativePromise ;
1049
- if ( ! NewNativePromise . prototype [ symbolThen ] ) {
1050
- patchThen ( NewNativePromise ) ;
1051
- }
1052
- api . setNativePromise ( NewNativePromise ) ;
1053
- }
1054
- } ;
1055
- ObjectDefineProperty ( global , 'Promise' , desc ) ;
1056
- }
1022
+ // NOTE(NativeScript): Defining the Promise property descriptor this way causes
1023
+ // problems with V8 snapshot for Android. Just skip it.
1024
+ // let desc = ObjectGetOwnPropertyDescriptor(global, 'Promise');
1025
+ // if (!desc || desc.configurable) {
1026
+ // desc && delete desc.writable;
1027
+ // desc && delete desc.value;
1028
+ // if (!desc) {
1029
+ // desc = {configurable: true, enumerable: true};
1030
+ // }
1031
+ // desc.get = function() {
1032
+ // // if we already set ZoneAwarePromise, use patched one
1033
+ // // otherwise return native one.
1034
+ // return global[ZONE_AWARE_PROMISE] ? global[ZONE_AWARE_PROMISE] : global[symbolPromise];
1035
+ // };
1036
+ // desc.set = function(NewNativePromise) {
1037
+ // if (NewNativePromise === ZoneAwarePromise) {
1038
+ // // if the NewNativePromise is ZoneAwarePromise
1039
+ // // save to global
1040
+ // global[ZONE_AWARE_PROMISE] = NewNativePromise;
1041
+ // } else {
1042
+ // // if the NewNativePromise is not ZoneAwarePromise
1043
+ // // for example: after load zone.js, some library just
1044
+ // // set es6-promise to global, if we set it to global
1045
+ // // directly, assertZonePatched will fail and angular
1046
+ // // will not loaded, so we just set the NewNativePromise
1047
+ // // to global[symbolPromise], so the result is just like
1048
+ // // we load ES6 Promise before zone.js
1049
+ // global[symbolPromise] = NewNativePromise;
1050
+ // if (!NewNativePromise.prototype[symbolThen]) {
1051
+ // patchThen(NewNativePromise);
1052
+ // }
1053
+ // api.setNativePromise(NewNativePromise);
1054
+ // }
1055
+ // };
1056
+ // ObjectDefineProperty(global, 'Promise', desc);
1057
+ // }
1057
1058
global [ 'Promise' ] = ZoneAwarePromise ;
1058
1059
var symbolThenPatched = __symbol__ ( 'thenPatched' ) ;
1059
1060
function patchThen ( Ctor ) {
0 commit comments