title: how to uglify javascript classes?
body: <p>I'm writing basic javascript using the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes" rel="noreferrer">classes syntax</a> and trying to <a href="https://github.com/terinjokes/gulp-uglify" rel="noreferrer">uglify it with gulp</a>, but getting this error:</p>
  
  <blockquote>
    <p>events.js:72<br>
    throw er; // Unhandled 'error' event</p>
  </blockquote>
  
  <p>I simply used the example code from mozilla's website:</p>
  
  <pre><code>class Polygon {
    constructor(height, width) {
      this.height = height;
      this.width = width;
    }
  }
  </code></pre>
  
  <p>And nothing special about my gulp file - works perfectly for any non-class js:</p>
  
  <pre><code>// Include gulp
  var gulp = require('gulp');
  
  // Include Our Plugins
  var jshint = require('gulp-jshint');
  var concat = require('gulp-concat');
  var uglify = require('gulp-uglify');
  var rename = require('gulp-rename');
  
  // Lint Task
  gulp.task('lint', function() {
      return gulp.src('js/*.js')
          .pipe(jshint())
          .pipe(jshint.reporter('default'));
  });
  
  // Concatenate &amp; Minify JS
  gulp.task('scripts', function() {
      return gulp.src('js/*.js')
          .pipe(concat('all.js'))
          .pipe(gulp.dest('dist/js'))
          .pipe(rename('all.min.js'))
          .pipe(uglify())
          .pipe(gulp.dest('dist/js'));
  });
  
  // Watch Files For Changes
  gulp.task('watch', function() {
      gulp.watch('js/*.js', ['lint', 'scripts']);
      gulp.watch('scss/*.scss', ['sass']);
  });
  
  // Default Task
  gulp.task('default', ['lint', 'scripts', 'watch']);
  </code></pre>