question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ES6 Class breaks build as "reserved keyword"

See original GitHub issue
class WebSocket {
[12:01:50] [AngularFilesort] Error in plugin 'gulp-angular-filesort'
Message:
    Error in parsing: "components/api/websocket.service.js", Line 6: Unexpected reserved word

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
kyleThayerXpanxioncommented, Jul 12, 2017

If you are using babel, you can just use:

var injectScripts = gulp.src([
      path.join(conf.paths.src, '/app/**/*.module.js'),
      path.join(conf.paths.src, '/app/**/*.js'),
      path.join('!' + conf.paths.src, '/app/**/*.spec.js'),
      path.join('!' + conf.paths.src, '/app/**/*.mock.js')
    ])
   .pipe(babel())
    .pipe($.angularFilesort()).on('error', conf.errorHandler('AngularFilesort'));
2reactions
daanaertscommented, Jan 24, 2016

Thanks Javarome,

it works fine so far. Piping directly is easiest option I found.

var injectScripts = gulp.src([
      path.join(conf.paths.src, '/app/**/*.module.js'),
      path.join(conf.paths.src, '/app/**/*.js'),
      path.join('!' + conf.paths.src, '/app/**/*.spec.js'),
      path.join('!' + conf.paths.src, '/app/**/*.mock.js')
    ])
    .pipe($.es6Transpiler({
      globals: {
        globalvars.
      }
    }))
    .pipe($.angularFilesort()).on('error', conf.errorHandler('AngularFilesort'));
Read more comments on GitHub >

github_iconTop Results From Across the Web

Reserved keywords in ES6 with example usage - Medium
Reserved keywords in ES6 with example usage ; break — terminates a loop or a switch construct ; case — it's a clause...
Read more >
List of reserved keywords #2536 - microsoft/TypeScript - GitHub
Is there a list of reserved keywords for Typescript somewhere? ... break. case. catch. class. const. continue. debugger. default.
Read more >
Classes - JavaScript - MDN Web Docs
Classes are a template for creating objects. ... A constructor can use the super keyword to call the constructor of the super class....
Read more >
node.js / ES6 / class creation : SyntaxError: Unexpected ...
For some reason the ES6 reserved words like class and extends were throwing SyntaxError: Unexpected reserved word, even when using --harmony flag.
Read more >
JavaScript Reserved Words - W3Schools
JavaScript Reserved Words ; abstract, arguments, await*, boolean ; break, byte, case, catch ; char, class*, const, continue.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found