summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--[-rwxr-xr-x]bootstrap.sh0
-rw-r--r--doc/lib.txt5
-rw-r--r--lib/core/locks.nim24
-rw-r--r--lib/pure/terminal.nim8
-rw-r--r--lib/system.nim2
-rw-r--r--tests/js/trefbyvar.nim35
6 files changed, 49 insertions, 25 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
index ade74a9aa..ade74a9aa 100755..100644
--- a/bootstrap.sh
+++ b/bootstrap.sh
diff --git a/doc/lib.txt b/doc/lib.txt
index f43228151..fd5218b0a 100644
--- a/doc/lib.txt
+++ b/doc/lib.txt
@@ -123,11 +123,6 @@ String handling
   Ropes can represent very long strings efficiently; especially concatenation
   is done in O(1) instead of O(n).
 
-* `unidecode <unidecode.html>`_
-  This module provides Unicode to ASCII transliterations:
-  It finds the sequence of ASCII characters that is the closest approximation
-  to the Unicode string.
-
 * `matchers <matchers.html>`_
   This module contains various string matchers for email addresses, etc.
 
diff --git a/lib/core/locks.nim b/lib/core/locks.nim
index 8a809fc84..92ae24a37 100644
--- a/lib/core/locks.nim
+++ b/lib/core/locks.nim
@@ -1,7 +1,7 @@
 #
 #
 #            Nim's Runtime Library
-#        (c) Copyright 2012 Andreas Rumpf
+#        (c) Copyright 2015 Andreas Rumpf
 #
 #    See the file "copying.txt", included in this
 #    distribution, for details about the copyright.
@@ -15,18 +15,6 @@ type
   TLock* = TSysLock ## Nim lock; whether this is re-entrant
                     ## or not is unspecified!
   TCond* = TSysCond ## Nim condition variable
-  
-  LockEffect* {.deprecated.} = object of RootEffect ## \
-    ## effect that denotes that some lock operation
-    ## is performed. Deprecated, do not use anymore!
-  AquireEffect* {.deprecated.} = object of LockEffect  ## \
-    ## effect that denotes that some lock is
-    ## acquired. Deprecated, do not use anymore!
-  ReleaseEffect* {.deprecated.} = object of LockEffect ## \
-    ## effect that denotes that some lock is
-    ## released. Deprecated, do not use anymore!
-{.deprecated: [FLock: LockEffect, FAquireLock: AquireEffect, 
-    FReleaseLock: ReleaseEffect].}
 
 proc initLock*(lock: var TLock) {.inline.} =
   ## Initializes the given lock.
@@ -36,14 +24,14 @@ proc deinitLock*(lock: var TLock) {.inline.} =
   ## Frees the resources associated with the lock.
   deinitSys(lock)
 
-proc tryAcquire*(lock: var TLock): bool = 
+proc tryAcquire*(lock: var TLock): bool =
   ## Tries to acquire the given lock. Returns `true` on success.
   result = tryAcquireSys(lock)
 
 proc acquire*(lock: var TLock) =
   ## Acquires the given lock.
   acquireSys(lock)
-  
+
 proc release*(lock: var TLock) =
   ## Releases the given lock.
   releaseSys(lock)
@@ -58,10 +46,10 @@ proc deinitCond*(cond: var TCond) {.inline.} =
   deinitSysCond(cond)
 
 proc wait*(cond: var TCond, lock: var TLock) {.inline.} =
-  ## waits on the condition variable `cond`. 
+  ## waits on the condition variable `cond`.
   waitSysCond(cond, lock)
-  
+
 proc signal*(cond: var TCond) {.inline.} =
-  ## sends a signal to the condition variable `cond`. 
+  ## sends a signal to the condition variable `cond`.
   signalSysCond(cond)
 
diff --git a/lib/pure/terminal.nim b/lib/pure/terminal.nim
index 29f700db5..7b4d548fe 100644
--- a/lib/pure/terminal.nim
+++ b/lib/pure/terminal.nim
@@ -364,7 +364,13 @@ macro styledEcho*(m: varargs[expr]): stmt =
   result.add(newCall(bindSym"write", bindSym"stdout", newStrLitNode("\n")))
   result.add(newCall(bindSym"resetAttributes"))
 
-when not defined(windows):
+when defined(nimdoc):
+  proc getch*(): char =
+    ## Read a single character from the terminal, blocking until it is entered.
+    ## The character is not printed to the terminal. This is not available for
+    ## Windows.
+    discard
+elif not defined(windows):
   proc getch*(): char =
     ## Read a single character from the terminal, blocking until it is entered.
     ## The character is not printed to the terminal. This is not available for
diff --git a/lib/system.nim b/lib/system.nim
index a4b053ca7..205a68685 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -1535,7 +1535,7 @@ const
   NimMinor*: int = 11
     ## is the minor number of Nim's version.
 
-  NimPatch*: int = 2
+  NimPatch*: int = 3
     ## is the patch number of Nim's version.
 
   NimVersion*: string = $NimMajor & "." & $NimMinor & "." & $NimPatch
diff --git a/tests/js/trefbyvar.nim b/tests/js/trefbyvar.nim
new file mode 100644
index 000000000..68dd36543
--- /dev/null
+++ b/tests/js/trefbyvar.nim
@@ -0,0 +1,35 @@
+discard """
+  output: '''0
+5
+0
+5'''
+"""
+
+# bug #2476
+
+type A = ref object
+    m: int
+
+proc f(a: var A) =
+    var b: A
+    b.new()
+    b.m = 5
+    a = b
+
+var t: A
+t.new()
+
+echo t.m
+t.f()
+echo t.m
+
+proc main =
+  # now test the same for locals
+  var t: A
+  t.new()
+
+  echo t.m
+  t.f()
+  echo t.m
+
+main()