Skip to content

Commit

Permalink
Stopped modifying original argument in $.create(), as that creates we…
Browse files Browse the repository at this point in the history
…ird bugs when the object is not disposable
  • Loading branch information
LeaVerou committed Jan 30, 2016
1 parent 2bc1cdf commit 11ae2e2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions bliss.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ extend($, {
else {
o = tag;
tag = o.tag;
delete o.tag;
o = $.extend({}, o, function(property) { return property !== "tag"; });
}
}

Expand Down Expand Up @@ -689,7 +689,7 @@ if (self.EventTarget && "addEventListener" in EventTarget.prototype) {
notEqual = function() { return !equal.apply(this, arguments); };

EventTarget.prototype.addEventListener = function(type, callback, capture) {
if (this[_] && callback) {
if (this && this[_] && callback) {
var listeners = this[_].bliss.listeners = this[_].bliss.listeners || {};

listeners[type] = listeners[type] || [];
Expand All @@ -703,7 +703,7 @@ if (self.EventTarget && "addEventListener" in EventTarget.prototype) {
};

EventTarget.prototype.removeEventListener = function(type, callback, capture) {
if (this[_] && callback) {
if (this && this[_] && callback) {
var listeners = this[_].bliss.listeners = this[_].bliss.listeners || {};

if (listeners[type]) {
Expand All @@ -719,4 +719,4 @@ if (self.EventTarget && "addEventListener" in EventTarget.prototype) {
self.$ = self.$ || $;
self.$$ = self.$$ || $.$;

})(Bliss);
})(Bliss);
2 changes: 1 addition & 1 deletion bliss.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bliss.shy.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ extend($, {
else {
o = tag;
tag = o.tag;
delete o.tag;
o = $.extend({}, o, function(property) { return property !== "tag"; });
}
}

Expand Down
Loading

0 comments on commit 11ae2e2

Please sign in to comment.