diff options
author | Marcus Lundblad <ml@dfupdate.se> | 2022-05-30 22:47:07 +0200 |
---|---|---|
committer | Marcus Lundblad <ml@dfupdate.se> | 2022-06-08 22:08:34 +0200 |
commit | 0aa17f6ceafacf7c5268760f32d0ab3798b3e570 (patch) | |
tree | 3cf84c4a0810a51862a8c1183a11fb9cb8838916 /src/xmldom | |
parent | 220dfec3255c07ea71d6c1ca5dc5b5f9f263168a (diff) | |
download | gnome-maps-0aa17f6ceafacf7c5268760f32d0ab3798b3e570.tar.gz |
Migrate to ES6 modules
Switch to using ES6 modules for internal
modules and GI modules instead of using
the legacy imports object.
The unit tests are still using imports.jsunit
as this is not available as an ES6 module
(the preferred solution now is to use
jasmine-gjs). imports.bytearray,
imports.format, and imports.mainloop are
covered in follow-up commits.
Diffstat (limited to 'src/xmldom')
-rw-r--r-- | src/xmldom/dom.js | 4 | ||||
-rw-r--r-- | src/xmldom/domparser.js | 8 | ||||
-rw-r--r-- | src/xmldom/sax.js | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/xmldom/dom.js b/src/xmldom/dom.js index 0ec86d14..8421e9c4 100644 --- a/src/xmldom/dom.js +++ b/src/xmldom/dom.js @@ -250,7 +250,7 @@ NamedNodeMap.prototype = { /** * @see http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 */ -function DOMImplementation(/* Object */ features) { +export function DOMImplementation(/* Object */ features) { this._features = {}; if (features) { for (var feature in features) { @@ -907,7 +907,7 @@ function ProcessingInstruction() { } ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE; _extends(ProcessingInstruction,Node); -function XMLSerializer(){} +export function XMLSerializer(){} XMLSerializer.prototype.serializeToString = function(node,attributeSorter){ return node.toString(attributeSorter); } diff --git a/src/xmldom/domparser.js b/src/xmldom/domparser.js index 10bc45bc..421af21d 100644 --- a/src/xmldom/domparser.js +++ b/src/xmldom/domparser.js @@ -1,7 +1,7 @@ -const XMLReader = imports.xmldom.sax.XMLReader;
-const DOMImplementation = imports.xmldom.dom.DOMImplementation;
+import {XMLReader} from './sax.js';
+import {DOMImplementation} from './dom.js';
-function DOMParser(options){
+export function DOMParser(options){
this.options = options ||{locator:{}};
}
DOMParser.prototype.parseFromString = function(source,mimeType){
@@ -243,4 +243,4 @@ function appendElement (hander,node) { } else {
hander.currentElement.appendChild(node);
}
-}//appendChild and setAttributeNS are preformance key
+}//appendChild and setAttributeNS are preformance key
diff --git a/src/xmldom/sax.js b/src/xmldom/sax.js index 9be75bfa..63f9ab05 100644 --- a/src/xmldom/sax.js +++ b/src/xmldom/sax.js @@ -18,7 +18,7 @@ var S_E = 5;//attr value end and no space(quot end) var S_S = 6;//(attr value end || tag end ) && (space offer)
var S_C = 7;//closed el<el />
-function XMLReader(){
+export function XMLReader(){
}
@@ -579,4 +579,4 @@ function split(source,start){ if(match[1])return buf;
}
return null;
-}
+}
|