[gjs: 31/43] CI: Add object-shorthand to eslint rules
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 31/43] CI: Add object-shorthand to eslint rules
- Date: Wed, 14 Aug 2019 17:29:40 +0000 (UTC)
commit 913cc0425b6fb81a5941db17e094a23daaf646fe
Author: Philip Chimento <philip chimento gmail com>
Date: Sat Aug 3 23:59:52 2019 -0700
CI: Add object-shorthand to eslint rules
We tend to encourage the method syntax and property shorthand from ES6
in order to save typing (and typing "function" or the name of a property
twice doesn't really make things more readable.)
.eslintrc.yml | 1 +
installed-tests/js/modules/subA/subB/__init__.js | 4 +-
installed-tests/js/testEverythingBasic.js | 2 +-
installed-tests/js/testGObjectClass.js | 2 +-
installed-tests/js/testLegacyClass.js | 76 ++++++++++----------
installed-tests/js/testLegacyGObject.js | 89 +++++++++---------------
installed-tests/js/testLegacyGtk.js | 4 +-
installed-tests/js/testSignals.js | 2 +-
installed-tests/js/testTweener.js | 10 +--
modules/_bootstrap/debugger.js | 4 +-
modules/_legacy.js | 12 ++--
modules/gettext.js | 6 +-
modules/overrides/GObject.js | 18 ++---
modules/signals.js | 6 +-
modules/tweener/tweenList.js | 4 +-
modules/tweener/tweener.js | 14 ++--
16 files changed, 115 insertions(+), 139 deletions(-)
---
diff --git a/.eslintrc.yml b/.eslintrc.yml
index 25d1d2c3..8b491525 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -112,6 +112,7 @@ rules:
- error
- consistent: true
object-curly-spacing: error
+ object-shorthand: error
prefer-template: error
quotes:
- error
diff --git a/installed-tests/js/modules/subA/subB/__init__.js
b/installed-tests/js/modules/subA/subB/__init__.js
index d7424021..671cffc8 100644
--- a/installed-tests/js/modules/subA/subB/__init__.js
+++ b/installed-tests/js/modules/subA/subB/__init__.js
@@ -9,11 +9,11 @@ function ImporterClass() {
}
ImporterClass.prototype = {
- _init: function() {
+ _init() {
this._a = '__init__ class tested';
},
- testMethod: function() {
+ testMethod() {
return this._a;
},
};
diff --git a/installed-tests/js/testEverythingBasic.js b/installed-tests/js/testEverythingBasic.js
index c61f13f1..2b158c3d 100644
--- a/installed-tests/js/testEverythingBasic.js
+++ b/installed-tests/js/testEverythingBasic.js
@@ -240,7 +240,7 @@ describe('Life, the Universe and Everything', function () {
it('callback with destroy-notify', function () {
let testObj = {
- test: function (data) {
+ test(data) {
return data;
},
};
diff --git a/installed-tests/js/testGObjectClass.js b/installed-tests/js/testGObjectClass.js
index 57101758..a23768d6 100644
--- a/installed-tests/js/testGObjectClass.js
+++ b/installed-tests/js/testGObjectClass.js
@@ -328,7 +328,7 @@ describe('GObject class with decorator', function () {
},
}, class InterfacePropObject extends GObject.Object {});
let file = Gio.File.new_for_path('dummy');
- expect(() => new InterfacePropObject({file: file})).not.toThrow();
+ expect(() => new InterfacePropObject({file})).not.toThrow();
});
it('can override a property from the parent class', function () {
diff --git a/installed-tests/js/testLegacyClass.js b/installed-tests/js/testLegacyClass.js
index 523e3f10..cc5f1875 100644
--- a/installed-tests/js/testLegacyClass.js
+++ b/installed-tests/js/testLegacyClass.js
@@ -6,7 +6,7 @@ const Lang = imports.lang;
const NormalClass = new Lang.Class({
Name: 'NormalClass',
- _init: function() {
+ _init() {
this.one = 1;
},
});
@@ -16,7 +16,7 @@ const MetaClass = new Lang.Class({
Name: 'MetaClass',
Extends: Lang.Class,
- _init: function(params) {
+ _init(params) {
Subclassed.push(params.Name);
this.parent(params);
@@ -35,7 +35,7 @@ const CustomMetaOne = new MetaClass({
Extends: NormalClass,
Extended: false,
- _init: function() {
+ _init() {
this.parent();
this.two = 2;
@@ -47,7 +47,7 @@ const CustomMetaTwo = new MetaClass({
Extends: NormalClass,
Extended: true,
- _init: function() {
+ _init() {
this.parent();
this.two = 2;
@@ -61,7 +61,7 @@ const CustomMetaSubclass = new Lang.Class({
Extends: CustomMetaOne,
Extended: true,
- _init: function() {
+ _init() {
this.parent();
this.three = 3;
@@ -126,18 +126,18 @@ describe('A metaclass', function () {
const MagicBase = new Lang.Class({
Name: 'MagicBase',
- _init: function(a, buffer) {
+ _init(a, buffer) {
if (buffer)
buffer.push(a);
this.a = a;
},
- foo: function(a, buffer) {
+ foo(a, buffer) {
buffer.push(a);
return a * 3;
},
- bar: function(a) {
+ bar(a) {
return a * 5;
},
});
@@ -147,20 +147,20 @@ const Magic = new Lang.Class({
Extends: MagicBase,
- _init: function(a, b, buffer) {
+ _init(a, b, buffer) {
this.parent(a, buffer);
if (buffer)
buffer.push(b);
this.b = b;
},
- foo: function(a, b, buffer) {
+ foo(a, b, buffer) {
let val = this.parent(a, buffer);
buffer.push(b);
return val * 2;
},
- bar: function(a, buffer) {
+ bar(a, buffer) {
this.foo(a, 2 * a, buffer);
return this.parent(a);
},
@@ -169,7 +169,7 @@ const Magic = new Lang.Class({
const Accessor = new Lang.Class({
Name: 'AccessorMagic',
- _init: function(val) {
+ _init(val) {
this._val = val;
},
@@ -188,7 +188,7 @@ const AbstractBase = new Lang.Class({
Name: 'AbstractBase',
Abstract: true,
- _init: function() {
+ _init() {
this.foo = 42;
},
});
@@ -238,7 +238,7 @@ describe('Class framework', function () {
const ToStringOverride = new Lang.Class({
Name: 'ToStringOverride',
- toString: function() {
+ toString() {
let oldToString = this.parent();
return `${oldToString}; hello`;
},
@@ -274,7 +274,7 @@ describe('Class framework', function () {
Name: 'AbstractImpl',
Extends: AbstractBase,
- _init: function() {
+ _init() {
this.parent();
this.bar = 42;
},
@@ -315,7 +315,7 @@ describe('Class framework', function () {
const CustomConstruct = new Lang.Class({
Name: 'CustomConstruct',
- _construct: function(one, two) {
+ _construct(one, two) {
return [one, two];
},
});
@@ -344,23 +344,23 @@ const AnInterface = new Lang.Interface({
required: Lang.Interface.UNIMPLEMENTED,
- optional: function () {
+ optional() {
return 'AnInterface.optional()';
},
- optionalGeneric: function () {
+ optionalGeneric() {
return 'AnInterface.optionalGeneric()';
},
- argumentGeneric: function (arg) {
+ argumentGeneric(arg) {
return `AnInterface.argumentGeneric(${arg})`;
},
- usesThis: function () {
+ usesThis() {
return this._interfacePrivateMethod();
},
- _interfacePrivateMethod: function () {
+ _interfacePrivateMethod() {
return 'interface private method';
},
@@ -377,12 +377,12 @@ const InterfaceRequiringOtherInterface = new Lang.Interface({
Name: 'InterfaceRequiringOtherInterface',
Requires: [AnInterface],
- optional: function () {
+ optional() {
return `InterfaceRequiringOtherInterface.optional()\n${
AnInterface.prototype.optional.apply(this, arguments)}`;
},
- optionalGeneric: function () {
+ optionalGeneric() {
return `InterfaceRequiringOtherInterface.optionalGeneric()\n${
AnInterface.optionalGeneric(this)}`;
},
@@ -392,21 +392,21 @@ const ObjectImplementingAnInterface = new Lang.Class({
Name: 'ObjectImplementingAnInterface',
Implements: [AnInterface],
- _init: function () {
+ _init() {
this.parent();
},
- required: function () {},
+ required() {},
- optional: function () {
+ optional() {
return AnInterface.prototype.optional.apply(this, arguments);
},
- optionalGeneric: function () {
+ optionalGeneric() {
return AnInterface.optionalGeneric(this);
},
- argumentGeneric: function (arg) {
+ argumentGeneric(arg) {
return AnInterface.argumentGeneric(this, `${arg} (hello from class)`);
},
});
@@ -420,20 +420,20 @@ const MinimalImplementationOfAnInterface = new Lang.Class({
Name: 'MinimalImplementationOfAnInterface',
Implements: [AnInterface],
- required: function () {},
+ required() {},
});
const ImplementationOfTwoInterfaces = new Lang.Class({
Name: 'ImplementationOfTwoInterfaces',
Implements: [AnInterface, InterfaceRequiringOtherInterface],
- required: function () {},
+ required() {},
- optional: function () {
+ optional() {
return InterfaceRequiringOtherInterface.prototype.optional.apply(this, arguments);
},
- optionalGeneric: function () {
+ optionalGeneric() {
return InterfaceRequiringOtherInterface.optionalGeneric(this);
},
});
@@ -529,7 +529,7 @@ describe('An interface', function () {
const ObjectWithGetter = new Lang.Class({
Name: 'ObjectWithGetter',
Implements: [AnInterface],
- required: function () {},
+ required() {},
get some_prop() {
return 'ObjectWithGetter.some_prop getter';
},
@@ -542,7 +542,7 @@ describe('An interface', function () {
const ObjectWithSetter = new Lang.Class({
Name: 'ObjectWithSetter',
Implements: [AnInterface],
- required: function () {},
+ required() {},
set some_prop(value) { /* setter without getter */// jshint ignore:line
this.overridden_some_prop_setter_called = true;
},
@@ -591,7 +591,7 @@ describe('An interface', function () {
Name: 'MinimalImplementationOfTwoInterfaces',
Implements: [AnInterface, InterfaceRequiringOtherInterface],
- required: function () {},
+ required() {},
});
let obj = new MinimalImplementationOfTwoInterfaces();
expect(obj.optionalGeneric())
@@ -602,7 +602,7 @@ describe('An interface', function () {
expect(() => new Lang.Class({
Name: 'ObjectWithNotEnoughInterfaces',
Implements: [InterfaceRequiringOtherInterface],
- required: function () {},
+ required() {},
})).toThrow();
});
@@ -610,7 +610,7 @@ describe('An interface', function () {
expect(() => new Lang.Class({
Name: 'ObjectWithInterfacesInWrongOrder',
Implements: [InterfaceRequiringOtherInterface, AnInterface],
- required: function () {},
+ required() {},
})).toThrow();
});
@@ -647,7 +647,7 @@ describe('An interface', function () {
expect(() => new Lang.Class({
Name: 'ObjectWithoutRequiredParent',
Implements: [AnInterface, InterfaceRequiringOtherInterface, InterfaceRequiringClassAndInterface],
- required: function () {},
+ required() {},
})).toThrow();
});
diff --git a/installed-tests/js/testLegacyGObject.js b/installed-tests/js/testLegacyGObject.js
index 6c2b62b3..f30bc906 100644
--- a/installed-tests/js/testLegacyGObject.js
+++ b/installed-tests/js/testLegacyGObject.js
@@ -38,7 +38,7 @@ const MyObject = new GObject.Class({
},
},
- _init: function(props) {
+ _init(props) {
// check that it's safe to set properties before
// chaining up (priv is NULL at this point, remember)
this._readwrite = 'foo';
@@ -82,43 +82,43 @@ const MyObject = new GObject.Class({
this._constructCalled = true;
},
- notify_prop: function() {
+ notify_prop() {
this._readonly = 'changed';
this.notify('readonly');
},
- emit_empty: function() {
+ emit_empty() {
this.emit('empty');
},
- emit_minimal: function(one, two) {
+ emit_minimal(one, two) {
this.emit('minimal', one, two);
},
- emit_full: function() {
+ emit_full() {
return this.emit('full');
},
- emit_detailed: function() {
+ emit_detailed() {
this.emit('detailed::one');
this.emit('detailed::two');
},
- emit_run_last: function(callback) {
+ emit_run_last(callback) {
this._run_last_callback = callback;
this.emit('run-last');
},
- on_run_last: function() {
+ on_run_last() {
this._run_last_callback();
},
- on_empty: function() {
+ on_empty() {
this.empty_called = true;
},
- on_full: function() {
+ on_full() {
this.full_default_handler_called = true;
return 79;
},
@@ -129,11 +129,11 @@ const MyApplication = new Lang.Class({
Extends: Gio.Application,
Signals: {'custom': {param_types: [GObject.TYPE_INT]}},
- _init: function(params) {
+ _init(params) {
this.parent(params);
},
- emit_custom: function(n) {
+ emit_custom(n) {
this.emit('custom', n);
},
});
@@ -143,13 +143,13 @@ const MyInitable = new Lang.Class({
Extends: GObject.Object,
Implements: [Gio.Initable],
- _init: function(params) {
+ _init(params) {
this.parent(params);
this.inited = false;
},
- vfunc_init: function(cancellable) { // error?
+ vfunc_init(cancellable) { // error?
if (!(cancellable instanceof Gio.Cancellable))
throw new Error('Bad argument');
@@ -161,7 +161,7 @@ const Derived = new Lang.Class({
Name: 'Derived',
Extends: MyObject,
- _init: function() {
+ _init() {
this.parent({readwrite: 'yes'});
},
});
@@ -175,13 +175,13 @@ const MyCustomInit = new Lang.Class({
Name: 'MyCustomInit',
Extends: GObject.Object,
- _init: function() {
+ _init() {
this.foo = false;
this.parent();
},
- _instance_init: function() {
+ _instance_init() {
this.foo = true;
},
});
@@ -350,7 +350,7 @@ describe('GObject class', function () {
},
});
let file = Gio.File.new_for_path('dummy');
- expect(() => new InterfacePropObject({file: file})).not.toThrow();
+ expect(() => new InterfacePropObject({file})).not.toThrow();
});
it('can override a property from the parent class', function () {
@@ -391,10 +391,6 @@ const GObjectImplementingLangInterface = new Lang.Class({
Name: 'GObjectImplementingLangInterface',
Extends: GObject.Object,
Implements: [AnInterface],
-
- _init: function (props = {}) {
- this.parent(props);
- },
});
const AGObjectInterface = new Lang.Interface({
@@ -412,7 +408,7 @@ const AGObjectInterface = new Lang.Interface({
},
requiredG: Lang.Interface.UNIMPLEMENTED,
- optionalG: function () {
+ optionalG() {
return 'AGObjectInterface.optionalG()';
},
});
@@ -421,7 +417,7 @@ const InterfaceRequiringGObjectInterface = new Lang.Interface({
Name: 'InterfaceRequiringGObjectInterface',
Requires: [AGObjectInterface],
- optionalG: function () {
+ optionalG() {
return `InterfaceRequiringGObjectInterface.optionalG()\n${
AGObjectInterface.optionalG(this)}`;
},
@@ -450,11 +446,8 @@ const GObjectImplementingGObjectInterface = new Lang.Class({
return 'meh';
},
- _init: function (props = {}) {
- this.parent(props);
- },
- requiredG: function () {},
- optionalG: function () {
+ requiredG() {},
+ optionalG() {
return AGObjectInterface.optionalG(this);
},
});
@@ -468,10 +461,7 @@ const MinimalImplementationOfAGObjectInterface = new Lang.Class({
AGObjectInterface),
},
- _init: function (props = {}) {
- this.parent(props);
- },
- requiredG: function () {},
+ requiredG() {},
});
const ImplementationOfTwoInterfaces = new Lang.Class({
@@ -483,11 +473,8 @@ const ImplementationOfTwoInterfaces = new Lang.Class({
AGObjectInterface),
},
- _init: function (props = {}) {
- this.parent(props);
- },
- requiredG: function () {},
- optionalG: function () {
+ requiredG() {},
+ optionalG() {
return InterfaceRequiringGObjectInterface.optionalG(this);
},
});
@@ -514,10 +501,6 @@ describe('GObject interface', function () {
Name: 'ObjectImplementingLangInterfaceAndCInterface',
Extends: GObject.Object,
Implements: [AnInterface, Gio.Initable],
-
- _init: function (props = {}) {
- this.parent(props);
- },
});
let obj;
expect(() => {
@@ -569,11 +552,8 @@ describe('GObject interface', function () {
AGObjectInterface),
},
- _init: function (props = {}) {
- this.parent(props);
- },
- required: function () {},
- requiredG: function () {},
+ required() {},
+ requiredG() {},
});
let obj;
expect(() => {
@@ -646,10 +626,7 @@ describe('GObject interface', function () {
AGObjectInterface),
},
- _init: function (props = {}) {
- this.parent(props);
- },
- requiredG: function () {},
+ requiredG() {},
});
let obj = new MinimalImplementationOfTwoInterfaces();
expect(obj.optionalG())
@@ -660,7 +637,7 @@ describe('GObject interface', function () {
expect(() => new Lang.Class({
Name: 'BadObject',
Implements: [InterfaceRequiringGObjectInterface],
- required: function () {},
+ required() {},
})).toThrow();
});
@@ -668,7 +645,7 @@ describe('GObject interface', function () {
expect(() => new Lang.Class({
Name: 'BadObject',
Implements: [InterfaceRequiringGObjectInterface, AGObjectInterface],
- required: function () {},
+ required() {},
})).toThrow();
});
@@ -724,10 +701,8 @@ describe('GObject interface', function () {
Name: 'MyNaughtyObject',
Extends: GObject.Object,
Implements: [AGObjectInterface],
- _init: function (props = {}) {
- this.parent(props);
- },
- requiredG: function () {},
+
+ requiredG() {},
});
// g_test_assert_expected_messages() is a macro, not introspectable
GLib.test_assert_expected_messages_internal('Gjs', 'testGObjectInterface.js',
diff --git a/installed-tests/js/testLegacyGtk.js b/installed-tests/js/testLegacyGtk.js
index a91e59eb..97cc8899 100644
--- a/installed-tests/js/testLegacyGtk.js
+++ b/installed-tests/js/testLegacyGtk.js
@@ -44,7 +44,7 @@ const MyComplexGtkSubclass = new Lang.Class({
InternalChildren: ['internal-label-child'],
CssName: 'complex-subclass',
- testChildrenExist: function () {
+ testChildrenExist() {
this._internalLabel = this.get_template_child(MyComplexGtkSubclass, 'label-child');
expect(this._internalLabel).toEqual(jasmine.anything());
@@ -60,7 +60,7 @@ const MyComplexGtkSubclassFromResource = new Lang.Class({
Children: ['label-child', 'label-child2'],
InternalChildren: ['internal-label-child'],
- testChildrenExist: function () {
+ testChildrenExist() {
expect(this.label_child).toEqual(jasmine.anything());
expect(this.label_child2).toEqual(jasmine.anything());
expect(this._internal_label_child).toEqual(jasmine.anything());
diff --git a/installed-tests/js/testSignals.js b/installed-tests/js/testSignals.js
index c66ef8b4..93668633 100644
--- a/installed-tests/js/testSignals.js
+++ b/installed-tests/js/testSignals.js
@@ -7,7 +7,7 @@ const Signals = imports.signals;
const Foo = new Lang.Class({
Name: 'Foo',
Implements: [Signals.WithSignals],
- _init: function () {},
+ _init() {},
});
describe('Legacy object with signals', function () {
diff --git a/installed-tests/js/testTweener.js b/installed-tests/js/testTweener.js
index e5b596b9..4c00e81c 100644
--- a/installed-tests/js/testTweener.js
+++ b/installed-tests/js/testTweener.js
@@ -6,10 +6,10 @@ function installFrameTicker() {
let ticker = {
FRAME_RATE: 50,
- _init: function() {
+ _init() {
},
- start: function() {
+ start() {
this._currentTime = 0;
this._timeoutID = setInterval(() => {
@@ -18,7 +18,7 @@ function installFrameTicker() {
}, Math.floor(1000 / this.FRAME_RATE));
},
- stop: function() {
+ stop() {
if ('_timeoutID' in this) {
clearInterval(this._timeoutID);
delete this._timeoutID;
@@ -27,7 +27,7 @@ function installFrameTicker() {
this._currentTime = 0;
},
- getTime: function() {
+ getTime() {
return this._currentTime;
},
};
@@ -321,7 +321,7 @@ describe('Tweener', function () {
x: 10, y: 10, time: 1,
discrete: ['x'],
transition: 'linear',
- onUpdate: function() {
+ onUpdate() {
if (objectA.x !== Math.floor(objectA.x))
objectA.xFraction = true;
if (objectA.y !== Math.floor(objectA.y))
diff --git a/modules/_bootstrap/debugger.js b/modules/_bootstrap/debugger.js
index 24ced579..ee01d77c 100644
--- a/modules/_bootstrap/debugger.js
+++ b/modules/_bootstrap/debugger.js
@@ -89,7 +89,7 @@ function showDebuggeeValue(dv, style = {pretty: options.pretty}) {
Object.defineProperty(Debugger.Frame.prototype, 'num', {
configurable: true,
enumerable: false,
- get: function() {
+ get() {
let i = 0;
let f;
for (f = topFrame; f && f !== this; f = f.older)
@@ -126,7 +126,7 @@ Debugger.Frame.prototype.describeFull = function() {
Object.defineProperty(Debugger.Frame.prototype, 'line', {
configurable: true,
enumerable: false,
- get: function() {
+ get() {
if (this.script)
return this.script.getOffsetLocation(this.offset).lineNumber;
else
diff --git a/modules/_legacy.js b/modules/_legacy.js
index f7d59c87..455bc736 100644
--- a/modules/_legacy.js
+++ b/modules/_legacy.js
@@ -456,7 +456,7 @@ function defineGObjectLegacyObjects(GObject) {
Name: 'GObjectClass',
Extends: Class,
- _init: function (params) {
+ _init(params) {
// retrieve signals and remove them from params before chaining
let signals = params.Signals;
delete params.Signals;
@@ -493,7 +493,7 @@ function defineGObjectLegacyObjects(GObject) {
}.bind(this));
},
- _isValidClass: function(klass) {
+ _isValidClass(klass) {
let proto = klass.prototype;
if (!proto)
@@ -508,7 +508,7 @@ function defineGObjectLegacyObjects(GObject) {
// If we want an object with a custom JSClass, we can't just
// use a function. We have to use a custom constructor here.
- _construct: function(params) {
+ _construct(params) {
if (!params.Name)
throw new TypeError("Classes require an explicit 'Name' parameter.");
let name = params.Name;
@@ -572,7 +572,7 @@ function defineGObjectLegacyObjects(GObject) {
},
// Overrides Lang.Class.implements()
- implements: function (iface) {
+ implements(iface) {
if (iface instanceof GObject.Interface)
return GObject.type_is_a(this.$gtype, iface.$gtype);
else
@@ -649,7 +649,7 @@ function defineGtkLegacyObjects(GObject, Gtk) {
Name: 'GtkWidgetClass',
Extends: GObject.Class,
- _init: function(params) {
+ _init(params) {
let template = params.Template;
delete params.Template;
@@ -696,7 +696,7 @@ function defineGtkLegacyObjects(GObject, Gtk) {
}
},
- _isValidClass: function(klass) {
+ _isValidClass(klass) {
let proto = klass.prototype;
if (!proto)
diff --git a/modules/gettext.js b/modules/gettext.js
index 13b0f49e..8bc06d4a 100644
--- a/modules/gettext.js
+++ b/modules/gettext.js
@@ -86,15 +86,15 @@ function dpgettext(dom, context, msgid) {
*/
function domain(domainName) {
return {
- gettext: function(msgid) {
+ gettext(msgid) {
return GLib.dgettext(domainName, msgid);
},
- ngettext: function(msgid1, msgid2, n) {
+ ngettext(msgid1, msgid2, n) {
return GLib.dngettext(domainName, msgid1, msgid2, n);
},
- pgettext: function(context, msgid) {
+ pgettext(context, msgid) {
return GLib.dpgettext2(domainName, context, msgid);
},
};
diff --git a/modules/overrides/GObject.js b/modules/overrides/GObject.js
index 1cd6d1ca..cb29f259 100644
--- a/modules/overrides/GObject.js
+++ b/modules/overrides/GObject.js
@@ -297,63 +297,63 @@ function _init() {
'name': {
configurable: false,
enumerable: false,
- get: function() {
+ get() {
return this.get_name();
},
},
'_nick': {
configurable: false,
enumerable: false,
- get: function() {
+ get() {
return this.get_nick();
},
},
'nick': {
configurable: false,
enumerable: false,
- get: function() {
+ get() {
return this.get_nick();
},
},
'_blurb': {
configurable: false,
enumerable: false,
- get: function() {
+ get() {
return this.get_blurb();
},
},
'blurb': {
configurable: false,
enumerable: false,
- get: function() {
+ get() {
return this.get_blurb();
},
},
'default_value': {
configurable: false,
enumerable: false,
- get: function() {
+ get() {
return this.get_default_value();
},
},
'flags': {
configurable: false,
enumerable: false,
- get: function() {
+ get() {
return GjsPrivate.param_spec_get_flags(this);
},
},
'value_type': {
configurable: false,
enumerable: false,
- get: function() {
+ get() {
return GjsPrivate.param_spec_get_value_type(this);
},
},
'owner_type': {
configurable: false,
enumerable: false,
- get: function() {
+ get() {
return GjsPrivate.param_spec_get_owner_type(this);
},
},
diff --git a/modules/signals.js b/modules/signals.js
index bcb20bf8..10029477 100644
--- a/modules/signals.js
+++ b/modules/signals.js
@@ -50,9 +50,9 @@ function _connect(name, callback) {
// it's right to optimize for low memory and reentrancy-safety
// rather than speed
this._signalConnections.push({
- 'id': id,
- 'name': name,
- 'callback': callback,
+ id,
+ name,
+ callback,
'disconnected': false,
});
return id;
diff --git a/modules/tweener/tweenList.js b/modules/tweener/tweenList.js
index 3b851da6..6682af6b 100644
--- a/modules/tweener/tweenList.js
+++ b/modules/tweener/tweenList.js
@@ -41,7 +41,7 @@ function TweenList(scope, timeStart, timeComplete,
}
TweenList.prototype = {
- _init: function(scope, timeStart, timeComplete,
+ _init(scope, timeStart, timeComplete,
userFrames, transition, transitionParams) {
this.scope = scope;
this.timeStart = timeStart;
@@ -61,7 +61,7 @@ TweenList.prototype = {
this.hasStarted = false;
},
- clone: function(omitEvents) {
+ clone(omitEvents) {
var tween = new TweenList(this.scope, this.timeStart, this.timeComplete, this.userFrames,
this.transition, this.transitionParams);
tween.properties = [];
diff --git a/modules/tweener/tweener.js b/modules/tweener/tweener.js
index a92ff1ce..5e97aaa6 100644
--- a/modules/tweener/tweener.js
+++ b/modules/tweener/tweener.js
@@ -77,10 +77,10 @@ function FrameTicker() {
FrameTicker.prototype = {
FRAME_RATE: 65,
- _init: function() {
+ _init() {
},
- start: function() {
+ start() {
this._currentTime = 0;
let me = this;
@@ -95,7 +95,7 @@ FrameTicker.prototype = {
});
},
- stop: function() {
+ stop() {
if ('_timeoutID' in this) {
GLib.source_remove(this._timeoutID);
delete this._timeoutID;
@@ -104,7 +104,7 @@ FrameTicker.prototype = {
this._currentTime = 0;
},
- getTime: function() {
+ getTime() {
return this._currentTime;
},
};
@@ -464,7 +464,7 @@ function PropertyInfo(valueStart, valueComplete, originalValueComplete,
}
PropertyInfo.prototype = {
- _init: function(valueStart, valueComplete, originalValueComplete,
+ _init(valueStart, valueComplete, originalValueComplete,
arrayIndex, extra, isSpecialProperty,
modifierFunction, modifierParameters) {
this.valueStart = valueStart;
@@ -853,7 +853,7 @@ function registerSpecialProperty(name, getFunction, setFunction,
_specialPropertyList[name] = {
getValue: getFunction,
setValue: setFunction,
- parameters: parameters,
+ parameters,
preProcess: preProcessFunction,
};
}
@@ -868,7 +868,7 @@ function registerSpecialPropertyModifier(name, modifyFunction, getFunction) {
function registerSpecialPropertySplitter(name, splitFunction, parameters) {
_specialPropertySplitterList[name] = {
splitValues: splitFunction,
- parameters: parameters,
+ parameters,
};
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]