diff --git a/lib/init.lua b/lib/init.lua index 185d13c..085c76f 100644 --- a/lib/init.lua +++ b/lib/init.lua @@ -19,7 +19,7 @@ end wpcallPacked is a version of xpcall that: * Returns the length of the result first * Returns the result packed into a table - * Passes extra arguments through to the passed function, which xpcall does not + * Passes extra arguments through to the passed function; xpcall doesn't * Issues a warning if PROMISE_DEBUG is enabled ]] local function wpcallPacked(f, ...) @@ -188,8 +188,8 @@ function Promise.all(promises) return Promise.resolve({}) end - -- We need to check that each value is a promise here so that we can produce a - -- proper error rather than a rejected promise with our error. + -- We need to check that each value is a promise here so that we can produce + -- a proper error rather than a rejected promise with our error. for i = 1, #promises do if not Promise.is(promises[i]) then error(("Non-promise value passed into Promise.all at index #%d"):format(i), 2) @@ -199,8 +199,9 @@ function Promise.all(promises) return Promise.new(function(resolve, reject) -- An array to contain our resolved values from the given promises. local resolvedValues = {} - -- Keep a count of resolved promises because just checking the resolved values length - -- wouldn't account for promises that resolve with nil. + + -- Keep a count of resolved promises because just checking the resolved + -- values length wouldn't account for promises that resolve with nil. local resolvedCount = 0 local rejected = false @@ -219,7 +220,8 @@ function Promise.all(promises) end end - -- We can assume the values inside `promises` are all promises since we checked above. + -- We can assume the values inside `promises` are all promises since we + -- checked above. for i = 1, #promises do promises[i]:andThen( function(...) @@ -424,4 +426,4 @@ function Promise.prototype:_reject(...) end end -return Promise +return Promise \ No newline at end of file diff --git a/lib/init.spec.lua b/lib/init.spec.lua index 9c2cc9d..761eb26 100644 --- a/lib/init.spec.lua +++ b/lib/init.spec.lua @@ -389,4 +389,4 @@ return function() expect(second).to.equal("qux") end) end) -end +end \ No newline at end of file