mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
js,jsdom: Canvas & context API; Added TypeSymbol.is_js_compatible & temporary hacks for JS ifaces (#12526)
This commit is contained in:
parent
258d0d6df7
commit
243e66a106
9 changed files with 343 additions and 71 deletions
|
@ -57,6 +57,34 @@ pub interface JS.Map {
|
|||
|
||||
pub interface JS.Any {}
|
||||
|
||||
pub fn js_is_null(x JS.Any) bool {
|
||||
res := false
|
||||
#res.val = x === null
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn js_is_undefined(x JS.Any) bool {
|
||||
res := false
|
||||
#res.val = x === undefined
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn js_null() JS.Any {
|
||||
mut obj := JS.Any{}
|
||||
#obj = null;
|
||||
|
||||
return obj
|
||||
}
|
||||
|
||||
pub fn js_undefined() JS.Any {
|
||||
mut obj := JS.Any{}
|
||||
#obj = undefined;
|
||||
|
||||
return obj
|
||||
}
|
||||
|
||||
pub interface JS.Array {
|
||||
JS.Any // map(fn (JS.Any) JS.Any) JS.Array
|
||||
map(JS.Any) JS.Array
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue