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

Side by Side Diff: safari/ext/common.js

Issue 5171007186796544: Issue 1517 - Always call parseInt() with a radix as second argument (Closed)
Patch Set: Created Oct. 31, 2014, 2:52 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include.preload.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 var parseMessage = function(rawMessage) 108 var parseMessage = function(rawMessage)
109 { 109 {
110 var text = rawMessage.message; 110 var text = rawMessage.message;
111 var placeholders = []; 111 var placeholders = [];
112 112
113 for (var placeholder in rawMessage.placeholders) 113 for (var placeholder in rawMessage.placeholders)
114 { 114 {
115 var content = rawMessage.placeholders[placeholder].content; 115 var content = rawMessage.placeholders[placeholder].content;
116 116
117 if (/^\$\d+$/.test(content)) 117 if (/^\$\d+$/.test(content))
118 placeholders[parseInt(content.substr(1)) - 1] = placeholder; 118 placeholders[parseInt(content.substr(1), 10) - 1] = placeholder;
119 else 119 else
120 text = replacePlaceholder(text, placeholder, content); 120 text = replacePlaceholder(text, placeholder, content);
121 } 121 }
122 122
123 return [text, placeholders]; 123 return [text, placeholders];
124 }; 124 };
125 125
126 var readCatalog = function(locale) 126 var readCatalog = function(locale)
127 { 127 {
128 var xhr = new XMLHttpRequest(); 128 var xhr = new XMLHttpRequest();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 }; 176 };
177 177
178 178
179 /* Utils */ 179 /* Utils */
180 180
181 ext.getURL = function(path) 181 ext.getURL = function(path)
182 { 182 {
183 return safari.extension.baseURI + path; 183 return safari.extension.baseURI + path;
184 }; 184 };
185 })(); 185 })();
OLDNEW
« no previous file with comments | « include.preload.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld