Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
135 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
description: 'do not remove promise creations', | ||
options: { name: 'bundle' } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
define(['exports'], function (exports) { 'use strict'; | ||
|
||
const p1 = new Promise( () => { | ||
console.log( 'fire & forget' ); | ||
} ); | ||
|
||
const p2 = new Promise( () => { | ||
console.info( 'forget me as well' ); | ||
} ); | ||
|
||
const p3 = new Promise( () => { | ||
console.info( 'and me too' ); | ||
} ); | ||
|
||
const p5 = Promise.reject('should be kept for uncaught rejections'); | ||
|
||
const allExported = Promise.all([p2, p3]); | ||
|
||
exports.allExported = allExported; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
const p1 = new Promise( () => { | ||
console.log( 'fire & forget' ); | ||
} ); | ||
|
||
const p2 = new Promise( () => { | ||
console.info( 'forget me as well' ); | ||
} ); | ||
|
||
const p3 = new Promise( () => { | ||
console.info( 'and me too' ); | ||
} ); | ||
|
||
const p5 = Promise.reject('should be kept for uncaught rejections'); | ||
|
||
const allExported = Promise.all([p2, p3]); | ||
|
||
exports.allExported = allExported; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const p1 = new Promise( () => { | ||
console.log( 'fire & forget' ); | ||
} ); | ||
|
||
const p2 = new Promise( () => { | ||
console.info( 'forget me as well' ); | ||
} ); | ||
|
||
const p3 = new Promise( () => { | ||
console.info( 'and me too' ); | ||
} ); | ||
|
||
const p5 = Promise.reject('should be kept for uncaught rejections'); | ||
|
||
const allExported = Promise.all([p2, p3]); | ||
|
||
export { allExported }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
var bundle = (function (exports) { | ||
'use strict'; | ||
|
||
const p1 = new Promise( () => { | ||
console.log( 'fire & forget' ); | ||
} ); | ||
|
||
const p2 = new Promise( () => { | ||
console.info( 'forget me as well' ); | ||
} ); | ||
|
||
const p3 = new Promise( () => { | ||
console.info( 'and me too' ); | ||
} ); | ||
|
||
const p5 = Promise.reject('should be kept for uncaught rejections'); | ||
|
||
const allExported = Promise.all([p2, p3]); | ||
|
||
exports.allExported = allExported; | ||
|
||
return exports; | ||
|
||
}({})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.bundle = {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
|
||
const p1 = new Promise( () => { | ||
console.log( 'fire & forget' ); | ||
} ); | ||
|
||
const p2 = new Promise( () => { | ||
console.info( 'forget me as well' ); | ||
} ); | ||
|
||
const p3 = new Promise( () => { | ||
console.info( 'and me too' ); | ||
} ); | ||
|
||
const p5 = Promise.reject('should be kept for uncaught rejections'); | ||
|
||
const allExported = Promise.all([p2, p3]); | ||
|
||
exports.allExported = allExported; | ||
|
||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
|
||
}))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const p1 = new Promise( () => { | ||
console.log( 'fire & forget' ); | ||
} ); | ||
|
||
const p2 = new Promise( () => { | ||
console.info( 'forget me as well' ); | ||
} ); | ||
|
||
const p3 = new Promise( () => { | ||
console.info( 'and me too' ); | ||
} ); | ||
|
||
const p4 = Promise.resolve('no side effect'); | ||
const p5 = Promise.reject('should be kept for uncaught rejections'); | ||
|
||
const all = Promise.all([p2, p3]); | ||
export const allExported = Promise.all([p2, p3]); | ||
const race = Promise.race([p2, p3]); |