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

Unified Diff: test/subscriptionClasses.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 | « test/filterStorage_readwrite.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/subscriptionClasses.js
===================================================================
--- a/test/subscriptionClasses.js
+++ b/test/subscriptionClasses.js
@@ -42,23 +42,23 @@
expected.push("[Subscription]");
let subscription = Subscription.fromURL(url);
if (postInit)
postInit(subscription);
let result = [];
subscription.serialize(result);
test.equal(result.sort().join("\n"), expected.sort().join("\n"), url);
- let map = Object.create(null);
+ let map = new Map();
for (let line of result.slice(1))
{
if (/(.*?)=(.*)/.test(line))
- map[RegExp.$1] = RegExp.$2;
+ map.set(RegExp.$1, RegExp.$2);
}
- let subscription2 = Subscription.fromObject(map);
+ let subscription2 = Subscription.fromMap(map);
test.equal(subscription.toString(), subscription2.toString(), url + " deserialization");
}
exports.testSubscriptionClassDefinitions = function(test)
{
test.equal(typeof Subscription, "function", "typeof Subscription");
test.equal(typeof SpecialSubscription, "function", "typeof SpecialSubscription");
test.equal(typeof RegularSubscription, "function", "typeof RegularSubscription");
« no previous file with comments | « test/filterStorage_readwrite.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld