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

js,checker: fix some modules build for v -b js self, fix or block check in ast.CallExpr (#12231)

This commit is contained in:
playX
2021-10-19 12:11:54 +03:00
committed by GitHub
parent 39c3817ce4
commit c1aa782a6c
11 changed files with 314 additions and 245 deletions

27
vlib/sync/channels.js.v Normal file
View File

@@ -0,0 +1,27 @@
module sync
pub struct Channel {
arr array
}
pub fn new_channel<T>(n u32) &Channel {
return &Channel{arr, new_array()}
}
pub fn (mut ch Channel) close() {}
pub fn (mut ch Channel) push(src voidptr) {
#array_push(ch.val.arr,src)
}
pub fn (ch Channel) len() int {
return ch.arr.len
}
pub fn (ch Channel) closed() bool {
return false
}
pub fn (mut ch Channel) pop(dest voidptr) {
#dest.val = array_pop(ch.val.arr)
}