From f457c986739d65aa046f1b307ef58e0ad4755ba0 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Tue, 1 May 2007 04:19:46 +0000 Subject: [PATCH] prototype: Merge -r6639:HEAD from branches/rel_1-5-1 into trunk. --- CHANGELOG | 6 +++++- src/base.js | 2 +- src/selector.js | 2 +- test/unit/selector.html | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) 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) {