Wrap warning earlier in Promise

This commit is contained in:
Lucien Greathouse
2017-12-08 11:34:22 -08:00
parent 713a199419
commit 23ae0bc186

View File

@@ -242,7 +242,10 @@ function Promise:_resolve(...)
if Promise.is((...)) then
-- Without this warning, arguments sometimes mysteriously disappear
if select("#", ...) > 1 then
local message = ("When returning a Promise from andThen, extra arguments are discarded! See:\n\n%s"):format(
local message = (
"When returning a Promise from andThen, extra arguments are " ..
"discarded! See:\n\n%s"
):format(
self._source
)
warn(message)