Permalink
Browse files

Throw IE-friendly error on selector syntax errors.

  • Loading branch information...
1 parent f56f178 commit 22e1c7e806913f4a9399f9583969637dd9f1bb01 @ichthyos committed Oct 26, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 sizzle.js
  2. +1 −1 test/unit/selector.js
View
@@ -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);
};
/**
View
@@ -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 instanceof Error && e.message.indexOf("Syntax error") >= 0,
name + ": " + selector );
}
}

0 comments on commit 22e1c7e

Please sign in to comment.