Skip to content

Instantly share code, notes, and snippets.

@zaim
Last active August 29, 2015 14:13
Show Gist options
  • Save zaim/c71e3c21c081cd254da7 to your computer and use it in GitHub Desktop.
Save zaim/c71e3c21c081cd254da7 to your computer and use it in GitHub Desktop.
Trying out 6to5 - got AssertionError
function allcaps (words) {
// trying out fat arrows
return words.map(w => w.toUpperCase());
}
module.exports = allcaps;
$ node -v; node run.js
v0.10.35
/Users/zaim/Projects/_scratch/c71e3c21c081cd254da7/node_modules/6to5/node_modules/ast-types/lib/path-visitor.js:135
assert.ok(path instanceof NodePath);
^
AssertionError: /Users/zaim/Projects/_scratch/c71e3c21c081cd254da7/allcaps.js: false == true
at Visitor.PVp.visitWithoutReset (/Users/zaim/Projects/_scratch/c71e3c21c081cd254da7/node_modules/6to5/node_modules/ast-types/lib/path-visitor.js:135:12)
at Visitor.PVp.visit (/Users/zaim/Projects/_scratch/c71e3c21c081cd254da7/node_modules/6to5/node_modules/ast-types/lib/path-visitor.js:117:21)
at Function.transform (/Users/zaim/Projects/_scratch/c71e3c21c081cd254da7/node_modules/6to5/node_modules/regenerator/lib/visit.js:31:18)
at Object.exports.ast.before (/Users/zaim/Projects/_scratch/c71e3c21c081cd254da7/node_modules/6to5/lib/6to5/transformation/transformers/es6-generators.js:5:17)
at Transformer.astRun (/Users/zaim/Projects/_scratch/c71e3c21c081cd254da7/node_modules/6to5/lib/6to5/transformation/transformer.js:52:25)
at Transformer.transform (/Users/zaim/Projects/_scratch/c71e3c21c081cd254da7/node_modules/6to5/lib/6to5/transformation/transformer.js:72:8)
at /Users/zaim/Projects/_scratch/c71e3c21c081cd254da7/node_modules/6to5/lib/6to5/file.js:260:17
at Function.forEach (/Users/zaim/Projects/_scratch/c71e3c21c081cd254da7/node_modules/6to5/node_modules/lodash/dist/lodash.js:3297:15)
at File.transform (/Users/zaim/Projects/_scratch/c71e3c21c081cd254da7/node_modules/6to5/lib/6to5/file.js:259:5)
at /Users/zaim/Projects/_scratch/c71e3c21c081cd254da7/node_modules/6to5/lib/6to5/file.js:239:10
{
"name": "test-6to5",
"private": true,
"dependencies": {
"6to5": "^2.11.3"
},
"jshintConfig": {
"esnext": true
}
}
require('6to5/register');
var allcaps = require('./allcaps');
if (require.main === module) {
// should log ['HELLO', 'ES6', 'WORLD']
console.log(allcaps(['hello', 'es6', 'world']));
}
@zaim
Copy link
Author

zaim commented Jan 13, 2015

FIXED

For people stumbling on here, this issue is fixed in 6to5 v2.11.4 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment