mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
js: fix rand
build, properly use key values on map, add rand.string
(#12020)
This commit is contained in:
@ -1331,8 +1331,8 @@ fn test_struct_array_of_multi_type_in() {
|
||||
},
|
||||
]
|
||||
println(ivan in people)
|
||||
println('TODO: Map eq')
|
||||
// assert ivan in people
|
||||
// println('TODO: Map eq')
|
||||
assert ivan in people
|
||||
}
|
||||
|
||||
fn test_struct_array_of_multi_type_index() {
|
||||
|
@ -1,7 +1,8 @@
|
||||
module builtin
|
||||
|
||||
struct map {
|
||||
m JS.Map
|
||||
m JS.Map
|
||||
pub:
|
||||
len int
|
||||
}
|
||||
|
||||
@ -14,7 +15,7 @@ pub fn (mut m map) delete(key voidptr) {
|
||||
pub fn (m &map) free() {}
|
||||
|
||||
#map.prototype[Symbol.iterator] = function () { return this.map[Symbol.iterator](); }
|
||||
|
||||
//#Object.defineProperty(map.prototype,"len",{get: function() { return this.map.size; }})
|
||||
#map.prototype.toString = function () {
|
||||
#function fmtKey(key) { return typeof key == 'string' ? '\'' + key + '\'' : key}
|
||||
#let res = '{'
|
||||
|
Reference in New Issue
Block a user