Skip to content

Commit

Permalink
Merge pull request #14 from being-happy/bugfix/function-serialization
Browse files Browse the repository at this point in the history
fw: common function bugfix
  • Loading branch information
gy09535 authored Jun 26, 2023
2 parents abaa8b8 + 861a729 commit f96af48
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions lua/do_parameter_execute.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,39 @@
--

function add_log(ctx, log)
if not ctx then
print(log)
end
if not ctx then
print(log)
end

if not ctx.inner_log then
ctx.inner_log = ''
end
ctx.inner_log = ctx.inner_log .. log .. '\n'
print(log)
if not ctx.inner_log then
ctx.inner_log = ''
end
ctx.inner_log = ctx.inner_log .. log .. '\n'
print(log)
end

@commonFunctions

function inner_function_@functionName(ctx, pre_value)
local json = require("json")
local http = require("http")
@funcBody
local json = require("json")
local http = require("http")
@funcBody
end

function @functionName(ctx)
if type(ctx) ~= 'table' then
print('input ctx is not a table, can not execute function')
return
end
if type(ctx) ~= 'table' then
print('input ctx is not a table, can not execute function')
return
end

local new_ctx = inner_function_@functionName(ctx, ctx.pre_value)
if type(new_ctx) == "table" then
if tostring(new_ctx) == tostring(ctx) then
ctx.return_value = 'can not return ctx in function'
return ctx
end
end

ctx.return_value = inner_function_@functionName(ctx, ctx.pre_value)
return ctx
ctx.return_value = new_ctx
return ctx
end

0 comments on commit f96af48

Please sign in to comment.