Merge pull request #1861 from pygy/restore-attr-nodeValue
[test-utils/domMock] restore Attr.nodeValue for backwards compatibility
This commit is contained in:
commit
29bc42b574
2 changed files with 9 additions and 0 deletions
|
|
@ -111,6 +111,10 @@ module.exports = function(options) {
|
|||
nodeValue = "" + value
|
||||
/*eslint-enable no-implicit-coercion*/
|
||||
},
|
||||
get nodeValue() {return nodeValue},
|
||||
set nodeValue(value) {
|
||||
this.value = value
|
||||
}
|
||||
}
|
||||
}
|
||||
function setAttributeNS(ns, name, value) {
|
||||
|
|
|
|||
|
|
@ -349,6 +349,7 @@ o.spec("domMock", function() {
|
|||
div.setAttribute("id", "aaa")
|
||||
|
||||
o(div.attributes["id"].value).equals("aaa")
|
||||
o(div.attributes["id"].nodeValue).equals("aaa")
|
||||
o(div.attributes["id"].namespaceURI).equals(null)
|
||||
})
|
||||
o("works w/ number", function() {
|
||||
|
|
@ -381,6 +382,10 @@ o.spec("domMock", function() {
|
|||
div.attributes["id"].value = 123
|
||||
|
||||
o(div.attributes["id"].value).equals("123")
|
||||
|
||||
div.attributes["id"].nodeValue = 456
|
||||
|
||||
o(div.attributes["id"].value).equals("456")
|
||||
})
|
||||
})
|
||||
o.spec("hasAttribute", function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue