mirror of
https://github.com/fluencelabs/aqua.git
synced 2025-04-25 15:02:14 +00:00
refactor: Store generated AIR string in exorted constant (#689)
This commit is contained in:
parent
c343c5c5ac
commit
e35944e3c8
@ -30,18 +30,21 @@ case class OutputFunc(func: FuncRes, types: Types) {
|
|||||||
val script = tsAir.show.linesIterator.map(codeLeftSpace + _).mkString("\n")
|
val script = tsAir.show.linesIterator.map(codeLeftSpace + _).mkString("\n")
|
||||||
val funcDef = FunctionDef(func)
|
val funcDef = FunctionDef(func)
|
||||||
|
|
||||||
|
val scriptConstName = func.funcName + "_script"
|
||||||
|
|
||||||
(
|
(
|
||||||
AirFunction(func.funcName, script, funcDef),
|
AirFunction(func.funcName, script, funcDef),
|
||||||
s"""${funcTypes.generate}
|
s"""export const $scriptConstName = `
|
||||||
|export function ${func.funcName}(${typed("...args", "any")}) {
|
|
||||||
|
|
|
||||||
| let script = `
|
|
||||||
|$script
|
|$script
|
||||||
| `
|
| `
|
||||||
|
|${funcTypes.generate}
|
||||||
|
|export function ${func.funcName}(${typed("...args", "any")}) {
|
||||||
|
|
|
||||||
|
|
||||||
| return callFunction$$$$(
|
| return callFunction$$$$(
|
||||||
| args,
|
| args,
|
||||||
| ${funcDef.asJson.deepDropNullValues.spaces4},
|
| ${funcDef.asJson.deepDropNullValues.spaces4},
|
||||||
| script
|
| $scriptConstName
|
||||||
| )
|
| )
|
||||||
|}""".stripMargin
|
|}""".stripMargin
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user