[gimp] plug-ins: fix warning on JavaScript goat exercise.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: fix warning on JavaScript goat exercise.
- Date: Tue, 10 Sep 2019 14:08:15 +0000 (UTC)
commit 49640ebfeea118e4919667d7c5d45320044c9186
Author: Jehan <jehan girinstud io>
Date: Tue Sep 10 16:06:48 2019 +0200
plug-ins: fix warning on JavaScript goat exercise.
The exact warning was:
> (goat-exercise-gjs:26895): Gjs-WARNING **: 15:59:18.382: Some code
> called array.toString() on a Uint8Array instance. Previously this
> would have interpreted the bytes of the array as a string, but that is
> nonstandard. In the future this will return the bytes as
> comma-separated digits. For the time being, the old behavior has been
> preserved, but please fix your code anyway to explicitly call
> ByteArray.toString(array). (Note that array.toString() may have been
> called implicitly.)
plug-ins/goat-exercises/goat-exercise-gjs.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/plug-ins/goat-exercises/goat-exercise-gjs.js b/plug-ins/goat-exercises/goat-exercise-gjs.js
index 991441352c..1210bd5119 100755
--- a/plug-ins/goat-exercises/goat-exercise-gjs.js
+++ b/plug-ins/goat-exercises/goat-exercise-gjs.js
@@ -106,7 +106,7 @@ var Goat = GObject.registerClass({
box.pack_start(label, false, false, 1);
label.show();
- let contents = String(GLib.file_get_contents(System.programInvocationName)[1]);
+ let contents =
imports.byteArray.toString(GLib.file_get_contents(System.programInvocationName)[1]);
if (contents) {
let scrolled = new Gtk.ScrolledWindow();
scrolled.set_vexpand (true);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]