fix(zone.js): remove unused Promise overwritten setter logic (#36851)
In the early Zone.js versions (< 0.10.3), `ZoneAwarePromise` did not support `Symbol.species`, so when user used a 3rd party `Promise` such as `es6-promise`, and try to load the promise library after import of `zone.js`, the loading promise library will overwrite the patched `Promise` from `zone.js` and will break `Promise` semantics with respect to `zone.js`. Starting with `zone.js` 0.10.3, `Symbol.species` is supported therefore this will not longer be an issue. (https://github.com//pull/34533) Before 0.10.3, the logic in zone.js tried to handle the case in the wrong way. It did so by overriding the descriptor of `global.Promise`, to allow the 3rd party libraries to override native `Promise` instead of `ZoneAwarePromise`. This is not the correct solution, and since the `Promise.species` is now supported, the 3rd party solution of overriding `global.Promise` is no longer needed. PR removes the wrong work around logic. (This will improve the bundle size.) PR Close #36851
This commit is contained in:

committed by
Misko Hevery

parent
9b8eb42354
commit
c909e731d7
@ -3,8 +3,8 @@
|
||||
"master": {
|
||||
"uncompressed": {
|
||||
"runtime-es2015": 1485,
|
||||
"main-es2015": 141394,
|
||||
"polyfills-es2015": 36963
|
||||
"main-es2015": 141151,
|
||||
"polyfills-es2015": 36571
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -22,7 +22,7 @@
|
||||
"uncompressed": {
|
||||
"runtime-es2015": 1485,
|
||||
"main-es2015": 147314,
|
||||
"polyfills-es2015": 36963
|
||||
"polyfills-es2015": 36571
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user