jsdoced.js icon indicating copy to clipboard operation
jsdoced.js copied to clipboard

port to es6 ?

Open jeromeetienne opened this issue 10 years ago • 2 comments

  • es6 is coming, jsdoced.js should be ready for that

jeromeetienne avatar Feb 20 '15 20:02 jeromeetienne

what does this changes

  • es6 provides new way to write functions.
  • i talked to benjamn and he told me all was there already to parse and write es6
    • https://github.com/benjamn/recast/issues/154
  • i think this is all that should change for es6
  • using recast.print should rewrite the whole thing without issue

jeromeetienne avatar Feb 20 '15 20:02 jeromeetienne

here is how to intercept arrow funciton in recast. looks at the rest of the processing to see how to process them. be sure to share as much code as possible with the es5 code

        recast.visit(ast, {
            // 
            visitArrowFunctionExpression: function(path){
                console.log('Found arrow function')
                this.traverse(path)             
            },

jeromeetienne avatar Feb 20 '15 20:02 jeromeetienne