Skip to content

Commit 7d3dbdc

Browse files
committed
template-tag.js: support Components.utils.import
1 parent 49b94b6 commit 7d3dbdc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

common/content/liberator-overlay.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030

3131
let prefix = [BASE];
3232

33-
//Cu.import("resource://liberator/template-tag.js", modules);
34-
loader.loadSubScript("resource://liberator/template-tag.js", modules);
33+
Cu.import("resource://liberator/template-tag.js", modules);
3534

3635
// TODO: This list is much too long, we should try to minimize
3736
// the number of required components for easier porting to new applications

common/modules/template-tag.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,11 @@ templateXML.map = function templateXmlMap(data, fn) {
219219
return new TemplateXML(res);
220220
}
221221

222+
var DOMParser = Components.Constructor("@mozilla.org/xmlextras/domparser;1");
222223
// xxx: xml check
223224
templateXML.raw = function templateXmlRaw(portion, args) {
224225
var str = templateRaw(portion, args);
225-
var ps = new DOMParser
226+
var ps = DOMParser();
226227
var doc = ps.parseFromString("<root>" + str + "</root>", "text/xml");
227228
if (doc.documentElement.tagName === "parsererror") {
228229
throw SyntaxError(doc.documentElement.childNodes[0].data);

0 commit comments

Comments
 (0)