Skip to content

Commit

Permalink
fix(entity-name): rely on constructor in isBemEntityName
Browse files Browse the repository at this point in the history
  • Loading branch information
qfox committed Apr 6, 2018
1 parent c622bf3 commit d48e84e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/entity-name/lib/entity-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ class BemEntityName {
* @returns {boolean} A Boolean indicating whether or not specified entity is instance of BemEntityName.
*/
static isBemEntityName(entityName) {
return Boolean(entityName && entityName.__isBemEntityName__);
const C = entityName && entityName.constructor;
return C === this || (C && entityName.__isBemEntityName__ && C !== Object);
}
}

Expand Down

0 comments on commit d48e84e

Please sign in to comment.