@gjsify/node-gi 0.46.0 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/gi.js CHANGED
@@ -145,6 +145,18 @@ class GLibError extends Error {
145
145
  this.code = code;
146
146
  }
147
147
 
148
+ // g_error_new_literal, which GJS exposes as a static on GLib.Error because it is in
149
+ // `GLib-2.0.gir` — and which is the only spelling `@girs/glib-2.0` TYPES, its
150
+ // `constructor(properties?)` signature rejecting the three positional arguments the
151
+ // constructor above actually takes. So a cross-runtime source that has to build a GError
152
+ // (a test asserting on an error a host cannot produce, say a CoreText font map's
153
+ // G_IO_ERROR_NOT_SUPPORTED) type-checks only against this, and without it the gjs leg
154
+ // passes and the node leg dies with `Error.new_literal is not a function`. Same arguments,
155
+ // same result — the constructor is the implementation.
156
+ static new_literal(domain, code, message) {
157
+ return new GLibError(domain, code, message);
158
+ }
159
+
148
160
  // g_error_matches: true when the error's domain AND code both match.
149
161
  matches(domain, code) {
150
162
  const d = errorDomainOf(domain);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/node-gi",
3
- "version": "0.46.0",
3
+ "version": "0.47.0",
4
4
  "description": "GObject-Introspection runtime for Node.js — load gi:// namespaces (GLib/GObject/Gio/…) with GJS-compatible semantics. Vendored + rewritten from node-gtk under MIT.",
5
5
  "type": "module",
6
6
  "license": "MIT",
Binary file
Binary file
Binary file