Code cleanup (#120)

* Lots of code cleanup

* Cleanup parse-options tests
  - Rename objects for clarity and inline unneeded objects
  - Remove unneeded tests
  - Use Object.keys().length instead of a custom function
  - Use typeof === "object" instead of a custom function that checks the prototype tree as well, since we don't expect anything but an object literal.

* Remove old switchFallback code

* Remove polyfill for Function.prototype.bind

* Inline small functions

* Add more documentation and tests for options.currentUrlFullReload
  Closes #17

* Update package.json
This commit was merged in pull request #120.
This commit is contained in:
BehindTheMath
2018-02-02 09:52:44 -05:00
committed by GitHub
parent 57aed828ac
commit a72880d205
26 changed files with 276 additions and 359 deletions

View File

@@ -7,8 +7,7 @@ var trigger = require("../../lib/events/trigger")
var el = document.createElement("div")
var el2 = document.createElement("span")
var els = [el, el2]
// var eventType2 = "resize"
// var eventsType = "click resize"
var classCb = function() {
this.className += "on"
}
@@ -92,14 +91,14 @@ tape("test events on/off/trigger for multiple elements, multiple events", functi
})
tape("test events on top level elements", function(t) {
var el = document;
var el = document
el.className = ""
on(el, "click", classCb)
trigger(el, "click")
t.equal(el.className, "on", "attached callback has been fired properly on document")
el = window;
el = window
el.className = ""
// With jsdom, the default this is global, not window, so we need to explicitly bind to window.