Skip to content
Permalink
Browse files

No longer use arguments.callee or RegExp (use new RegExp, instead) fo…

…r ES 3.1 and Caja compatibility. Fixes jQuery bug #4251.
  • Loading branch information...
jeresig committed Feb 26, 2009
1 parent 410e13b commit 985856b823b1648bffc3fd63c1faf836d0ddaf7c
Showing with 7 additions and 7 deletions.
  1. +4 −4 src/event.js
  2. +1 −1 src/selector.js
  3. +2 −2 src/support.js
@@ -116,7 +116,7 @@ jQuery.event = {
// Namespaced event handlers
var namespaces = type.split(".");
type = namespaces.shift();
var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
var namespace = new RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");

if ( events[type] ) {
// remove the given handler for the given type
@@ -249,7 +249,7 @@ jQuery.event = {
// Cache this now, all = true means, any handler
all = !namespaces.length && !event.exclusive;

var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
var namespace = new RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");

handlers = ( jQuery.data(this, "events") || {} )[event.type];

@@ -354,7 +354,7 @@ jQuery.event = {
},
teardown: function( namespaces ){
if ( namespaces.length ) {
var remove = 0, name = RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");
var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)");

jQuery.each( (jQuery.data(this, "events").live || {}), function(){
if ( name.test(this.type) )
@@ -560,7 +560,7 @@ jQuery.fn.extend({
});

function liveHandler( event ){
var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
var check = new RegExp("(^|\\.)" + event.type + "(\\.|$)"),
stop = true,
elems = [];

@@ -659,7 +659,7 @@ var Expr = Sizzle.selectors = {
var origPOS = Expr.match.POS;

for ( var type in Expr.match ) {
Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
}

var makeArray = function(array, results) {
@@ -75,11 +75,11 @@
root.removeChild( script );

if ( div.attachEvent && div.fireEvent ) {
div.attachEvent("onclick", function(){
div.attachEvent("onclick", function click(){
// Cloning a node shouldn't copy over any
// bound event handlers (IE does this)
jQuery.support.noCloneEvent = false;
div.detachEvent("onclick", arguments.callee);
div.detachEvent("onclick", click);
});
div.cloneNode(true).fireEvent("onclick");
}

0 comments on commit 985856b

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.