Merge branch 'devel' into fix_issues_9126
This commit is contained in:
commit
e867c8e5c3
29 changed files with 219 additions and 114 deletions
|
|
@ -81,7 +81,7 @@ proc advice*(s: var ThreadPoolState): ThreadPoolAdvice =
|
|||
result = doNothing
|
||||
inc s.calls
|
||||
|
||||
when not defined(testing) and isMainModule:
|
||||
when not defined(testing) and isMainModule and not defined(nimdoc):
|
||||
import random
|
||||
|
||||
proc busyLoop() =
|
||||
|
|
|
|||
|
|
@ -1147,7 +1147,7 @@ proc processType(typeName: NimNode, obj: NimNode,
|
|||
`getEnumCall`
|
||||
)
|
||||
of nnkSym:
|
||||
let name = ($typeName).normalize
|
||||
let name = normalize($typeName.getTypeImpl())
|
||||
case name
|
||||
of "string":
|
||||
result = quote do:
|
||||
|
|
@ -1639,3 +1639,17 @@ when isMainModule:
|
|||
# bug #6438
|
||||
doAssert($ %*[] == "[]")
|
||||
doAssert($ %*{} == "{}")
|
||||
|
||||
# bug #9111
|
||||
block:
|
||||
type
|
||||
Bar = string
|
||||
Foo = object
|
||||
a: int
|
||||
b: Bar
|
||||
|
||||
let
|
||||
js = """{"a": 123, "b": "abc"}""".parseJson
|
||||
foo = js.to Foo
|
||||
|
||||
doAssert(foo.b == "abc")
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ proc encodeUrl*(s: string, usePlus=true): string =
|
|||
let fromSpace = if usePlus: "+" else: "%20"
|
||||
for c in s:
|
||||
case c
|
||||
# https://tools.ietf.org/html/rfc3986#section-2.3
|
||||
of 'a'..'z', 'A'..'Z', '0'..'9', '-', '.', '_', '~': add(result, c)
|
||||
of ' ': add(result, fromSpace)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue