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:
27
vlib/sync/channels.js.v
Normal file
27
vlib/sync/channels.js.v
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user