Comparison

util/promise.lua @ 9510:8ef46d09386a

util.promise: Fix promise.reject() to return a rejected promise, and fix buggy test for it
author Matthew Wild <mwild1@gmail.com>
date Thu, 18 Oct 2018 12:03:33 +0100
parent 9456:d54a0e129af8
child 9512:439cf3bbe5f3
comparison
equal deleted inserted replaced
9509:b57353f76c83 9510:8ef46d09386a
117 _resolve(v); 117 _resolve(v);
118 end); 118 end);
119 end 119 end
120 120
121 local function reject(v) 121 local function reject(v)
122 return new(function (_reject) 122 return new(function (_, _reject)
123 _reject(v); 123 _reject(v);
124 end); 124 end);
125 end 125 end
126 126
127 return { 127 return {