function Promise.Then(k,q,K)if type(K)=="\102\117\110\099\116\105\111\110"then k._unconsumedException=false end if k._pendingExecuteList then local B=Promise.new()k._pendingExecuteList[#k._pendingExecuteList+1]={q,K;B}return B else return k:_executeThen(q,K,nil)end end

function Promise:Then(onFulfilled, onRejected)
	if type(onRejected) == "function" then
		self._unconsumedException = false
	end

	if self._pendingExecuteList then
		local promise = Promise.new()
		self._pendingExecuteList[#self._pendingExecuteList + 1] = { onFulfilled, onRejected, promise }
		return promise
	else
		return self:_executeThen(onFulfilled, onRejected, nil)
	end
end
