GithubHelp home page GithubHelp logo

babel-preset-es2015-node6's People

Contributors

jhen0409 avatar rgbkrk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

babel-preset-es2015-node6's Issues

Error: Options {"loose":true} passed to a preset which does not accept options.

When using es2015-node6 (0.3.0) within another preset using require :

module.exports = {
  presets: [
    [require("babel-preset-es2015-node6"), { loose: true }]
  ]
};

I get the following error :

Error: Options {"loose":true} passed to a preset which does not accept options.


This is working fine :

module.exports = {
  presets: [
    ["es2015-node6", { loose: true }]
  ]
};

But I still need to use require for my preset (as described in official doc and in official presets)

Use class `super` for async function

I'm sure this is just user error or not knowing what other piece I need to add to this to make this work, but this is what i'm getting when i try to use async/await with object super.

.babelrc:

{
  "presets": [
    "es2015-node6",
    "stage-1"
  ]
}

minimal code to reproduce:

class Master {
  async setup() {
    console.log('hi');
  }
}

class Child extends Master {
  async setupChild() {
    await super.setup();
  }
}

const x = new Child();

x.setupChild();

Compiled code:

'use strict';

function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; }

let Master = class Master {
  setup() {
    return _asyncToGenerator(function* () {
      console.log('hi');
    })();
  }
};
let Child = class Child extends Master {
  setupChild() {
    return _asyncToGenerator(function* () {
      yield super.setup();
    })();
  }
};


const x = new Child();

x.setupChild();

error:

      yield super.setup();
            ^^^^^
SyntaxError: 'super' keyword unexpected here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.