Replace NotString with typeclass in jsffi (#8128)
This commit is contained in:
parent
52fc16d5d2
commit
9ed671b2fe
1 changed files with 2 additions and 4 deletions
|
|
@ -75,8 +75,6 @@ type
|
|||
JsAssoc*[K, V] = ref object of JsRoot
|
||||
## Statically typed wrapper around a JavaScript object.
|
||||
|
||||
NotString = concept c
|
||||
c isnot string
|
||||
js* = JsObject
|
||||
|
||||
var
|
||||
|
|
@ -167,7 +165,7 @@ proc `[]=`*[T](obj: JsObject, field: cstring, val: T) {. importcpp: setImpl .}
|
|||
proc `[]=`*[T](obj: JsObject, field: int, val: T) {. importcpp: setImpl .}
|
||||
## Set the value of a property of name `field` in a JsObject `obj` to `v`.
|
||||
|
||||
proc `[]`*[K: NotString, V](obj: JsAssoc[K, V], field: K): V
|
||||
proc `[]`*[K: not string, V](obj: JsAssoc[K, V], field: K): V
|
||||
{. importcpp: getImpl .}
|
||||
## Return the value of a property of name `field` from a JsAssoc `obj`.
|
||||
|
||||
|
|
@ -175,7 +173,7 @@ proc `[]`*[V](obj: JsAssoc[string, V], field: cstring): V
|
|||
{. importcpp: getImpl .}
|
||||
## Return the value of a property of name `field` from a JsAssoc `obj`.
|
||||
|
||||
proc `[]=`*[K: NotString, V](obj: JsAssoc[K, V], field: K, val: V)
|
||||
proc `[]=`*[K: not string, V](obj: JsAssoc[K, V], field: K, val: V)
|
||||
{. importcpp: setImpl .}
|
||||
## Set the value of a property of name `field` in a JsAssoc `obj` to `v`.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue