Skip to content

Babel Transform += with await #8027

Closed
Closed

Description

@ICELI

Bug Report

Current Behavior
Babel transform x += await 2 different with x = x + await 2
but node v8.9.4 or chrome 66.0 that also be the same

Input Code

  • REPL or Repo link if applicable:
let x = 0

let log = function() {
  console.log(x, 'log')
  return 2;
}

async function test() {
  // x += await log() // case 1
  x = x + await log() // case 2
  console.log(x, 'test')
}

test()

x += 1
console.log(x, 'global')

// case1
// 0 "log"
// 1 "global"
// 3 "test"


// case2
// 0 "log"
// 1 "global"
// 2 "test"

http://babeljs.io/repl/#?babili=false&browsers=&build=&builtIns=false&code_lz=DYUwLgBAHhC8EAYBQTSWAewOZwgMwFcA7AYzAEsMiAKASggG8kIISqBnDUAOky2qgAaCAHI-I2swgAncAWlEIAJgDcSAL4oAhuwCepfMTKVFYEOzB1GUgPQ3oEANTwtAdy3l02K3dY6QEACMUjDwMI4Qbh5e_PS-JP7KUmxEnDx8AsIiZhYSGig5lpJI4fDBKWkgvN5ColiYAEZawHlI8f7BvggQAER8PW32gb31GE3AA74AzL2FAyjt7CBKg4i9_avDPaPjk_ZKs-Zg80A&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=true&fileSize=false&lineWrap=false&presets=latest%2Creact%2Cstage-2&prettier=false&targets=&version=6.26.0&envVersion=

Activity

  1. babel-bot commented on May 24, 2018

    @babel-bot
    Collaborator

    Hey @ICELI! We really appreciate you taking the time to report an issue. The collaborators
    on this project attempt to help as many people as possible, but we're a limited number of volunteers,
    so it's possible this won't be addressed swiftly.

    If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
    community that typically always has someone willing to help. You can sign-up here
    for an invite.

  2. nicolo-ribaudo commented on May 25, 2018

    @nicolo-ribaudo
    Member

    Moved to meta/regenerator#345. Thank you for the bug report!

  3. added
    outdated
    on Aug 24, 2018
  4. locked as resolved and limited conversation to collaborators on Aug 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: upstreamoutdated

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions