Permalink
Browse files

cleaned up errors, add mutation events on jQueryify

  • Loading branch information...
1 parent 6995721 commit 4ff0ce2ef9ae15e0dd721cad653f8fd1b3403145 @tmpvar tmpvar committed Feb 5, 2011
Showing with 4 additions and 15 deletions.
  1. +2 −0 lib/jsdom.js
  2. +2 −15 lib/jsdom/level2/events.js
View
@@ -120,13 +120,15 @@ exports.jQueryify = exports.jsdom.jQueryify = function (window /* path [optional
window.document.implementation.addFeature('FetchExternalResources', ['script']);
window.document.implementation.addFeature('ProcessExternalResources', ['script']);
+ window.document.implementation.addFeature('MutationEvents', ["1.0"]);
jQueryTag.src = path || 'http://code.jquery.com/jquery-latest.js';
window.document.body.appendChild(jQueryTag);
jQueryTag.onload = function() {
if (callback) {
callback(window, window.jQuery);
}
+
window.document.implementation._features = features;
};
View
@@ -186,14 +186,7 @@ events.EventTarget.dispatch = function dispatch(event, iterator, capturing) {
try {
listeners[y].call(target, event);
} catch (e) {
- sys.log("Listener "
- + sys.inspect(listeners[y])
- + "\n\n on target \n\n"
- + sys.inspect(target)
- + "\n\n threw error \n\n"
- + sys.inspect(e.stack)
- + "\n\n handling event \n\n"
- + sys.inspect(event));
+ console.log(e.stack);
}
}
target = iterator();
@@ -283,13 +276,7 @@ events.EventTarget.prototype = {
}
}
catch (e) {
- sys.log("The on" + event._type + " handler"
- + "\n\n on target \n\n"
- + sys.inspect(this)
- + "\n\n threw error \n\n"
- + sys.inspect(e)
- + "\n\n handling event \n\n"
- + sys.inspect(event));
+ console.log(e.stack);
}
}

0 comments on commit 4ff0ce2

Please sign in to comment.