gjs 1.47.0
- From: Cosimo Cecchi <install-module master gnome org>
- To: FTP Releases <ftp-release-list gnome org>
- Subject: gjs 1.47.0
- Date: Thu, 10 Nov 2016 05:15:40 +0000 (UTC)
About gjs
=========
GNOME JavaScript/Spidermonkey bindings
News
====
NEXT
----
- Backwards-incompatible change: we have changed the way certain JavaScript
values are marshalled into GObject introspection 32 or 64-bit signed integer
values, to match the ECMA standard. Here is the relevant section of the
standard:
http://www.ecma-international.org/ecma-262/7.0/index.html#sec-toint32
Notable differences between the old and new behaviour are:
* Floating-point numbers ending in 0.5 are rounded differently when
marshalled into 32 or 64-bit signed integers. Previously they were
rounded to floor(x + 0.5), now they are rounded to
signum(x) * floor(abs(x)) as per the ECMA standard:
http://www.ecma-international.org/ecma-262/7.0/index.html#sec-toint32
Note that previously, GJS rounded according to the standard when
converting to *unsigned* integers!
* Objects whose number value is NaN (e.g, arrays of strings), would
previously fail to convert, throwing a TypeError. Now they convert to
0 when marshalled into 32 or 64-bit signed integers.
Note that the new behaviour is the behaviour you got all along when using
pure JavaScript, without any GObject introspection:
gjs> let a = new Int32Array(2);
gjs> a[0] = 10.5;
10.5
gjs> a[1] = ['this', 'is', 'fine'];
this,is,fine
gjs> a[0]
10
gjs> a[1]
0
- Backwards-incompatible change: we have changed the way gjs-console interprets
command-line arguments. Previously there was a heuristic to try to decide
whether "--help" given on the command line was meant for GJS itself or for a
script being launched. This did not work in some cases, for example:
$ gjs -c 'if (ARGV.indexOf("--help") == -1) throw "ugh"' --help
would print the GJS help.
Now, all arguments meant for GJS itself must come _before_ the name of the
script to execute or any script given with a "-c" argument. Any arguments
_after_ the filename or script are passed on to the script. This is the way
that Python handles its command line arguments as well.
If you previously relied on any -I arguments after your script being added to
the search path, then you should either reorder those arguments, use GJS_PATH,
or handle -I inside your script, adding paths to imports.searchPath manually.
In order to ease the pain of migration, GJS will continue to take those
arguments into account for the time being, while still passing them on to the
script. A warning will be logged if you are using the deprecated behaviour.
Download
========
https://download.gnome.org/sources/gjs/1.47/gjs-1.47.0.tar.xz (501K)
sha256sum: 9255785ec704bda06d4a8300c9010efbdb83208f9496b0f3fe2799e872b411df
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]