mirror of
https://github.com/vlang/v.git
synced 2025-09-15 07:22:27 +03:00
v.gen.js: port fully the array test suite & add fixes (#11073)
This commit is contained in:
parent
c560d58f1e
commit
94c321c80d
8 changed files with 360 additions and 15 deletions
|
@ -14,3 +14,13 @@ pub fn (mut m map) delete(key voidptr) {
|
|||
pub fn (m &map) free() {}
|
||||
|
||||
#map.prototype[Symbol.iterator] = function () { return this.map[Symbol.iterator](); }
|
||||
|
||||
#map.prototype.toString = function () {
|
||||
#function fmtKey(key) { return typeof key == 'string' ? '\'' + key + '\'' : key}
|
||||
#let res = '{'
|
||||
#for (const entry of this) {
|
||||
#res += fmtKey(entry[0]) + ': ' + entry[0];
|
||||
#}
|
||||
#res += '}'
|
||||
#return res;
|
||||
#}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue