mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
js: support JS interfaces (#12426)
This commit is contained in:
parent
015cfdb49f
commit
a4c57ba56e
12 changed files with 245 additions and 205 deletions
|
@ -104,66 +104,3 @@ pub fn (f float_literal) str() string {
|
|||
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn tof64(n JS.Number) f64 {
|
||||
res := f64(0.0)
|
||||
#res.val = n;
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn tof32(n JS.Number) f32 {
|
||||
res := f32(0.0)
|
||||
#res.val = n;
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn toi(n JS.Number) int {
|
||||
res := int(0)
|
||||
#res.val = Math.floor(n);
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn f64tonum(n f64) JS.Number {
|
||||
mut res := JS.Number{}
|
||||
#res = n.val;
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn itonum(n int) JS.Number {
|
||||
mut res := JS.Number{}
|
||||
#res = n.val;
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn i64tobigint(n i64) JS.BigInt {
|
||||
mut res := JS.BigInt{}
|
||||
#res = n.val;
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn u64tobigint(n u64) JS.BigInt {
|
||||
mut res := JS.BigInt{}
|
||||
#res = n.val;
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn tobool(b JS.Boolean) bool {
|
||||
res := false
|
||||
#res.val = b;
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
pub fn booltojs(b bool) JS.Boolean {
|
||||
mut res := JS.Boolean{}
|
||||
#res = b.val;
|
||||
|
||||
return res
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue