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

Unified Diff: test/_common.js

Issue 29548719: Issue 5728 - Replace Services.vc.compare (Closed)
Patch Set: Handle case in which the same compnent in both versions are rounded to Infinity Created Sept. 20, 2017, 1:28 a.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/notification.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/_common.js
===================================================================
--- a/test/_common.js
+++ b/test/_common.js
@@ -39,31 +39,6 @@
let Services = {
obs: {
addObserver() {}
- },
- vc: {
- compare(v1, v2)
- {
- function comparePart(p1, p2)
- {
- if (p1 != "*" && p2 == "*")
- return -1;
- else if (p1 == "*" && p2 != "*")
- return 1;
- else if (p1 == p2)
- return 0;
- return parseInt(p1, 10) - parseInt(p2, 10);
- }
-
- let parts1 = v1.split(".");
- let parts2 = v2.split(".");
- for (let i = 0; i < Math.max(parts1.length, parts2.length); i++)
- {
- let result = comparePart(parts1[i] || "0", parts2[i] || "0");
- if (result != 0)
- return result;
- }
- return 0;
- }
}
};
let XPCOMUtils = {
« no previous file with comments | « lib/notification.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld