mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
general cleanup (#256)
This patch: - fixes multimap implementation to work properly in node - moves ESTreeWalker from third-party into utils/doclint. ESTreeWalker license is compliant with Apache2.0.
This commit is contained in:
@@ -94,13 +94,6 @@ class Multimap {
|
||||
this._map.delete(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {!Array<K>}
|
||||
*/
|
||||
keysArray() {
|
||||
return this._map.keysArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {K} key
|
||||
* @return {?V} value
|
||||
@@ -124,9 +117,8 @@ class Multimap {
|
||||
*/
|
||||
valuesArray() {
|
||||
let result = [];
|
||||
let keys = this.keysArray();
|
||||
for (let i = 0; i < keys.length; ++i)
|
||||
result.pushAll(this.get(keys[i]).valuesArray());
|
||||
for (let key of this._map.keys())
|
||||
result.push(...Array.from(this._map.get(key).values()));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user