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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;
#}