Skip to content

Commit

Permalink
Check instanceof fixes #82
Browse files Browse the repository at this point in the history
  • Loading branch information
tristen committed Jul 3, 2015
1 parent a17911b commit 25fd02c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tablesort.js
@@ -1,5 +1,7 @@
;(function() {
function Tablesort(el, options) {
if (!(this instanceof Tablesort)) return new Tablesort(el, options);

if (!el || el.tagName !== 'TABLE') {
throw new Error('Element must be a table');
}
Expand Down

0 comments on commit 25fd02c

Please sign in to comment.