Skip to content

Commit

Permalink
Throw an error object from .error() for IE's sake in Sizzle
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Nov 7, 2011
1 parent 1d826c3 commit 5d3cc64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sizzle.js
Expand Up @@ -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 );
};

/**
Expand Down
2 changes: 1 addition & 1 deletion test/unit/selector.js
Expand Up @@ -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 );
}
}
Expand Down

0 comments on commit 5d3cc64

Please sign in to comment.