vnode caching works in the toy example

This commit is contained in:
Andreas Rumpf 2017-03-31 11:21:10 +02:00
commit 8da1ac07c0
5 changed files with 76 additions and 8 deletions

11
jdict.nim Normal file
View file

@ -0,0 +1,11 @@
type
JDict*[K, V] = ref object
proc `[]`*[K, V](d: JDict[K, V], k: K): V {.importcpp: "#[#]".}
proc `[]=`*[K, V](d: JDict[K, V], k: K, v: V) {.importcpp: "#[#] = #".}
proc newJDict*[K, V](): JDict[K, V] {.importcpp: "{@}".}
proc contains*[K, V](d: JDict[K, V], k: K): bool {.importcpp: "#.hasOwnProperty(#)".}