Packages: [JavaScript] Inconsistent scope for class properties

Created on 30 Aug 2018  路  4Comments  路  Source: sublimehq/Packages

2018-08-30-080749_683x384_scrot

Here are the scopes for the given properies:

class Person {
  constructor(name, age, type, hair, height, weight, eyes) {
    this.name = name;
    //   ^^^^  source.js meta.class.js meta.block.js meta.block.js support.constant.dom.js
    this.age = age;
    //   ^^^  source.js meta.class.js meta.block.js meta.block.js meta.property.object.js
    this.type = type;
    //   ^^^^  ... support.constant.dom.js
    this.hair = hair;
    //   ^^^^  ... meta.property.object.js
    this.height = height;
    //   ^^^^^^  ... support.constant.dom.js
    this.weight = weight;
    //   ^^^^^^  ... meta.property.object.js
    this.eyes = eyes;
    //   ^^^^  ... meta.property.object.js
  }
}

Apparently github follows the same rules for determining scopes :D

Most helpful comment

@Thom1729 Thanks for replying, awsome :D
@michaelblyons hahaha, I think I could go with width.
Here is my new "implementation". Hair was a problem. Luckily functional programming came to the rescue :D
2018-08-30-160025_835x529_scrot

All 4 comments

These are my guesses, from MDN:

  • Web/API/Element/name
  • Web/SVG/Attribute/type
  • Web/SVG/Attribute/height

Why don't you have a width on your Person instead of a weight? 馃槈

This is an old feature of the JavaScript syntax that specially highlights some property names that are used in the DOM API. This PR will remove those.

@Thom1729 Thanks for replying, awsome :D
@michaelblyons hahaha, I think I could go with width.
Here is my new "implementation". Hair was a problem. Luckily functional programming came to the rescue :D
2018-08-30-160025_835x529_scrot

Fixed by #1641.

Was this page helpful?
0 / 5 - 0 ratings