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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)