Remove my wrongly written mangled-related code, not needed anymore (#13858)

This commit is contained in:
Alexander Ivanov 2020-04-03 21:22:03 +03:00 • committed by GitHub
commit cec320b569
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 11 deletions

View file

@ -205,8 +205,6 @@ proc mapType(typ: PType): TJSTypeKind =
proc mapType(p: PProc; typ: PType): TJSTypeKind =
result = mapType(typ)
var mangled = initSet[string]()
proc mangleName(m: BModule, s: PSym): Rope =
proc validJsName(name: string): bool =
result = true
@ -261,11 +259,6 @@ proc mangleName(m: BModule, s: PSym): Rope =
result.add(rope(s.id))
s.loc.r = result
# TODO: optimize
let s = $result
if '_' in s:
mangled.incl(s)
proc escapeJSString(s: string): string =
result = newStringOfCap(s.len + s.len shr 2)
result.add("\"")
@ -2609,7 +2602,7 @@ proc myClose(graph: ModuleGraph; b: PPassContext, n: PNode): PNode =
if optSourcemap in m.config.globalOptions:
var map: SourceMap
(code, map) = genSourceMap($(code), mangled, outFile.string)
(code, map) = genSourceMap($(code), outFile.string)
writeFile(outFile.string & ".map", $(%map))
discard writeRopeIfNotEqual(code, outFile)