[gjs: 2/3] GLib: add alias for GLib.Variant.deepUnpack()
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 2/3] GLib: add alias for GLib.Variant.deepUnpack()
- Date: Mon, 5 Aug 2019 00:01:24 +0000 (UTC)
commit 13e662a29dbc762d5f4245c504f1e058788b516e
Author: Philip Chimento <philip chimento gmail com>
Date: Fri Aug 2 17:54:15 2019 -0700
GLib: add alias for GLib.Variant.deepUnpack()
GJS's own APIs seem to have all been added in camelCase except for this
one. Keep the old deep_unpack() API for backwards compatibility, but add
a camelCase one especially now that we have recursiveUnpack().
installed-tests/js/testGLib.js | 1 +
modules/overrides/GLib.js | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/installed-tests/js/testGLib.js b/installed-tests/js/testGLib.js
index cd7f6ec0..d5edbff0 100644
--- a/installed-tests/js/testGLib.js
+++ b/installed-tests/js/testGLib.js
@@ -78,6 +78,7 @@ describe('GVariant unpack', function () {
});
it('preserves type information if the unpacked object contains variants', function () {
+ expect(v.deepUnpack().foo instanceof GLib.Variant).toBeTruthy();
expect(v.deep_unpack().foo instanceof GLib.Variant).toBeTruthy();
});
diff --git a/modules/overrides/GLib.js b/modules/overrides/GLib.js
index 5b46bf12..f4887aee 100644
--- a/modules/overrides/GLib.js
+++ b/modules/overrides/GLib.js
@@ -286,9 +286,11 @@ function _init() {
this.Variant.prototype.unpack = function() {
return _unpack_variant(this, false);
};
- this.Variant.prototype.deep_unpack = function() {
+ this.Variant.prototype.deepUnpack = function() {
return _unpack_variant(this, true);
};
+ // backwards compatibility alias
+ this.Variant.prototype.deep_unpack = this.Variant.prototype.deepUnpack;
// Note: discards type information, if the variant contains any 'v' types
this.Variant.prototype.recursiveUnpack = function () {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]