Skip to content
Permalink
Browse files

Throw an error object from .error() for IE's sake in Sizzle

  • Loading branch information...
timmywil committed Nov 7, 2011
1 parent 1d826c3 commit 5d3cc64e732631cde3924a3deaaf4a282feef1c5
Showing with 2 additions and 2 deletions.
  1. +1 −1 sizzle.js
  2. +1 −1 test/unit/selector.js
@@ -325,7 +325,7 @@ Sizzle.filter = function( expr, set, inplace, not ) {
};

Sizzle.error = function( msg ) {
throw "Syntax error, unrecognized expression: " + msg;
throw new Error( "Syntax error, unrecognized expression: " + msg );
};

/**
@@ -66,7 +66,7 @@ test("broken", function() {
jQuery(selector);
ok( false, name + ": " + selector );
} catch(e){
ok( typeof e === "string" && e.indexOf("Syntax error") >= 0,
ok( e.message.indexOf("Syntax error") >= 0,
name + ": " + selector );
}
}

0 comments on commit 5d3cc64

Please sign in to comment.
You can’t perform that action at this time.