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

v.gen.js: port fully the array test suite & add fixes (#11073)

This commit is contained in:
playX
2021-08-07 17:58:49 +03:00
committed by GitHub
parent c560d58f1e
commit 94c321c80d
8 changed files with 360 additions and 15 deletions

View File

@@ -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;
#}