Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/filterClasses.js

Issue 29802575: Issue 6559 - Replace fromObject with fromMap (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created June 8, 2018, 1:59 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/subscriptionClasses.js ('k') | test/filterStorage_readwrite.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/filterClasses.js
===================================================================
--- a/test/filterClasses.js
+++ b/test/filterClasses.js
@@ -178,23 +178,23 @@
test.equal(result.sort().join("\n"), expected.sort().join("\n"), text);
// Test round-trip
let filter2;
let buffer = [];
filter.serialize(buffer);
if (buffer.length)
{
- let map = Object.create(null);
+ let map = new Map();
for (let line of buffer.slice(1))
{
if (/(.*?)=(.*)/.test(line))
- map[RegExp.$1] = RegExp.$2;
+ map.set(RegExp.$1, RegExp.$2);
}
- filter2 = Filter.fromObject(map);
+ filter2 = Filter.fromMap(map);
}
else
filter2 = Filter.fromText(filter.text);
test.equal(serializeFilter(filter).join("\n"), serializeFilter(filter2).join("\n"), text + " deserialization");
}
exports.testFilterClassDefinitions = function(test)
« no previous file with comments | « lib/subscriptionClasses.js ('k') | test/filterStorage_readwrite.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld