Merge pull request #3218 from jdalton/_typeof

Defer to the built-in `typeof` if support for symbols exists.
This commit is contained in:
Henry Zhu
2015-12-29 12:31:15 -05:00

View File

@@ -4,9 +4,9 @@ let helpers = {};
export default helpers;
helpers.typeof = template(`
(function (obj) {
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
});
(typeof Symbol === "function" && typeof Symbol.iterator === "symbol")
? function (obj) { return typeof obj; }
: function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
`);
helpers.jsx = template(`