Skip to content

Commit

Permalink
Merge pull request RobotWebTools#176 from Rayman/fix-domparser-shim
Browse files Browse the repository at this point in the history
remove the (unused) DOMParser shim
  • Loading branch information
rctoris committed Apr 2, 2015
2 parents 0c5efd3 + e78becd commit 43d36ea
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"aliases": {
"canvas": "./src/util/shim/canvas.js",
"eventemitter2": "./src/util/shim/EventEmitter2.js",
"ws": "./src/util/shim/WebSocket.js",
"./src/util/DOMParser.js": "./src/util/shim/DOMParser.js"
"ws": "./src/util/shim/WebSocket.js"
}
},
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion src/urdf/UrdfModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
var UrdfMaterial = require('./UrdfMaterial');
var UrdfLink = require('./UrdfLink');
var UrdfJoint = require('./UrdfJoint');
var DOMParser = require('../util/DOMParser');
var DOMParser = require('xmlshim').DOMParser;

// See https://developer.mozilla.org/docs/XPathResult#Constants
var XPATH_FIRST_ORDERED_NODE_TYPE = 9;
Expand Down
1 change: 0 additions & 1 deletion src/util/DOMParser.js

This file was deleted.

1 change: 0 additions & 1 deletion src/util/shim/DOMParser.js

This file was deleted.

3 changes: 2 additions & 1 deletion test/require-shim.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
window.require = function require(path) {
switch (path) {
case 'eventemitter2': return {EventEmitter2: EventEmitter2};
case 'xmlshim': return {DOMParser: DOMParser}
}
var lastIdx = path.lastIndexOf('/'),
path = lastIdx >= 0 ? path.slice(lastIdx + 1) : path;

return typeof ROSLIB[path] != 'undefined' ? ROSLIB[path] :
typeof window[path] != 'undefined' ? window[path] : ROSLIB;
}
}
2 changes: 1 addition & 1 deletion test/urdf.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var expect = require('chai').expect;
var ROSLIB = require('..');

var DOMParser = typeof DOMParser == 'function' ? DOMParser : require('../src/util/DOMParser');
var DOMParser = require('xmlshim').DOMParser;
// See https://developer.mozilla.org/docs/XPathResult#Constants
var XPATH_FIRST_ORDERED_NODE_TYPE = 9;

Expand Down

0 comments on commit 43d36ea

Please sign in to comment.