ES6PromiseAsync.baseline 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. Executing test #1 - Promise basic behavior
  2. Test #1 - Executor function called synchronously
  3. Executing test #2 - Promise basic error behavior
  4. Test #2 - Executor function called synchronously
  5. Executing test #3 - Promise with multiple then handlers
  6. Executing test #4 - Promise with chained then handlers
  7. Executing test #5 - Promise with a throwing executor function
  8. Executing test #6 - Promise with a potential thenable that throws when getting the 'then' property
  9. Executing test #7 - Promise with a potential thenable that throws when calling the 'then' function
  10. Executing test #8 - Promise with a success handler that throws when called
  11. Executing test #9 - Promise with an error handler that throws when called
  12. Executing test #10 - Promise with an executor function that creates a self-resolution error
  13. Executing test #11 - Promise basic catch behavior
  14. Executing test #12 - Promise chained catch behavior
  15. Executing test #13 - Promise then and catch interleaved
  16. Executing test #14 - Promise identity function is used when no success handler is provided
  17. Executing test #15 - Promise thrower function is used when no error handler is provided
  18. Executing test #16 - Promise.resolve creates a fulfilled resolved promise
  19. Executing test #17 - Promise.resolve called with a promise returns the same promise
  20. Executing test #18 - Promise.reject creates a fulfilled rejected promise
  21. Executing test #19 - Promise.reject called with a promise returns a promise for that promise
  22. Executing test #20 - Promise.race with an object containing a non-function iterator property
  23. Executing test #21 - Promise.race with this argument missing the resolve function
  24. Executing test #22 - Promise.race with this argument resolve function returning a non-object
  25. Executing test #23 - Promise.race with this argument resolve function returning an object with no then function
  26. Executing test #24 - Promise.race with an object containing an iterator that throws
  27. Executing test #25 - Promise.race still returns a rejected promise if anything throws while iterating, even if resolved promises are encountered
  28. Executing test #26 - Promise.race fulfills with the same value as the first encountered resolved promise
  29. Executing test #27 - Promise.race fulfills with the same value as the first encountered resolved promise (promises complete async)
  30. Executing test #28 - Promise.race fulfills with the same value as the first encountered rejected promise (promises complete async)
  31. Executing test #29 - Promise.race passes each element in it's argument to Promise.resolve
  32. Executing test #30 - Promise.all with an object containing a non-function iterator property
  33. Executing test #31 - Promise.all with this argument missing the resolve function
  34. Executing test #32 - Promise.all with this argument resolve function returning a non-object
  35. Executing test #33 - Promise.all with this argument resolve function returning an object with no then function
  36. Executing test #34 - Promise.all with an object containing an iterator that throws
  37. Executing test #35 - Promise.all still returns a rejected promise if anything throws while iterating, even if resolved promises are encountered
  38. Executing test #36 - Promise.all fulfills with the same value as the first encountered rejected promise
  39. Executing test #37 - Promise.all fulfills with the same value as the first encountered rejected promise (async promises)
  40. Executing test #38 - Promise.all fulfills when all promises in iterable fulfill
  41. Executing test #39 - Promise.all passes each element in the arguments to Promise.resolve
  42. Executing test #40 - Promise.all called with empty iterator, calls Promise.resolve synchronously and passes abrupt completion to reject handler
  43. Test #40 - resolve called
  44. Test #40 - reject called: oops
  45. Executing test #41 - Promise.resolve called with a thenable calls then on the thenable
  46. Executing test #42 - Calling promise resolve function with thenable should call thenable.then
  47. Executing test #43 - Promise.all doesn't call then for rejected promises
  48. Executing test #44 - Promise.all with iterator that returns no items
  49. Executing test #45 - Simple tampering of Promise.all promise changes resolved result value
  50. Executing test #46 - Promise.all - can't prevent remaining elements counter from reaching zero
  51. Executing test #47 - Promise from Promise.all never resolved before arguments
  52. Executing test #48 - Promise from Promise.all never resolved if rejected promise in arguments
  53. Executing test #49 - Promise executor resolves with the first call resolve function
  54. Executing test #50 - Promise executor rejects with the first call reject function
  55. Executing test #51 - Promise executor resolves/rejects with the first call to either function
  56. Executing test #52 - Promise executor rejects/resolves with the first call to either function
  57. Executing test #53 - Promise executor rejects/resolves/rejects with the first call to either function
  58. Executing test #54 - Promise executor resolves/rejects/resolves with the first call to either function
  59. Executing test #55 - Promise.prototype.finally - called for resolved promise
  60. Executing test #56 - Promise.prototype.finally - called for rejected promise
  61. Executing test #57 - Promise.prototype.finally passes through result for Reject
  62. Executing test #58 - Promise.prototype.finally passes through result for Resolve
  63. Executing test #59 - Promise.prototype.finally passes through result for Reject with not callable argument
  64. Executing test #60 - Promise.prototype.finally passes through result for Resolve with not callable argument
  65. Executing test #61 - Promise.prototype.finally throws own rejection after a resolved promise
  66. Executing test #62 - Promise.prototype.finally throws own rejection after a rejected promise
  67. Executing test #63 - Ensure Multiple then handlers on a single promise are executed in correct order
  68. Executing test #64 - Promise.allSettled settles when all promises in iterable settle
  69. Executing test #65 - Promise.allSettled settles even if all promises reject
  70. Executing test #66 - Promise.allSettled settles immediately with an empty iterator
  71. Executing test #67 - Promise.allSettled doesn't settle if some promises don't settle
  72. Executing test #68 - Promise.allSettled rejects immediately with an iterator that throws
  73. Executing test #69 - Promise.allSettled resolve and reject functions cannot be called multiple times
  74. Test #69 - Temp then handler called from Promise.allSettled
  75. Executing test #70 - Promise.allSettled passes all elements of iterable to Promise.resolve
  76. Executing test #71 - Promise.allSettled called with empty iterator, calls Promise.resolve synchronously and passes abrupt completion to reject handler
  77. Test #71 - resolve called
  78. Test #71 - reject called: oops
  79. Executing test #72 - Promise.allSettled gets the constructor's resolve function only once
  80. Test #72 - get constructor resolve
  81. Test #72 - constructor resolve called
  82. Test #72 - constructor resolve called
  83. Executing test #73 - Promise.all gets the constructor's resolve function only once
  84. Test #73 - get constructor resolve
  85. Test #73 - constructor resolve called
  86. Test #73 - constructor resolve called
  87. Executing test #74 - Promise.race gets the constructor's resolve function only once
  88. Test #74 - get constructor resolve
  89. Test #74 - constructor resolve called
  90. Test #74 - constructor resolve called
  91. Executing test #75 - Promise.any gets the constructor's resolve function only once
  92. Test #75 - get constructor resolve
  93. Test #75 - constructor resolve called
  94. Test #75 - constructor resolve called
  95. Executing test #76 - Promise.any with an object containing a non-function iterator property
  96. Executing test #77 - Promise.any with this argument missing the resolve function
  97. Executing test #78 - Promise.any with this argument resolve function returning a non-object
  98. Executing test #79 - Promise.any with this argument resolve function returning an object with no then function
  99. Executing test #80 - Promise.any with an object containing an iterator that throws
  100. Executing test #81 - Promise.any still returns a rejected promise if anything throws while iterating, even if resolved promises are encountered
  101. Executing test #82 - Promise.any fulfills with the same value as the first encountered resolved promise
  102. Executing test #83 - Promise.any fulfills with the same value as the first encountered resolved promise (promises complete async)
  103. Executing test #84 - Promise.any fulfills with the same value as the first encountered rejected promise (promises complete async)
  104. Executing test #85 - Promise.any should wait until one resolve
  105. Executing test #86 - Promise.any should wait until all reject
  106. Executing test #87 - Promise.any should not call return
  107. Test #87 - get iterator called
  108. Test #87 - iterator next called: 2
  109. Test #87 - iterator next called: 1
  110. Test #87 - iterator next throw
  111. Executing test #88 - Promise.any should call return once
  112. Test #88 - get iterator called
  113. Test #88 - iterator next called: 2
  114. Test #88 - iterator return called
  115. Executing test #89 - Promise.any should throw TypeError if resolve not a function
  116. Test #89 - resolve getter called
  117. Executing test #90 - Promise.any passes each element in it's argument to Promise.resolve
  118. Executing test #91 - Promise.any should failure with empty list
  119. Executing test #92 - Promise.any should reject with aggregate error and errors
  120. Completion Results:
  121. Test #1 - Success handler called with result = basic:success
  122. Test #2 - Error handler called with err = basic:error
  123. Test #3 - Success handler #1 called with result = multithen:success
  124. Test #3 - Success handler #2 called with result = multithen:success
  125. Test #3 - Success handler #3 called with result = multithen:success
  126. Test #4 - Success handler #1 called with result = chain:success1
  127. Test #5 - Error handler called with err = basic:throw
  128. Test #6 - Success handler #1 called with result = thenable.get:unused
  129. Test #7 - Success handler #1 called with result = thenable.call:unused
  130. Test #8 - Success handler #1 called with result = success.throw:unused
  131. Test #9 - Error handler #1 called with err = error.throw:unused
  132. Test #11 - Catch handler called with err = error
  133. Test #12 - Catch handler #1 called with err = error1
  134. Test #13 - Catch handler #1 called with err = error1
  135. Test #16 - Success handler #1 called with result = resolved promise result
  136. Test #18 - Catch handler #1 called with err = rejected promise result
  137. Test #20 - Catch handler #1 called with err = TypeError: Function expected
  138. Test #21 - Catch handler #1 called with err = TypeError: Function expected
  139. Test #22 - Catch handler #1 called with err = TypeError: Object expected
  140. Test #23 - Catch handler #1 called with err = TypeError: Function expected
  141. Test #24 - Catch handler #1 called with err = TypeError: failure inside iterator
  142. Test #25 - Error handler #1 called with err = TypeError: failure inside iterator
  143. Test #30 - Catch handler #1 called with err = TypeError: Function expected
  144. Test #31 - Catch handler #1 called with err = TypeError: Function expected
  145. Test #32 - Catch handler #1 called with err = TypeError: Object expected
  146. Test #33 - Catch handler #1 called with err = TypeError: Function expected
  147. Test #34 - Catch handler #1 called with err = TypeError: failure inside iterator
  148. Test #35 - Error handler #1 called with err = TypeError: failure inside iterator
  149. Test #41 - Promise.resolve calls thenable.then
  150. Test #42 - thenable.then resolve = function reject = function
  151. Test #44 - Success handler #1 called with result = '' (length = 0) (isArray = true)
  152. Test #45 - Success handler called with result = 'tampered' (length = 1) (isArray = true)
  153. Test #46 - Success handler called with result = '' (length = 1) (isArray = true)
  154. Test #47 - Success handler #1a called with result = '2' (isArray = false) (fulfillCalled = false)
  155. Test #49 - Success handler #1 called with res = 'success'
  156. Test #50 - Error handler #1 called with err = 'success'
  157. Test #51 - Success handler #1 called with res = 'success'
  158. Test #52 - Error handler #1 called with err = 'success'
  159. Test #53 - Error handler #1 called with err = 'success'
  160. Test #54 - Success handler #1 called with res = 'success'
  161. Test #55 - Success finally handler called for resolved promise without value
  162. Test #56 - Success finally handler called for rejected promise without value
  163. Test #63 - val is 0(Expect 0)
  164. Test #66 - Success - []
  165. Test #68 - Failed - {}
  166. Test #76 - Catch handler #1 called with err = TypeError: Function expected
  167. Test #76 - Catch handler #1 called with err.message = Function expected
  168. Test #77 - Catch handler #1 called with err = TypeError: Function expected
  169. Test #77 - Catch handler #1 called with err.message = Function expected
  170. Test #78 - Catch handler #1 called with err = TypeError: Object expected
  171. Test #78 - Catch handler #1 called with err.message = Object expected
  172. Test #79 - Catch handler #1 called with err = TypeError: Function expected
  173. Test #79 - Catch handler #1 called with err.message = Function expected
  174. Test #80 - Catch handler #1 called with err = TypeError: failure inside iterator
  175. Test #80 - Catch handler #1 called with err.message = failure inside iterator
  176. Test #81 - Error handler #1 called with err = TypeError: failure inside iterator
  177. Test #81 - Error handler #1 called with err.message = failure inside iterator
  178. Test #87 - Error handler #1 called with err = Error: BANG
  179. Test #88 - Error handler #1 called with err = Error
  180. Test #89 - Error handler #1 called with err = TypeError: Function expected
  181. Test #90 - Error handler #1 called with err = Error
  182. Test #90 - Error handler #1 called with err.message =
  183. Test #91 - Error handler #1 called with err = AggregateError: Promise.any all promises rejected.
  184. Test #91 - Error handler #1 called with err.errors = []
  185. Test #91 - Error handler #1 called with err.message = Promise.any all promises rejected.
  186. Test #92 - Error handler #1 called with err = AggregateError: Promise.any all promises rejected.
  187. Test #92 - Error handler #1 called with err.message = "Promise.any all promises rejected."
  188. Test #92 - Error handler #1 called with err.name = AggregateError
  189. Test #92 - Error handler #1 called with err.errors = []
  190. Test #92 - Error handler #2 called with err = Error
  191. Test #92 - Error handler #2 called with err.message = ""
  192. Test #92 - Error handler #2 called with err.name = Error
  193. Test #92 - Error handler #2 called with err.errors = undefined
  194. Test #92 - Error handler #3 called with err = Error
  195. Test #92 - Error handler #3 called with err.message = ""
  196. Test #92 - Error handler #3 called with err.name = Error
  197. Test #92 - Error handler #3 called with err.errors = undefined
  198. Test #6 - Error handler #2 called with err = thenable.get:error!
  199. Test #8 - Error handler #2 called with err = success.throw:error
  200. Test #9 - Error handler #2 called with err = error.throw:error
  201. Test #10 - Error handler called with err = TypeError: Object used to resolve a promise creates a circular resolution
  202. Test #12 - Catch handler #2 called with err = error2
  203. Test #13 - Success handler #1 called with result = ok
  204. Test #14 - Success handler #1 called with result = success
  205. Test #26 - Success handler #1 called with result = first promise
  206. Test #27 - p1 success: p1
  207. Test #27 - p2 success: p2
  208. Test #27 - p3 failure: p3
  209. Test #28 - p1 failure: p1
  210. Test #28 - p2 success: p2
  211. Test #28 - p3 success: p3
  212. Test #29 - Success handler #1 called with result = first promise value
  213. Test #36 - Error handler #1 called with err = third promise
  214. Test #37 - p1 success: p1
  215. Test #37 - p2 success: p2
  216. Test #37 - p3 failure: p3
  217. Test #38 - p1 success: p1
  218. Test #38 - p2 success: p2
  219. Test #38 - p3 success: p3
  220. Test #39 - Success handler #1 called with result = success value 1,42,TypeError: an error
  221. Test #47 - Success handler #1b called with result = '3' (isArray = false) (fulfillCalled = false)
  222. Test #48 - Error handler #1 called with err = 2
  223. Test #59 - Success - Rejected status and value passed through finally with not callable argument
  224. Test #60 - Success - Resolved status and value passed through finally with not callable argument
  225. Test #61 - Success - own rejection passed through finally
  226. Test #62 - Success - own rejection passed through finally
  227. Test #64 - p1 success: p1
  228. Test #64 - p4 failure: p4
  229. Test #65 - p1 failure: p1
  230. Test #68 - p1 success: p1
  231. Test #68 - p2 success: p2
  232. Test #68 - p3 success: p3
  233. Test #69 - p1 success: p1
  234. Test #70 - Success - [{"status":"fulfilled","value":"p1"},{"status":"fulfilled","value":"p2"}]
  235. Test #82 - Success handler #1 called with result = first promise
  236. Test #83 - p1 success: p1
  237. Test #83 - p2 success: p2
  238. Test #83 - p3 failure: p3
  239. Test #84 - p1 failure: p1
  240. Test #84 - p2 success: p2
  241. Test #84 - p3 success: p3
  242. Test #85 - 2 failure: 2
  243. Test #85 - 3 success: 3
  244. Test #85 - 4 failure: 4
  245. Test #86 - 2 failure: 2
  246. Test #86 - 3 failure: 3
  247. Test #86 - 4 failure: 4
  248. Test #7 - Error handler #2 called with err = thenable.call:error!
  249. Test #13 - Catch handler #2 called with err = error2
  250. Test #15 - Catch handler #1 called with err = failure
  251. Test #27 - Success handler #1 called with result = p1
  252. Test #28 - Error handler #1 called with err = p1
  253. Test #37 - Error handler #1 called with err = p3
  254. Test #38 - Success handler #1 called with result = p1,p2,p3
  255. Test #43 - Catch handler #1 called with err = expected1
  256. Test #43 - Catch handler #2 called with err = expected2
  257. Test #43 - Catch handler #3 called with err = expected3
  258. Test #64 - Success - [{"status":"fulfilled","value":"p1"},{"status":"fulfilled","value":"p2"},{"status":"rejected","reason":"p3"},{"status":"rejected","reason":"p4"}]
  259. Test #65 - Success - [{"status":"rejected","reason":"p1"},{"status":"rejected","reason":"p2"},{"status":"rejected","reason":"p3"}]
  260. Test #69 - Success: [{"status":"fulfilled","value":"p1"}]
  261. Test #69 - p1 success: p2
  262. Test #69 - p1 failure: e2
  263. Test #83 - Success handler #1 called with result = p1
  264. Test #84 - Success handler #1 called with result = p2
  265. Test #85 - Success handler #1 called with result = 3
  266. Test #86 - Error handler #1 called with err = AggregateError: Promise.any all promises rejected.
  267. Test #86 - Error handler #1 called with err.message = "Promise.any all promises rejected."
  268. Test #86 - Error handler #1 called with err.name = AggregateError
  269. Test #86 - Error handler #1 called with err.errors = [1,2,3,4,5]
  270. Test #4 - Success handler #2 called with result = chain:success2
  271. Test #57 - Success - Rejected status and value passed through finally
  272. Test #58 - Success - Resolved status and value passed through finally
  273. Test #47 - Success handler #2 called with result = '0,,4' (length = 3) (isArray = true) (fulfillCalled = true)