mirror of
https://github.com/CompeyDev/lune-packaging.git
synced 2025-01-09 04:09:09 +00:00
Uncomment task lib argument stuff to prepare for implementation
This commit is contained in:
parent
d71a3a2b10
commit
bfe852f034
5 changed files with 3 additions and 22 deletions
6
lune.yml
6
lune.yml
|
@ -78,17 +78,17 @@ globals:
|
|||
task.defer:
|
||||
args:
|
||||
- type: thread | function
|
||||
# - type: "..."
|
||||
- type: "..."
|
||||
task.delay:
|
||||
args:
|
||||
- required: false
|
||||
type: number
|
||||
- type: thread | function
|
||||
# - type: "..."
|
||||
- type: "..."
|
||||
task.spawn:
|
||||
args:
|
||||
- type: thread | function
|
||||
# - type: "..."
|
||||
- type: "..."
|
||||
task.wait:
|
||||
args:
|
||||
- required: false
|
||||
|
|
|
@ -52,15 +52,6 @@ declare process: {
|
|||
},
|
||||
}
|
||||
|
||||
declare task: {
|
||||
cancel: (thread: thread) -> (),
|
||||
defer: (functionOrThread: thread | (...any) -> (...any)) -> thread,
|
||||
delay: (duration: number?, functionOrThread: thread | (...any) -> (...any)) -> thread,
|
||||
spawn: (functionOrThread: thread | (...any) -> (...any)) -> thread,
|
||||
wait: (duration: number?) -> (number),
|
||||
}
|
||||
|
||||
--[[
|
||||
declare task: {
|
||||
cancel: (thread: thread) -> (),
|
||||
defer: <T...>(functionOrThread: thread | (T...) -> (...any), T...) -> thread,
|
||||
|
@ -68,4 +59,3 @@ declare task: {
|
|||
spawn: <T...>(functionOrThread: thread | (T...) -> (...any), T...) -> thread,
|
||||
wait: (duration: number?) -> (number),
|
||||
}
|
||||
]]
|
||||
|
|
|
@ -40,8 +40,6 @@ assert(not flag2, "Defer should run after spawned threads")
|
|||
|
||||
-- Varargs should get passed correctly
|
||||
|
||||
-- TODO: Uncomment when vararg support is added
|
||||
--[[
|
||||
local function f(arg1: string, arg2: number, f2: (...any) -> ...any)
|
||||
assert(type(arg1) == "string", "Invalid arg 1 passed to function")
|
||||
assert(type(arg2) == "number", "Invalid arg 2 passed to function")
|
||||
|
@ -51,4 +49,3 @@ end
|
|||
task.defer(f, "", 1, f)
|
||||
task.defer(f, "inf", math.huge, f)
|
||||
task.defer(f, "NaN", 0 / 0, f)
|
||||
]]
|
||||
|
|
|
@ -28,8 +28,6 @@ assert(not flag2, "Delay should work with yielding (2)")
|
|||
|
||||
-- Varargs should get passed correctly
|
||||
|
||||
-- TODO: Uncomment when vararg support is added
|
||||
--[[
|
||||
local function f(arg1: string, arg2: number, f2: (...any) -> ...any)
|
||||
assert(type(arg1) == "string", "Invalid arg 1 passed to function")
|
||||
assert(type(arg2) == "number", "Invalid arg 2 passed to function")
|
||||
|
@ -39,4 +37,3 @@ end
|
|||
task.delay(0, f, "", 1, f)
|
||||
task.delay(0, f, "inf", math.huge, f)
|
||||
task.delay(0, f, "NaN", 0 / 0, f)
|
||||
]]
|
||||
|
|
|
@ -33,8 +33,6 @@ assert(flag3, "Spawn should run threads made from coroutine.create")
|
|||
|
||||
-- Varargs should get passed correctly
|
||||
|
||||
-- TODO: Uncomment when vararg support is added
|
||||
--[[
|
||||
local function f(arg1: string, arg2: number, f2: (...any) -> ...any)
|
||||
assert(type(arg1) == "string", "Invalid arg 1 passed to function")
|
||||
assert(type(arg2) == "number", "Invalid arg 2 passed to function")
|
||||
|
@ -44,4 +42,3 @@ end
|
|||
task.spawn(f, "", 1, f)
|
||||
task.spawn(f, "inf", math.huge, f)
|
||||
task.spawn(f, "NaN", 0 / 0, f)
|
||||
]]
|
||||
|
|
Loading…
Reference in a new issue