Merge pull request #381 from kayellpeee/update_to_IIFEs

Update to IIFEs
This commit is contained in:
Leo Horie 2014-12-08 10:09:45 -05:00
commit d05b903024
4 changed files with 16 additions and 16 deletions

View file

@ -33,7 +33,7 @@ if (!Object.keys) {
}
var mock = {}
mock.window = new function() {
mock.window = (function() {
var window = {}
window.document = {}
window.document.childNodes = []
@ -136,7 +136,7 @@ mock.window = new function() {
callback()
}
}
window.XMLHttpRequest = new function() {
window.XMLHttpRequest = (function() {
var request = function() {
this.$headers = {}
this.setRequestHeader = function(key, value) {
@ -155,7 +155,7 @@ mock.window = new function() {
}
request.$instances = []
return request
}
}())
window.location = {search: "", pathname: "", hash: ""},
window.history = {}
window.history.pushState = function(data, title, url) {
@ -165,4 +165,4 @@ mock.window = new function() {
window.location.pathname = window.location.search = window.location.hash = url
}
return window
}
}())