Bug Tracker

Modify

Ticket #12201 (closed bug: wontfix)

Opened 10 months ago

Last modified 10 months ago

Sizzle filter api incompatible when adding a custom pseudo selector

Reported by: softlion@… Owned by:
Priority: low Milestone: None
Component: selector Version: 1.8rc1
Keywords: Cc:
Blocking: Blocked by:

Description

This code works on 1.7.2 and fails on 1.8 RC1 with error Uncaught TypeError: Cannot read property '3' of undefined.

$.extend($.expr:?, {

someOp: function(a, i, m, s) {

var dist = parseInt(m[3]); ... return false;

}

});

Change History

comment:1 Changed 10 months ago by softlion@…

jsFiddle demonstrating the problem:  http://jsfiddle.net/VuWNg/

comment:2 Changed 10 months ago by timmywil

  • Priority changed from undecided to low
  • Resolution set to wontfix
  • Status changed from new to closed
  • Component changed from unfiled to selector

The new way to create custom pseudos with arguments is much clearer and faster.

The documentation can be found here:  https://github.com/jquery/sizzle/wiki/Sizzle-Documentation#wiki-pseudo-selectors.

Your example adjusted to conform to the new API:  http://jsfiddle.net/timmywil/VuWNg/1/

Custom pseudos that don't require arguments work the same way.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.