Skip to content
Browse files

fixed another test by simply using the correct method in attrCopy

  • Loading branch information...
1 parent e9a51c4 commit 89e03af84372e1a981d488f5f32da7f12cb8072e @tmpvar tmpvar committed Feb 6, 2011
Showing with 8 additions and 3 deletions.
  1. +8 −2 lib/jsdom/level1/core.js
  2. +0 −1 lib/jsdom/level2/core.js
View
10 lib/jsdom/level1/core.js
@@ -241,8 +241,14 @@ var attrCopy = function(src, dest, fn) {
var attrs = src.attributes, i, l = attrs.length, attr, copied;
for (i=0;i<l;i++) {
attr = attrs[i];
-
- copied = dest.setAttribute(attr.nodeName, attr.nodeValue);
+ // TODO: consider duplicating this code and moving it into level2/core
+ if (attr.namespaceURI) {
+ copied = dest.setAttributeNS(attr.namespaceURI,
+ attr.nodeName,
+ attr.nodeValue);
+ } else {
+ copied = dest.setAttribute(attr.nodeName, attr.nodeValue);
+ }
if (typeof fn == "function") {
fn(attr, copied);
}
View
1 lib/jsdom/level2/core.js
@@ -42,7 +42,6 @@ var core = require("../level1/core").dom.level1.core,
}
};
-
core.exceptionMessages['NAMESPACE_ERR'] = "Invalid namespace";
core.DOMImplementation.prototype.createDocumentType = function(/* String */ qualifiedName,

0 comments on commit 89e03af

Please sign in to comment.
Something went wrong with that request. Please try again.