fix: remove one more use of for..of
This commit is contained in:
parent
043b8c6d2e
commit
91426a8efe
|
@ -31,8 +31,6 @@ export class ContextWithVariableBindings {
|
|||
}
|
||||
|
||||
clearValues() {
|
||||
for (var k of MapWrapper.keys(this.varBindings)) {
|
||||
MapWrapper.set(this.varBindings, k, null);
|
||||
}
|
||||
MapWrapper.clearValues(this.varBindings);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,6 +52,11 @@ class MapWrapper {
|
|||
static void clear(Map m) {
|
||||
m.clear();
|
||||
}
|
||||
static void clearValues(Map m) {
|
||||
for (var k in m.keys) {
|
||||
m[k] = null;
|
||||
}
|
||||
}
|
||||
static Iterable iterable(Map m) => new IterableMap(m);
|
||||
static Iterable keys(Map m) => m.keys;
|
||||
static Iterable values(Map m) => m.values;
|
||||
|
|
|
@ -25,6 +25,13 @@ export class MapWrapper {
|
|||
static size(m) {return m.size;}
|
||||
static delete(m, k) { m.delete(k); }
|
||||
static clear(m) { m.clear(); }
|
||||
static clearValues(m) {
|
||||
var keyIterator = m.keys();
|
||||
var k;
|
||||
while (!((k = keyIterator.next()).done)) {
|
||||
m.set(k.value, null);
|
||||
}
|
||||
}
|
||||
static iterable(m) { return m; }
|
||||
static keys(m) { return m.keys(); }
|
||||
static values(m) { return m.values(); }
|
||||
|
|
Loading…
Reference in New Issue