[gjs] Semi-colon and comma cleanups
- From: Mattias Bengtsson <mattiasb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] Semi-colon and comma cleanups
- Date: Thu, 10 Apr 2014 22:45:52 +0000 (UTC)
commit 945fd018ebd5e30a5b91bcc034a3e8e39c673da7
Author: Mattias Bengtsson <mattias jc bengtsson gmail com>
Date: Mon Apr 7 23:31:48 2014 +0100
Semi-colon and comma cleanups
Add lots of missing semi colons (the ones that js2-mode could spot for
me).
Remove a few excessive commas in object initializations.
https://bugzilla.gnome.org/show_bug.cgi?id=727786
installed-tests/js/testCairo.js | 12 ++++++------
installed-tests/js/testCoverage.js | 2 +-
installed-tests/js/testEverythingBasic.js | 12 ++++++------
installed-tests/js/testGIMarshalling.js | 14 +++++++-------
modules/coverage.js | 4 ++--
modules/gettext.js | 2 +-
modules/overrides/GLib.js | 18 +++++++++---------
modules/overrides/Gio.js | 8 ++++----
8 files changed, 36 insertions(+), 36 deletions(-)
---
diff --git a/installed-tests/js/testCairo.js b/installed-tests/js/testCairo.js
index a0b8989..5a6a892 100644
--- a/installed-tests/js/testCairo.js
+++ b/installed-tests/js/testCairo.js
@@ -114,7 +114,7 @@ function testContextMethods() {
cr.showText("foobar");
cr.moveTo(0, 0);
- cr.setDash([1, 0.5], 1)
+ cr.setDash([1, 0.5], 1);
cr.lineTo(1, 0);
cr.lineTo(1, 1);
cr.lineTo(0, 1);
@@ -130,12 +130,12 @@ function testSolidPattern() {
let p1 = Cairo.SolidPattern.createRGB(1, 2, 3);
JSUnit.assertEquals(_ts(p1), "CairoSolidPattern");
- cr.setSource(p1)
+ cr.setSource(p1);
JSUnit.assertEquals(_ts(cr.getSource()), "CairoSolidPattern");
let p2 = Cairo.SolidPattern.createRGBA(1, 2, 3, 4);
JSUnit.assertEquals(_ts(p2), "CairoSolidPattern");
- cr.setSource(p2)
+ cr.setSource(p2);
JSUnit.assertEquals(_ts(cr.getSource()), "CairoSolidPattern");
}
@@ -144,7 +144,7 @@ function testSurfacePattern() {
let surface = _createSurface();
let p1 = new Cairo.SurfacePattern(surface);
JSUnit.assertEquals(_ts(p1), "CairoSurfacePattern");
- cr.setSource(p1)
+ cr.setSource(p1);
JSUnit.assertEquals(_ts(cr.getSource()), "CairoSurfacePattern");
}
@@ -153,7 +153,7 @@ function testLinearGradient() {
let surface = _createSurface();
let p1 = new Cairo.LinearGradient(1, 2, 3, 4);
JSUnit.assertEquals(_ts(p1), "CairoLinearGradient");
- cr.setSource(p1)
+ cr.setSource(p1);
JSUnit.assertEquals(_ts(cr.getSource()), "CairoLinearGradient");
}
@@ -162,7 +162,7 @@ function testRadialGradient() {
let surface = _createSurface();
let p1 = new Cairo.RadialGradient(1, 2, 3, 4, 5, 6);
JSUnit.assertEquals(_ts(p1), "CairoRadialGradient");
- cr.setSource(p1)
+ cr.setSource(p1);
JSUnit.assertEquals(_ts(cr.getSource()), "CairoRadialGradient");
}
diff --git a/installed-tests/js/testCoverage.js b/installed-tests/js/testCoverage.js
index ab1bcd3..1b92a86 100644
--- a/installed-tests/js/testCoverage.js
+++ b/installed-tests/js/testCoverage.js
@@ -797,7 +797,7 @@ function testConvertFunctionCountersToArrayIsSorted() {
}
const MockFiles = {
- 'filename': "let f = function() { return 1; };",
+ 'filename': "let f = function() { return 1; };"
};
const MockFilenames = Object.keys(MockFiles);
diff --git a/installed-tests/js/testEverythingBasic.js b/installed-tests/js/testEverythingBasic.js
index 7043d63..948c99c 100644
--- a/installed-tests/js/testEverythingBasic.js
+++ b/installed-tests/js/testEverythingBasic.js
@@ -211,7 +211,7 @@ function testCallback() {
JSUnit.assertEquals('Callback', Everything.test_callback(callback), 42);
JSUnit.assertEquals('CallbackNull', Everything.test_callback(null), 0);
- JSUnit.assertRaises('CallbackUndefined', function () { Everything.test_callback(undefined) });
+ JSUnit.assertRaises('CallbackUndefined', function () { Everything.test_callback(undefined); });
}
function testArrayCallback() {
@@ -228,7 +228,7 @@ function testArrayCallback() {
arrayEqual(["one", "two", "three"], strings);
return 7;
- }
+ };
JSUnit.assertEquals(Everything.test_array_callback(callback), 14);
JSUnit.assertRaises(function () { Everything.test_array_callback(null) });
}
@@ -669,13 +669,13 @@ function testWrongClassGBoxed() {
// simpleBoxed.equals expects a Everything.TestSimpleBoxedA
JSUnit.assertRaises(function() {
simpleBoxed.equals(new Gio.SimpleAction);
- })
+ });
JSUnit.assertRaises(function() {
simpleBoxed.equals(new Everything.TestObj);
- })
+ });
JSUnit.assertRaises(function() {
simpleBoxed.equals(new GLib.KeyFile);
- })
+ });
JSUnit.assertTrue(simpleBoxed.equals(simpleBoxed));
JSUnit.assertRaises(function() {
@@ -683,7 +683,7 @@ function testWrongClassGBoxed() {
});
JSUnit.assertRaises(function() {
Everything.TestSimpleBoxedA.prototype.copy.call(new GLib.KeyFile);
- })
+ });
Everything.TestSimpleBoxedA.prototype.copy.call(simpleBoxed);
}
diff --git a/installed-tests/js/testGIMarshalling.js b/installed-tests/js/testGIMarshalling.js
index 6f444a1..c736ad9 100644
--- a/installed-tests/js/testGIMarshalling.js
+++ b/installed-tests/js/testGIMarshalling.js
@@ -134,18 +134,18 @@ function testGArray() {
assertEquals("1", array[1]);
assertEquals("2", array[2]);
- GIMarshallingTests.garray_int_none_in([-1, 0, 1, 2])
- GIMarshallingTests.garray_utf8_none_in(["0", "1", "2"])
+ GIMarshallingTests.garray_int_none_in([-1, 0, 1, 2]);
+ GIMarshallingTests.garray_utf8_none_in(["0", "1", "2"]);
- array = GIMarshallingTests.garray_utf8_none_out()
+ array = GIMarshallingTests.garray_utf8_none_out();
assertEquals("0", array[0]);
assertEquals("1", array[1]);
assertEquals("2", array[2]);
- array = GIMarshallingTests.garray_utf8_container_out()
+ array = GIMarshallingTests.garray_utf8_container_out();
assertEquals("0", array[0]);
assertEquals("1", array[1]);
assertEquals("2", array[2]);
- array = GIMarshallingTests.garray_utf8_full_out()
+ array = GIMarshallingTests.garray_utf8_full_out();
assertEquals("0", array[0]);
assertEquals("1", array[1]);
assertEquals("2", array[2]);
@@ -200,7 +200,7 @@ function testGBytes() {
array[1] = 49; // Flip the value back
GIMarshallingTests.gbytes_none_in(array.toGBytes()); // Now convert back to GBytes
- bytes = GLib.Bytes.new([97, 98, 99, 100])
+ bytes = GLib.Bytes.new([97, 98, 99, 100]);
GIMarshallingTests.array_uint8_in(bytes.toArray());
assertRaises(function() {
GIMarshallingTests.array_uint8_in(bytes);
@@ -288,7 +288,7 @@ function testGValueGType() {
GIMarshallingTests.gvalue_in_with_type(42, GObject.TYPE_INT);
GIMarshallingTests.gvalue_in_with_type(42.5, GObject.TYPE_DOUBLE);
GIMarshallingTests.gvalue_in_with_type('42', GObject.TYPE_STRING);
- GIMarshallingTests.gvalue_in_with_type(GObject.TYPE_GTYPE, GObject.TYPE_GTYPE)
+ GIMarshallingTests.gvalue_in_with_type(GObject.TYPE_GTYPE, GObject.TYPE_GTYPE);
GIMarshallingTests.gvalue_in_with_type(42, GObject.Int);
GIMarshallingTests.gvalue_in_with_type(42.5, GObject.Double);
diff --git a/modules/coverage.js b/modules/coverage.js
index 3c09685..13fa4e3 100644
--- a/modules/coverage.js
+++ b/modules/coverage.js
@@ -581,7 +581,7 @@ function _BranchTracker(branchCounters) {
this._activeBranch = nextActiveBranch;
this._activeBranch.hit = true;
}
- }
+ };
}
function _convertFunctionCountersToArray(functionCounters) {
@@ -721,7 +721,7 @@ function CoverageStatistics(files) {
});
this._branchTracker.incrementBranchCounters(offsetLine);
- }
+ };
return undefined;
};
diff --git a/modules/gettext.js b/modules/gettext.js
index 60991e1..cf056a8 100644
--- a/modules/gettext.js
+++ b/modules/gettext.js
@@ -88,6 +88,6 @@ var domain = function(domainName) {
pgettext: function(context, msgid) {
return GLib.dpgettext2(domainName, context, msgid);
}
- }
+ };
};
diff --git a/modules/overrides/GLib.js b/modules/overrides/GLib.js
index 7ecbdcf..c0c445d 100644
--- a/modules/overrides/GLib.js
+++ b/modules/overrides/GLib.js
@@ -110,7 +110,7 @@ function _pack_variant(signature, value) {
return GLib.Variant.new_variant(value);
case 'm':
if (value != null)
- return GLib.Variant.new_maybe(null, _pack_variant(signature, value))
+ return GLib.Variant.new_maybe(null, _pack_variant(signature, value));
else
return GLib.Variant.new_maybe(new GLib.VariantType(_read_single_type(signature, false).join('')),
null);
case 'a':
@@ -213,7 +213,7 @@ function _unpack_variant(variant, deep) {
// always unpack the dictionary entry, and always unpack
// the key (or it cannot be added as a key)
let val = _unpack_variant(variant.get_child_value(i), deep);
- let key
+ let key;
if (!deep)
key = _unpack_variant(val[0], true);
else
@@ -253,7 +253,7 @@ function _init() {
// small HACK: we add a matches() method to standard Errors so that
// you can do "catch(e if e.matches(Ns.FooError, Ns.FooError.SOME_CODE))"
// without checking instanceof
- Error.prototype.matches = function() { return false; }
+ Error.prototype.matches = function() { return false; };
this.Variant._new_internal = function(sig, value) {
let signature = Array.prototype.slice.call(sig);
@@ -263,23 +263,23 @@ function _init() {
throw new TypeError('Invalid GVariant signature (more than one single complete type)');
return variant;
- }
+ };
// Deprecate version of new GLib.Variant()
this.Variant.new = function(sig, value) {
return new GLib.Variant(sig, value);
- }
+ };
this.Variant.prototype.unpack = function() {
return _unpack_variant(this, false);
- }
+ };
this.Variant.prototype.deep_unpack = function() {
return _unpack_variant(this, true);
- }
+ };
this.Variant.prototype.toString = function() {
return '[object variant of type "' + this.get_type_string() + '"]';
- }
+ };
this.Bytes.prototype.toArray = function() {
return imports.byteArray.fromGBytes(this);
- }
+ };
}
diff --git a/modules/overrides/Gio.js b/modules/overrides/Gio.js
index eac26c4..950641b 100644
--- a/modules/overrides/Gio.js
+++ b/modules/overrides/Gio.js
@@ -232,7 +232,7 @@ function _injectToMethod(klass, method, addition) {
klass[method] = function() {
addition.apply(this, arguments);
return previous.apply(this, arguments);
- }
+ };
}
function _wrapFunction(klass, method, addition) {
@@ -242,7 +242,7 @@ function _wrapFunction(klass, method, addition) {
var args = Array.prototype.slice.call(arguments);
args.unshift(previous);
return addition.apply(this, args);
- }
+ };
}
function _makeOutSignature(args) {
@@ -328,7 +328,7 @@ function _wrapJSObject(interfaceInfo, jsObj) {
var impl = new GjsPrivate.DBusImplementation({ g_interface_info: info });
impl.connect('handle-method-call', function(impl, method_name, parameters, invocation) {
- return _handleMethodCall.call(jsObj, info, impl, method_name, parameters, invocation)
+ return _handleMethodCall.call(jsObj, info, impl, method_name, parameters, invocation);
});
impl.connect('handle-property-get', function(impl, property_name) {
return _handlePropertyGet.call(jsObj, info, impl, property_name);
@@ -362,7 +362,7 @@ function _init() {
watch_name: Gio.bus_watch_name,
watch_name_on_connection: Gio.bus_watch_name_on_connection,
- unwatch_name: Gio.bus_unwatch_name,
+ unwatch_name: Gio.bus_unwatch_name
};
Gio.DBusConnection.prototype.watch_name = function(name, flags, appeared, vanished) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]