1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

js: add fixes for generic structures and functions; add promise API; refactor modules (#12575)

This commit is contained in:
playX
2021-11-25 17:49:53 +03:00
committed by GitHub
parent ac3910b8c2
commit f584e70cf2
11 changed files with 1170 additions and 54 deletions

View File

@ -1,4 +1,4 @@
import jsdom
import js.dom
fn get_canvas(elem JS.HTMLElement) &JS.HTMLCanvasElement {
match elem {
@ -30,8 +30,8 @@ mut:
}
fn main() {
window := jsdom.window()
document := jsdom.document
window := dom.window()
document := dom.document
clear_btn := document.getElementById('clearButton'.str) ?
canvas_elem := document.getElementById('canvas'.str) ?
canvas := get_canvas(canvas_elem)