diff --git a/CHANGELOG b/CHANGELOG index ea21ea6..fdb73ae 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,7 +2,11 @@ * Add Function#curry, Function#delay, Function#defer, and Function#wrap. Closes #8134. [Andrew Dupont, Tobie Langel, sam] -*1.5.1* (it is a mystery) +*1.5.1* (May 1, 2007) + +* Don't duplicate the event argument in Function#bindAsEventListener. Closes #6497. [wiktor] + +* Fix Selector :not-clause chaining. [Andrew Dupont] *1.5.1_rc4* (April 27, 2007) diff --git a/src/base.js b/src/base.js index 263ac65..94356cb 100644 --- a/src/base.js +++ b/src/base.js @@ -77,7 +77,7 @@ Object.extend(Function.prototype, { bindAsEventListener: function() { var __method = this, args = $A(arguments), object = args.shift(); return function(event) { - return __method.apply(object, [(event || window.event)].concat(args).concat($A(arguments))); + return __method.apply(object, [event || window.event].concat(args)); } }, diff --git a/src/selector.js b/src/selector.js index 5578d01..37b68eb 100644 --- a/src/selector.js +++ b/src/selector.js @@ -218,7 +218,7 @@ Object.extend(Selector, { tagName: /^\s*(\*|[\w\-]+)(\b|$)?/, id: /^#([\w\-\*]+)(\b|$)/, className: /^\.([\w\-\*]+)(\b|$)/, - pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|\s)/, + pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|\s|(?=:))/, attrPresence: /^\[([\w]+)\]/, attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\]]*?)\4|([^'"][^\]]*?)))?\]/ }, diff --git a/test/unit/selector.html b/test/unit/selector.html index f579200..d43474a 100644 --- a/test/unit/selector.html +++ b/test/unit/selector.html @@ -324,6 +324,7 @@ assertEnumEqual([$('link_2')], $$('#p a:not(a[rel^=external])'), 'attribute 2'); assertEnumEqual([$('link_2')], $$('#p a:not(a[rel$=nofollow])'), 'attribute 3'); assertEnumEqual([$('em')], $$('#p a:not(a[rel$="nofollow"]) > em'), 'attribute 4') + assertEnumEqual([$('item_2')], $$('#list li:not(#item_1):not(#item_3)'), 'adjacent :not clauses'); }}, testSelectorWithEnabledDisabledChecked: function() {with(this) {