Defer to built-in typeof if built-in support for symbols exists.
This commit is contained in:
parent
570b50c895
commit
d9bf5da460
@ -4,9 +4,9 @@ let helpers = {};
|
|||||||
export default helpers;
|
export default helpers;
|
||||||
|
|
||||||
helpers.typeof = template(`
|
helpers.typeof = template(`
|
||||||
(function (obj) {
|
(typeof Symbol === "function" && typeof Symbol.iterator === "symbol")
|
||||||
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
? function (obj) { return typeof obj; }
|
||||||
});
|
: function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
||||||
`);
|
`);
|
||||||
|
|
||||||
helpers.jsx = template(`
|
helpers.jsx = template(`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user