about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/html/dom.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/html/dom.nim b/src/html/dom.nim
index b7ecffe0..70a9277c 100644
--- a/src/html/dom.nim
+++ b/src/html/dom.nim
@@ -4995,7 +4995,9 @@ return x;
 """)
   doAssert JS_SetConstructorBit(ctx, imageFun, true)
   let jsWindow = JS_GetGlobalObject(ctx)
-  ctx.defineProperty(jsWindow, "Image", imageFun)
+  ctx.definePropertyCW(jsWindow, "Image", imageFun)
+  ctx.definePropertyCW(jsWindow, "HTMLDocument",
+    JS_GetPropertyStr(ctx, jsWindow, "Document"))
   JS_FreeValue(ctx, jsWindow)
 
 # Forward declaration hack