fixes deprecation messages and adds missing commas (#23609)

This commit is contained in:
ringabout
2024-05-15 05:01:54 +08:00
committed by GitHub
parent 0fcd838fd9
commit b42f1ca8a4

View File

@@ -37,13 +37,13 @@ when defined(js):
let a = array[2, float64].default
assert jsConstructorName(a) == "Float64Array"
assert jsConstructorName(a.toJs) == "Float64Array"
asm """`result` = `a`.constructor.name"""
{.emit: """`result` = `a`.constructor.name;""".}
proc hasJsBigInt*(): bool =
asm """`result` = typeof BigInt != 'undefined'"""
{.emit: """`result` = typeof BigInt != 'undefined';""".}
proc hasBigUint64Array*(): bool =
asm """`result` = typeof BigUint64Array != 'undefined'"""
{.emit: """`result` = typeof BigUint64Array != 'undefined';""".}
proc getProtoName*[T](a: T): cstring {.importjs: "Object.prototype.toString.call(#)".} =
runnableExamples: