Bug 258858 - Reformatting ES6 object deletes empty rows
Reformatting ES6 object deletes empty rows
Status: RESOLVED FIXED
Product: javascript
Classification: Unclassified
Component: Formatting & Indentation
8.2
PC Linux
: P3 (vote)
: 8.2
Assigned To: Petr Hejl
issues@javascript
:
Depends on:
Blocks: 242387
  Show dependency treegraph
 
Reported: 2016-04-15 15:15 UTC by dusty
Modified: 2016-04-28 14:34 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dusty 2016-04-15 15:15:49 UTC
If I have a code similar to this one:

export default Ember.Route.extend({

  x1: Ember.inject.service('myserv'),
  x2: "noname",

  redirect (mode, transition) {
    this.transitionTo("console.dashboard")
  },

  actions: {

    gotoDbStats() {
      this.transitionTo("console.global-stats")
    },

    getMydata1() {
      this.get('cm').getOpenSessions().then( x => {
        // Do something
        return x
      })
    },

    signOut() {
      const cm = this.get('cm')
      cm.walletClose().then( () =>
        window.location.replace('/')
      )
    }
  }

get reformatted this way, deleting all empty rows:

export default Ember.Route.extend({
  x1: Ember.inject.service('myserv'),
  x2: "noname",
  redirect(mode, transition) {
    this.transitionTo("console.dashboard")
  },
  actions: {
    gotoDbStats() {
      this.transitionTo("console.global-stats")
    },
    getMydata1() {
      this.get('cm').getOpenSessions().then(x => {
        // Do something
        return x
      })
    },
    signOut() {
      const cm = this.get('cm')
      cm.walletClose().then(() =>
              window.location.replace('/')
              )
    }
  }
}
Comment 1 dusty 2016-04-15 15:16:17 UTC
also, the indenting of signOut is less then optimal IMHO
Comment 2 Petr Hejl 2016-04-18 08:33:14 UTC
Except the arrow function formatting this does not seem to be ES6 specific.
Comment 3 dusty 2016-04-18 08:43:15 UTC
There are also the function definitions in ES6 style.

But you are right: the problem is there also when editing old JS code, I didn't notice before.
Comment 4 Petr Hejl 2016-04-28 14:34:55 UTC
Empty row preservation is now configurable - web-main a16756d7232a.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo