diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-06-12 02:03:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-12 11:03:52 +0200 |
commit | e30a08103da14d5b1e02d6c04dc2d5afb5b9368d (patch) | |
tree | 225c8dd21b8097b2938b3cf9796d8ba2d5c3c783 /compiler/jsgen.nim | |
parent | 82e424189ee4bf0f05fcf5695fe1c3e2d2dfc51f (diff) | |
download | Nim-e30a08103da14d5b1e02d6c04dc2d5afb5b9368d.tar.gz |
remove tyOpt, mOpt (#14636)
* remove tyOpt, mOpt * fixup
Diffstat (limited to 'compiler/jsgen.nim')
-rw-r--r-- | compiler/jsgen.nim | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/jsgen.nim b/compiler/jsgen.nim index 9f022882b..99d2bc4f2 100644 --- a/compiler/jsgen.nim +++ b/compiler/jsgen.nim @@ -193,7 +193,7 @@ proc mapType(typ: PType): TJSTypeKind = of tyBool: result = etyBool of tyFloat..tyFloat128: result = etyFloat of tySet: result = etyObject # map a set to a table - of tyString, tySequence, tyOpt: result = etySeq + of tyString, tySequence: result = etySeq of tyObject, tyArray, tyTuple, tyOpenArray, tyVarargs, tyUncheckedArray: result = etyObject of tyNil: result = etyNull @@ -210,6 +210,7 @@ proc mapType(typ: PType): TJSTypeKind = else: result = etyNone of tyProc: result = etyProc of tyCString: result = etyString + of tyOptDeprecated: doAssert false proc mapType(p: PProc; typ: PType): TJSTypeKind = result = mapType(typ) @@ -1041,7 +1042,7 @@ proc genAsgnAux(p: PProc, x, y: PNode, noCopyNeeded: bool) = # we don't care if it's an etyBaseIndex (global) of a string, it's # still a string that needs to be copied properly: - if x.typ.skipTypes(abstractInst).kind in {tySequence, tyOpt, tyString}: + if x.typ.skipTypes(abstractInst).kind in {tySequence, tyString}: xtyp = etySeq case xtyp of etySeq: @@ -1086,7 +1087,7 @@ proc genFastAsgn(p: PProc, n: PNode) = # See bug #5933. So we try to be more compatible with the C backend semantics # here for 'shallowCopy'. This is an educated guess and might require further # changes later: - let noCopy = n[0].typ.skipTypes(abstractInst).kind in {tySequence, tyOpt, tyString} + let noCopy = n[0].typ.skipTypes(abstractInst).kind in {tySequence, tyString} genAsgnAux(p, n[0], n[1], noCopyNeeded=noCopy) proc genSwap(p: PProc, n: PNode) = @@ -1697,7 +1698,7 @@ proc createVar(p: PProc, typ: PType, indirect: bool): Rope = result = putToSeq("null", indirect) of tySequence, tyString: result = putToSeq("[]", indirect) - of tyCString, tyOpt, tyProc: + of tyCString, tyProc: result = putToSeq("null", indirect) of tyStatic: if t.n != nil: |