function Promise.prototype.now(K,k)local V=debug.traceback(nil,2)if K._status==Promise.Status.Resolved then return K:_andThen(V,function(...)return...end)else return Promise.reject(k==nil and Error.new({kind=Error.Kind.NotResolvedInTime;error="\084\104\105\115 \080\114\111\109\105\115\101 \119\097\115 \110\111\116 \114\101\115\111\108\118\101\100 \105\110 \116\105\109\101 \102\111\114 \058\110\111\119\040\041";context="\058\110\111\119\040\041 \119\097\115 \099\097\108\108\101\100 \097\116\058\n\n"..V})or k)end end
--[=[
	Chains a Promise from this one that is resolved if this Promise is already resolved, and rejected if it is not resolved at the time of calling `:now()`. This can be used to ensure your `andThen` handler occurs on the same frame as the root Promise execution.

	```lua
	doSomething()
		:now()
		:andThen(function(value)
			print("Got", value, "synchronously.")
		end)
	```

	If this Promise is still running, Rejected, or Cancelled, the Promise returned from `:now()` will reject with the `rejectionValue` if passed, otherwise with a `Promise.Error(Promise.Error.Kind.NotResolvedInTime)`. This can be checked with [[Error.isKind]].

	@param rejectionValue? any -- The value to reject with if the Promise isn't resolved
	@return Promise
]=]
function Promise.prototype:now(rejectionValue)
	local traceback = debug.traceback(nil, 2)
	if self._status == Promise.Status.Resolved then
		return self:_andThen(traceback, function(...)
			return ...
		end)
	else
		return Promise.reject(rejectionValue == nil and Error.new({
			kind = Error.Kind.NotResolvedInTime,
			error = "This Promise was not resolved in time for :now()",
			context = ":now() was called at:\n\n" .. traceback,
		}) or rejectionValue)
	end
end
