mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
js: fix rand
build, properly use key values on map, add rand.string
(#12020)
This commit is contained in:
parent
60ecbec8ea
commit
82f187e5e0
13 changed files with 186 additions and 39 deletions
|
@ -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 = '{'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue