Browse Source

linting, consistency

gh-669
Rich-Harris 9 years ago
parent
commit
fe21dc85c8
  1. 3
      src/ast/isReference.js
  2. 24
      test/form/computed-properties/_expected/amd.js
  3. 8
      test/form/computed-properties/_expected/cjs.js
  4. 8
      test/form/computed-properties/_expected/es6.js
  5. 26
      test/form/computed-properties/_expected/iife.js
  6. 30
      test/form/computed-properties/_expected/umd.js
  7. 8
      test/form/computed-properties/main.js

3
src/ast/isReference.js

@ -10,8 +10,7 @@ export default function isReference ( node, parent ) {
if ( !parent ) return true; if ( !parent ) return true;
// TODO is this right? // TODO is this right?
if ( parent.type === 'MemberExpression' || if ( parent.type === 'MemberExpression' || parent.type === 'MethodDefinition' ) {
parent.type === 'MethodDefinition' ) {
return parent.computed || node === parent.object; return parent.computed || node === parent.object;
} }

24
test/form/computed-properties/_expected/amd.js

@ -1,19 +1,19 @@
define(['exports'], function (exports) { 'use strict'; define(['exports'], function (exports) { 'use strict';
var foo = 'foo'; var foo = 'foo';
var bar = 'bar'; var bar = 'bar';
var baz = 'baz'; var baz = 'baz';
var bam = 'bam'; var bam = 'bam';
var x = {[foo]: 'bar'}; var x = { [foo]: 'bar' };
class X { class X {
[bar]() {} [bar] () {}
get [baz]() {} get [baz] () {}
set [bam](value) {} set [bam] ( value ) {}
} }
exports.x = x; exports.x = x;
exports.X = X; exports.X = X;
}); });

8
test/form/computed-properties/_expected/cjs.js

@ -5,12 +5,12 @@ var bar = 'bar';
var baz = 'baz'; var baz = 'baz';
var bam = 'bam'; var bam = 'bam';
var x = {[foo]: 'bar'}; var x = { [foo]: 'bar' };
class X { class X {
[bar]() {} [bar] () {}
get [baz]() {} get [baz] () {}
set [bam](value) {} set [bam] ( value ) {}
} }
exports.x = x; exports.x = x;

8
test/form/computed-properties/_expected/es6.js

@ -3,12 +3,12 @@ var bar = 'bar';
var baz = 'baz'; var baz = 'baz';
var bam = 'bam'; var bam = 'bam';
var x = {[foo]: 'bar'}; var x = { [foo]: 'bar' };
class X { class X {
[bar]() {} [bar] () {}
get [baz]() {} get [baz] () {}
set [bam](value) {} set [bam] ( value ) {}
} }
export { x, X }; export { x, X };

26
test/form/computed-properties/_expected/iife.js

@ -1,20 +1,20 @@
(function (exports) { (function (exports) {
'use strict'; 'use strict';
var foo = 'foo'; var foo = 'foo';
var bar = 'bar'; var bar = 'bar';
var baz = 'baz'; var baz = 'baz';
var bam = 'bam'; var bam = 'bam';
var x = {[foo]: 'bar'}; var x = { [foo]: 'bar' };
class X { class X {
[bar]() {} [bar] () {}
get [baz]() {} get [baz] () {}
set [bam](value) {} set [bam] ( value ) {}
} }
exports.x = x; exports.x = x;
exports.X = X; exports.X = X;
}((this.computedProperties = {}))); }((this.computedProperties = {})));

30
test/form/computed-properties/_expected/umd.js

@ -1,23 +1,23 @@
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) : typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.computedProperties = {}))); (factory((global.computedProperties = {})));
}(this, function (exports) { 'use strict'; }(this, function (exports) { 'use strict';
var foo = 'foo'; var foo = 'foo';
var bar = 'bar'; var bar = 'bar';
var baz = 'baz'; var baz = 'baz';
var bam = 'bam'; var bam = 'bam';
var x = {[foo]: 'bar'}; var x = { [foo]: 'bar' };
class X { class X {
[bar]() {} [bar] () {}
get [baz]() {} get [baz] () {}
set [bam](value) {} set [bam] ( value ) {}
} }
exports.x = x; exports.x = x;
exports.X = X; exports.X = X;
})); }));

8
test/form/computed-properties/main.js

@ -3,10 +3,10 @@ var bar = 'bar';
var baz = 'baz'; var baz = 'baz';
var bam = 'bam'; var bam = 'bam';
export var x = {[foo]: 'bar'}; export var x = { [foo]: 'bar' };
export class X { export class X {
[bar]() {} [bar] () {}
get [baz]() {} get [baz] () {}
set [bam](value) {} set [bam] ( value ) {}
} }

Loading…
Cancel
Save