diff options
author | Juan Carlos <juancarlospaco@gmail.com> | 2019-11-22 07:37:30 -0300 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-11-22 11:37:30 +0100 |
commit | c0eeea4f3c110dd22fedd5c2b8b456e10bebfe3e (patch) | |
tree | 7779017327159ec0c357705fdea8b46176d67243 | |
parent | f7ba7c711a969877cda26e01626b1aa61d6a4feb (diff) | |
download | Nim-c0eeea4f3c110dd22fedd5c2b8b456e10bebfe3e.tar.gz |
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
-rw-r--r-- | compiler/jsgen.nim | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index f4d43ce0c..76b8121bf 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -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) = |