Skip to content

Commit e0050f7

Browse files
committed
don't expose DOMParser instance on svg utils module object
1 parent 273a4c3 commit e0050f7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/lib/svg_text_utils.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ var Lib = require('../lib');
1717
var xmlnsNamespaces = require('../constants/xmlns_namespaces');
1818
var stringMappings = require('../constants/string_mappings');
1919

20+
var DOM_PARSER;
21+
2022
exports.getDOMParser = function() {
21-
if(exports.domParser) {
22-
return exports.domParser;
23+
if(DOM_PARSER) {
24+
return DOM_PARSER;
2325
} else if(window.DOMParser) {
24-
exports.domParser = new window.DOMParser();
25-
return exports.domParser;
26+
DOM_PARSER = new window.DOMParser();
27+
return DOM_PARSER;
2628
} else {
2729
throw new Error('Cannot initialize DOMParser');
2830
}

0 commit comments

Comments
 (0)