aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2009-02-26 18:00:41 +0000
committerJohn Resig <jeresig@gmail.com>2009-02-26 18:00:41 +0000
commit985856b823b1648bffc3fd63c1faf836d0ddaf7c (patch)
tree61c0dc0fde655abb8c05c75e617393b4606ef4d3
parent410e13b40097fa6b26ce9a27f865ff258efa23b4 (diff)
downloadjquery-985856b823b1648bffc3fd63c1faf836d0ddaf7c.tar.gz
jquery-985856b823b1648bffc3fd63c1faf836d0ddaf7c.zip
No longer use arguments.callee or RegExp (use new RegExp, instead) for ES 3.1 and Caja compatibility. Fixes jQuery bug #4251.
-rw-r--r--src/event.js8
-rw-r--r--src/selector.js2
-rw-r--r--src/support.js4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/event.js b/src/event.js
index 230af19e0..26c56209f 100644
--- a/src/event.js
+++ b/src/event.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 = [];
diff --git a/src/selector.js b/src/selector.js
index e58b2571c..3bfc5f5f2 100644
--- a/src/selector.js
+++ b/src/selector.js
@@ -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) {
diff --git a/src/support.js b/src/support.js
index b11f84794..429825083 100644
--- a/src/support.js
+++ b/src/support.js
@@ -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");
}