Skip to content

Instantly share code, notes, and snippets.

@lloydwatkin
Created November 30, 2015 15:04
Show Gist options
  • Save lloydwatkin/c03121764e863bf7c30b to your computer and use it in GitHub Desktop.
Save lloydwatkin/c03121764e863bf7c30b to your computer and use it in GitHub Desktop.
Babel-ified code works in Chrome but not Chromium (37)
_getItemIdStrs() {
const result = []
const itemIdStrings = Object.keys(this.state)
for (const itemIdStr of itemIdStrings) {
if (itemIdStr !== 'groups') {
result.push(itemIdStr)
}
}
return result
}
/* Gets transpiled to: */
{
key: '_getItemIdStrs',
value: function _getItemIdStrs() {
var result = [];
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator = Object.keys(this.state)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var itemIdStr = _step.value;
if (itemIdStr !== 'groups') {
result.push(itemIdStr);
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator['return']) {
_iterator['return']();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
return result;
}
/* Gets 'undefined' is not a function at line 23 at Object.keys(this.state)[Symbol.iterator]() (specifically the Symbol.iterator key function call)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment