Changeset 6410 for luci/trunk/libs/core/luasrc/util.lua
- Timestamp:
- 11/09/10 20:43:13 (3 years ago)
- Files:
-
- 1 modified
-
luci/trunk/libs/core/luasrc/util.lua (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/libs/core/luasrc/util.lua
r6366 r6410 788 788 789 789 -- Handle return value of protected call 790 function handleReturnValue(err, co, status, arg1, arg2, arg3, arg4, arg5)790 function handleReturnValue(err, co, status, ...) 791 791 if not status then 792 return false, err(debug.traceback(co, arg1), arg1, arg2, arg3, arg4, arg5)792 return false, err(debug.traceback(co, (...)), ...) 793 793 end 794 794 795 795 if coroutine.status(co) ~= 'suspended' then 796 return true, arg1, arg2, arg3, arg4, arg5797 end 798 799 return performResume(err, co, coroutine.yield( arg1, arg2, arg3, arg4, arg5))796 return true, ... 797 end 798 799 return performResume(err, co, coroutine.yield(...)) 800 800 end 801 801 802 802 -- Resume execution of protected function call 803 function performResume(err, co, arg1, arg2, arg3, arg4, arg5)804 return handleReturnValue(err, co, coroutine.resume(co, arg1, arg2, arg3, arg4, arg5))805 end 803 function performResume(err, co, ...) 804 return handleReturnValue(err, co, coroutine.resume(co, ...)) 805 end
