diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/html/dom.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim index 9a4c1966..a78f4107 100644 --- a/src/html/dom.nim +++ b/src/html/dom.nim @@ -3121,6 +3121,7 @@ proc add(ctx: JSContext; this: HTMLOptionsCollection; element: Element; let res = ctx.toJS(parent.insertBefore(element, beforeEl)) if JS_IsException(res): return res + JS_FreeValue(ctx, res) return JS_UNDEFINED proc remove(this: HTMLOptionsCollection; i: int32) {.jsfunc.} = @@ -3128,6 +3129,9 @@ proc remove(this: HTMLOptionsCollection; i: int32) {.jsfunc.} = if element != nil: element.remove() +proc length(this: HTMLOptionsCollection): int {.jsfget.} = + return this.getLength() + proc setLength(this: HTMLOptionsCollection; n: uint32) {.jsfset: "length".} = let len = uint32(this.getLength()) if n > len: |