mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 02:44:44 +00:00
Fix jsgen (#21880)
* . * Fix jsgen FrameInfo * Fix jsgen FrameInfo * . * Move to PProc
This commit is contained in:
@@ -473,6 +473,7 @@
|
||||
|
||||
- When compiling for Release the flag `-fno-math-errno` is used for GCC.
|
||||
- Removed deprecated `LineTooLong` hint.
|
||||
- Line numbers and filenames of source files work correctly inside templates for JavaScript targets.
|
||||
|
||||
|
||||
## Docgen
|
||||
|
||||
@@ -110,6 +110,7 @@ type
|
||||
extraIndent: int
|
||||
up: PProc # up the call chain; required for closure support
|
||||
declaredGlobals: IntSet
|
||||
previousFileName: string # For frameInfo inside templates.
|
||||
|
||||
template config*(p: PProc): ConfigRef = p.module.config
|
||||
|
||||
@@ -803,6 +804,10 @@ proc genLineDir(p: PProc, n: PNode) =
|
||||
lineF(p, "$1", [lineDir(p.config, n.info, line)])
|
||||
if hasFrameInfo(p):
|
||||
lineF(p, "F.line = $1;$n", [rope(line)])
|
||||
let currentFileName = toFilename(p.config, n.info)
|
||||
if p.previousFileName != currentFileName:
|
||||
lineF(p, "F.filename = $1;$n", [makeJSString(currentFileName)])
|
||||
p.previousFileName = currentFileName
|
||||
|
||||
proc genWhileStmt(p: PProc, n: PNode) =
|
||||
var cond: TCompRes
|
||||
|
||||
Reference in New Issue
Block a user