mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
Improve head comment on JS (#12548)
* Improve comment on JSGen, replace 12+ concatenations by 1 multiline string * Peer review feedbacks https://github.com/nim-lang/Nim/pull/12548#discussion_r340051147
This commit is contained in:
committed by
Andreas Rumpf
parent
f7ba7c711a
commit
c0eeea4f3c
@@ -2502,21 +2502,19 @@ proc newModule(g: ModuleGraph; module: PSym): BModule =
|
||||
result.config = g.config
|
||||
|
||||
proc genHeader(): Rope =
|
||||
result = (
|
||||
"/* Generated by the Nim Compiler v$1 */$n" &
|
||||
"/* (c) " & copyrightYear & " Andreas Rumpf */$n$n" &
|
||||
"var framePtr = null;$n" &
|
||||
"var excHandler = 0;$n" &
|
||||
"var lastJSError = null;$n" &
|
||||
"if (typeof Int8Array === 'undefined') Int8Array = Array;$n" &
|
||||
"if (typeof Int16Array === 'undefined') Int16Array = Array;$n" &
|
||||
"if (typeof Int32Array === 'undefined') Int32Array = Array;$n" &
|
||||
"if (typeof Uint8Array === 'undefined') Uint8Array = Array;$n" &
|
||||
"if (typeof Uint16Array === 'undefined') Uint16Array = Array;$n" &
|
||||
"if (typeof Uint32Array === 'undefined') Uint32Array = Array;$n" &
|
||||
"if (typeof Float32Array === 'undefined') Float32Array = Array;$n" &
|
||||
"if (typeof Float64Array === 'undefined') Float64Array = Array;$n") %
|
||||
[rope(VersionAsString)]
|
||||
result = rope("""/* Generated by the Nim Compiler v$1 */
|
||||
var framePtr = null;
|
||||
var excHandler = 0;
|
||||
var lastJSError = null;
|
||||
if (typeof Int8Array === 'undefined') Int8Array = Array;
|
||||
if (typeof Int16Array === 'undefined') Int16Array = Array;
|
||||
if (typeof Int32Array === 'undefined') Int32Array = Array;
|
||||
if (typeof Uint8Array === 'undefined') Uint8Array = Array;
|
||||
if (typeof Uint16Array === 'undefined') Uint16Array = Array;
|
||||
if (typeof Uint32Array === 'undefined') Uint32Array = Array;
|
||||
if (typeof Float32Array === 'undefined') Float32Array = Array;
|
||||
if (typeof Float64Array === 'undefined') Float64Array = Array;
|
||||
""".unindent.format(VersionAsString))
|
||||
|
||||
proc addHcrInitGuards(p: PProc, n: PNode,
|
||||
moduleLoadedVar: Rope, inInitGuard: var bool) =
|
||||
|
||||
Reference in New Issue
Block a user