fixes #10585
This commit is contained in:
parent
3dc270eee5
commit
84d10f7d8a
1 changed files with 5 additions and 2 deletions
|
|
@ -62,6 +62,9 @@ template wrap2svoid(op, modop) {.dirty.} =
|
||||||
op(getString(a, 0), getString(a, 1))
|
op(getString(a, 0), getString(a, 1))
|
||||||
modop op
|
modop op
|
||||||
|
|
||||||
|
template ioop(op) {.dirty.} =
|
||||||
|
registerCallback(c, "stdlib.io." & astToStr(op), `op Wrapper`)
|
||||||
|
|
||||||
proc getCurrentExceptionMsgWrapper(a: VmArgs) {.nimcall.} =
|
proc getCurrentExceptionMsgWrapper(a: VmArgs) {.nimcall.} =
|
||||||
setResult(a, if a.currentException.isNil: ""
|
setResult(a, if a.currentException.isNil: ""
|
||||||
else: a.currentException.sons[3].skipColon.strVal)
|
else: a.currentException.sons[3].skipColon.strVal)
|
||||||
|
|
@ -113,8 +116,8 @@ proc registerAdditionalOps*(c: PCtx) =
|
||||||
wrap2svoid(putEnv, osop)
|
wrap2svoid(putEnv, osop)
|
||||||
wrap1s(dirExists, osop)
|
wrap1s(dirExists, osop)
|
||||||
wrap1s(fileExists, osop)
|
wrap1s(fileExists, osop)
|
||||||
wrap2svoid(writeFile, systemop)
|
wrap2svoid(writeFile, ioop)
|
||||||
wrap1s(readFile, systemop)
|
wrap1s(readFile, ioop)
|
||||||
systemop getCurrentExceptionMsg
|
systemop getCurrentExceptionMsg
|
||||||
registerCallback c, "stdlib.*.staticWalkDir", proc (a: VmArgs) {.nimcall.} =
|
registerCallback c, "stdlib.*.staticWalkDir", proc (a: VmArgs) {.nimcall.} =
|
||||||
setResult(a, staticWalkDirImpl(getString(a, 0), getBool(a, 1)))
|
setResult(a, staticWalkDirImpl(getString(a, 0), getBool(a, 1)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue