Skip to content

Commit

Permalink
Fixup Tech.isTech.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Nov 3, 2015
1 parent b4bc4b8 commit 59a509e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/js/tech/tech.js
Expand Up @@ -437,14 +437,15 @@ class Tech extends Component {
return '';
}

/*
* Return whether the argument is a Tech or not.
* Can be passed either a Class like `Html5` or a instance like `player.tech_`
*
* @param {Object} component An item to check
* @return {Boolean} Whether it is a tech or not
*/
static isTech(component) {
/* jshint proto:true */
let proto = component.__proto__;
/* jshint proto:false */
if (Object.getPrototypeOf) {
proto = Object.getPrototypeOf(component);
}
return proto === Tech;
return component.prototype instanceof Tech || component instanceof Tech;
}
}

Expand Down

0 comments on commit 59a509e

Please sign in to comment.