Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace espower-source with babel-plugin-espower #7

Merged
merged 2 commits into from
Apr 20, 2015
Merged

Replace espower-source with babel-plugin-espower #7

merged 2 commits into from
Apr 20, 2015

Conversation

twada
Copy link
Member

@twada twada commented Apr 19, 2015

Hi, I've released babel-plugin-espower yesterday.

babel-plugin-espower works as babel plugin, transforms ES6 tree to espowered ES6 tree. ES6 -> ES5 pre-transpilation is not required any more!

@azu
Copy link
Member

azu commented Apr 20, 2015

@twada Sound good! Thank you!

Mostly no problem, but I found strange result in such case:

 Error: Line 1: Unexpected token ILLEGAL
require("babel-core/polyfill")

let assert = require('power-assert')

describe("ES7 async/await", ()=>{
  it("works", async()=>{
    let ok = await Promise.resolve("OK")

    assert(`${ok}` === "OK de nai")
  })
})

Output:

npm test

> espower-babel@1.4.1 test /Users/azusa_okayama/.ghq/github.com/azu/espower-babel
> mocha --require './guess' test/**/*.js && mocha --require './test_loader/espower-traceur-loader' test/**/*.js



  ES7 async/await
    1) works

  power-assert message
    ✓ Nested CallExpression with BinaryExpression: assert((three * (seven * ten)) === three)
    ✓ equal with Literal and Identifier: assert.equal(1, minusOne)


  2 passing (47ms)
  1 failing

  1) ES7 async/await works:
     Error: Line 1: Unexpected token ILLEGAL
      at Array.forEach (native)
      at Object.callee$1$0$ (test/tobe_instrumented/es7_test.js:21:11)



npm ERR! Test failed.  See above for more details.

The issue come from Babel or babel-plugin-espower?

@azu
Copy link
Member

azu commented Apr 20, 2015

in master branch(Babel-Core+espower-source) result:

  1) ES7 async/await works:

        # /Users/azusa_okayama/.ghq/github.com/azu/espower-babel/test/tobe_instrumented/es7_test.js:21

  assert("" + ok === "OK de nai")
            | |  |
            | |  false
            | "OK"
            "OK"

  --- [string] "OK de nai"
  +++ [string] "" + ok
  @@ -1,9 +1,2 @@
   OK
  - de nai

@twada
Copy link
Member Author

twada commented Apr 20, 2015

@azu I'm so sorry that I forgot updating power-assert...

Updated power-assert to 0.11.0 for ES6 syntax output support.

azu added a commit that referenced this pull request Apr 20, 2015
Replace espower-source with babel-plugin-espower
@azu azu merged commit a9cb1b7 into power-assert-js:master Apr 20, 2015
@azu
Copy link
Member

azu commented Apr 20, 2015

Good! merged.
espower-babel zsh 2015-04-20 14-59-52

@twada
Copy link
Member Author

twada commented Apr 20, 2015

@azu Thanks!!

@twada twada deleted the babel-plugin-espower branch April 20, 2015 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants