summary refs log tree commit diff stats
path: root/tests/js/tthismangle.nim
blob: 880abcc834bda98a52b994570ee9a6290393b4a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
proc moo1(this: int) =
  doAssert this == 42

proc moo2(x: int) =
  var this = x
  doAssert this == 42

proc moo3() =
  for this in [1,1,1]:
    doAssert this == 1

proc moo4() =
  type
    X = object
      this: int

  var q = X(this: 42)
  doAssert q.this == 42

moo1(42)
moo2(42)
moo3()
moo4()