[gjs] Created tag 1.71.1
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] Created tag 1.71.1
- Date: Mon, 14 Feb 2022 01:50:56 +0000 (UTC)
The unsigned tag '1.71.1' was created.
Tagger: Philip Chimento <philip chimento gmail com>
Date: 1644803110 -0800
Version 1.71.1
- New JavaScript features! This version of GJS is based on SpiderMonkey
91, an upgrade from the previous ESR (Extended Support Release) of
SpiderMonkey 78.
Here are the highlights of the new JavaScript features.
For more information, look them up on MDN or devdocs.io.
* New syntax
+ Private class fields and methods are now supported. They start
with `#` and are not accessible outside the class in which they are
defined.
+ The `??=` logical nullish assignment operator, which assigns the
right-hand side value to the left-hand side variable if the
variable is null or undefined.
+ The `&&=` logical-and assignment operator, which assigns the
right-hand side value to the left-hand side variable if the variable is
truthy.
+ The `||=` logical-or assignment operator, which assigns the
right-hand side value to the left-hand side variable if the variable is
falsey.
+ `export * as ... from ...` can be used to aggregate modules.
+ Regular expressions add the `d` flag, which if defined causes the
resulting match object to have an `indices` property giving the
positions in the string where capturing and named groups matched.
+ `static { ... }` blocks in classes allow initialization of classes
at the time of creation of the class.
* New APIs
+ Arrays, strings, and typed arrays have gained the `at()` method,
which does the same thing as indexing with square brackets but also
allows negative numbers, which count from the end, as in Python.
+ `Promise.any()`, which is similar to `Promise.race()` but resolves
on the first successful sub-promise, instead of the first to resolve.
+ `Error()` now takes an options object as its second parameter,
which may contain a `cause` property. This option is used to indicate when
an error is caused by another error, but the first error is caught during
error handling.
+ `WeakRef`, which allows you to hold a reference to an object while
still allowing it to be garbage collected.
+ `dateStyle`, `timeStyle`, `fractionalSecondDigits`, and
`dayPeriod` are now accepted as options in `Intl.DateTimeFormat()` and
`Date.prototype.toLocaleString()`.
+ `collation` is now accepted as an option in `Intl.Collator()`.
+ `Intl.DisplayNames` has been added, which allows you to get
translations of language, region, currency, and script names.
+ `Intl.DateTimeFormat` has gained the `formatRange()` and
`formatRangeToParts()` methods.
* New behaviour
+ More numbering systems are supported in `Intl.NumberFormat`.
+ Top-level await (https://v8.dev/features/top-level-await) allows
you to use `await` statements outside of an `async` function in an ES
module.
+ There are a lot of minor behaviour changes as SpiderMonkey's JS
implementation conforms ever closer to existing ECMAScript
standards and adopts new ones. For complete information, read the Firefox
developer release notes:
https://developer.mozilla.org/en-US/Firefox/Releases/79#JavaScript
https://developer.mozilla.org/en-US/Firefox/Releases/80#JavaScript
https://developer.mozilla.org/en-US/Firefox/Releases/81#JavaScript
https://developer.mozilla.org/en-US/Firefox/Releases/82#JavaScript
https://developer.mozilla.org/en-US/Firefox/Releases/83#JavaScript
https://developer.mozilla.org/en-US/Firefox/Releases/84#JavaScript
https://developer.mozilla.org/en-US/Firefox/Releases/85#JavaScript
https://developer.mozilla.org/en-US/Firefox/Releases/86#JavaScript
https://developer.mozilla.org/en-US/Firefox/Releases/87#JavaScript
https://developer.mozilla.org/en-US/Firefox/Releases/88#JavaScript
https://developer.mozilla.org/en-US/Firefox/Releases/89#JavaScript
https://developer.mozilla.org/en-US/Firefox/Releases/90#JavaScript
https://developer.mozilla.org/en-US/Firefox/Releases/91#JavaScript
- It's now possible to pass BigInt values to GObject-introspected
functions with 64-bit parameters. This way, you can finally work with large numbers
that cannot be accurately stored as a JS Number value and pass them
correctly into C. For example, `GLib.Variant.new_int64(2n ** 62n)`.
- New API: GJS now has a standards-compliant `setTimeout()` and
`setInterval()`. These can now be used as in web browsers, while still integrating with
GLib's main loop.
- New API: `Cairo.Context.prototype.textExtents()` which makes the
`cairo_text_extents()` C function available to JavaScript.
- New overrides: `GLib.MAXINT64_BIGINT`, `GLib.MININT64_BIGINT`, and
`GLib.MAXUINT64_BIGINT` are BigInt-typed versions of `GLib.MAXINT64`
etc.
- It's now possible to use a regular `constructor()` in GObject classes
instead of an `_init()` method.
- It's now possible to use class fields in GObject classes.
- `Gio._promisify()` now tries to guess the name of the finish function,
if it is omitted.
- It's now possible to monkeypatch methods on the prototype of a GObject
interface. The most common use case for this is probably promisifying
methods on `Gio.File`, so you can now do things like
`Gio._promisify(Gio.File.prototype, 'read_async')` without resorting
to the `Gio._LocalFilePrototype` workaround.
- GObject interfaces are now enumerable, so you can now do things like
`Object.keys(Gio.File.prototype)` and get a list of the methods, like
you can with other GObject types.
- Improvements to the performance of promises, making them more
predictable under higher load.
- Several performance and type-safety improvements.
- Closed bugs and merge requests:
* [Mainloop 1/3] Add custom GSource for promise queueing [#1, !557,
Evan Welsh, Marco Trevisan]
* Upgrade to SpiderMonkey 91 [#413, !632, !687, Evan Welsh, Philip
Chimento, Chun-wei Fan]
* Promise rejections from signal handlers are silent [#417, !632,
Philip Chimento]
* Add a binding for GObject.Object.new [#48, !664, Evan Welsh, Philip
Chimento]
* Object resolve should consider prototypes of GObject interfaces
[#189, !665, Evan Welsh, Philip Chimento]
* File corruption on file.replace_contents_async [#192, !665, Evan
Welsh]
* Overriding inherited interface vfuncs clobbers base class
implementation [#89, !671, Evan Welsh]
* Errors in __init__.js are silenced [#343, !672, Evan Welsh]
* Allocate structs which contain pointers [!674, Evan Welsh]
* [Mainloop 3/3] WHATWG Timers [!677, Evan Welsh]
* [Mainloop 2/3] Implement "implicit" mainloop which only blocks on
unresolved imports [!678, Evan Welsh]
* Correctly chain constructor prototypes to enable static inheritance
[!679, Evan Welsh]
* Upgrade CI to Fedora 34 [!683, !684, Philip Chimento]
* Various maintenance [!685, !691, !709, !719, Philip Chimento]
* doc: Add Junction to applications written in GJS [!688, Sonny Piers]
* C++ argument cache [!689, Marco Trevisan, Philip Chimento]
* Gio: Make _promisify to guess the finish function by default [!692,
Marco Trevisan]
* Fails to build with Meson 0.60.2 [#446, !694, !705, Jan Beich, Eli
Schwartz]
* doc: Add Oh My SVG to standalone applications [!695, Sonny Piers]
* ci: Ensure forever callbacks do not leak [!698, Evan Welsh]
* gi: Refactor resolving prototypes in GIWrapperInstance constructors
[!699, Evan Welsh]
* Class fields don't work with GObject classes [#331, !700, Evan
Welsh]
* gi: Add enumeration hook for Interface prototypes [!701, Evan Welsh]
* Fix Visual Studio builds on master [!706, Chun-wei Fan]
* tools: Add iwyu-tool as a binary name for iwyu [!707, Evan Welsh]
* gi: Allow GObject.Value boxed type in nested contexts [!708, Evan
Welsh, Philip Chimento]
* Implemented check for null out-params in some functions in
context.cpp [!710, Nasah Kuma]
* Broken links on the doc/Home.md file [#458, !711, Andy Holmes]
* Accept BigInt values as input for 64-bit parameters to introspected
functions [!712, Marco Trevisan, Philip Chimento]
* Enable top-level await [!713, Evan Welsh]
* modules: Remove double '//' from internal module URIs [!714, Evan
Welsh]
* modules: Ensure ImportError is an instance of globalThis.Error
[!715, Evan Welsh]
* global: Enable WeakRefs [!716, Evan Welsh]
* global: Enable static class blocks [!717, Evan Welsh]
* overrides: Allow users to implement construct-only props with
getters [!718, Evan Welsh]
* cairo: Add binding for cairo_text_extents() [!720, Philip Chimento]
* Non-integer numbers can not be converted to (u)int64 [#459, !721,
Philip Chimento]
* Print error cause when logging an error [#454, !722, Philip
Chimento]
* GtkCustomSorter callbacks receives undefined params [#460, !723,
Philip Chimento]
Changes since the last tag '1.70.0':
Andy Holmes (1):
documentation: Fix broken links in Home.md
Chun-wei Fan (7):
meson.build: Define __PRETTY_FUNCTION__ for MSVC
gi/arg.h: Prefix IN/OUT enum entries with ARG_
arg-cache.cpp: Overload bitwise OR for GjsArgumentFlags
arg-cache.cpp: Static-cast yet another bitwise OR
arg-cache.cpp: Drop constexpr for RegisteredType ctor
README.MSVC.md: Update SpiderMonkey build instructions
Meson: Define SSIZE_MAX for Visual Studio-style builds
Eli Schwartz (1):
Revert "build: disable gir install via list to pacify meson >= 0.60.2"
Evan Miller (1):
arg: Replace gsize with size_t
Evan Welsh (47):
Don't clear pending exceptions from module init files
Store interface gtypes on dynamic classes to not clobber vfuncs
gi: Allow directly allocating structs which contain pointers
Handle optional out parameters in callbacks
Correctly chain constructor prototypes to enable static inheritance
context: Simplify condition
Convert JS_New usage to JS::Construct
JSID_* macros have been replaced with a class-based API
Add CI images for mozjs91.
gi: Use interface wrapper prototype to define implemented methods
overrides: Override replace_contents_async in Gio.File
gi: Use accessors to dynamically fetch prototype properties
Implement custom GSource to handle promise queueing
Add test cases for promise and async ordering
ci: Prevent forever callbacks from leaking
gi: Refactor resolving prototypes in GIWrapperInstance constructors
gi: Add enumeration hook for Interface prototypes
Refactor exit code handling for async exceptions
Add implicit main loop for dynamic imports
tools: Add iwyu-tool as a binary name for iwyu
maint: Prefer Array.isArray rather than instanceof Array
maint: Remove rule about no arrow functions in describe()
Implement WHATWG Timers API
Add override for GObject.new
meson: Update mozjs to mozjs-91
js: Update includes for headers split out of JSAPI
Some Object-related functions have moved to js/Object.h
JS_GetClass is now JS::GetClass
Typed array functions expect size_t instead of uint32_t
Some functions have moved to js/String.h
Adapt to module API changes for Top Level Await and Import Assertions
Use new Script private API
Remove JSPROP_GETTER and JSPROP_SETTER usage
Update GC API
Remove JSContext parameter from JS::PrintError
Adapt to new Maybe-based property descriptor API
Disable Top Level Await until we support an implicit eventloop
Add TypeError to Error debugger printer
doc: Update for SpiderMonkey 91
global: Enable WeakRef
modules: Remove double '//' from internal module URIs
modules: Ensure ImportError is an instance of globalThis.Error
modules: Enable top-level await for modules
overrides: Support class fields and references in GObject.registerClass
global: Enable static class blocks
overrides: Allow users to implement construct-only props with getters
gi: Allow GObject.Value boxed type in nested contexts
Jan Beich (1):
build: disable gir install via list to pacify meson >= 0.60.2
Marco Trevisan (TreviƱo) (18):
arg-cache: Remove return value check in GenericIn::in
function: Use proper type flags on return ffi return value
function: Add GjsFunctionCallState::last_processed_index()
function: Use safer access to GjsFunctionCallState elements
promise: Do not continue running the jobs if promise is cancelled
Promise: Replace the cancellable (and its source) on reset
Gio: Make _promisify to guess the finish function by default
arg-cache: Rewrite it taking advantage of C++ features
arg: Pass GjsArgumentFlags to all the functions and handle IN + NOTHING
arg-cache: Remove arg position from generic argument
arg-cache: Create Return and Instance arguments only if we have one
arg-cache: Move generic out in function to Positioned, simplify ArrayLengthOut
arg-cache: Only use one structure for fallback interface types
arg-cache: Save GType information for RegisteredType
arg-cache: Only store GType and InfoType in RegisteredType's
function: Factor out repeated call to Argument::return_type()
jsapi-util: Add a function to check if a BigInt is out of range
value: Support converting BigInt to (u)int64 values
Nasah Kuma (1):
context: check for null out-param
Philip Chimento (111):
build: Post-release version bump
build: Post-branch version bump
Merge branch 'ewlsh/fix-init-errors' into 'master'
Merge branch 'ewlsh/fix-vfunc-clobberin' into 'master'
Merge branch 'ewlsh/allocate-nullptrs' into 'master'
Merge branch 'wip/smcv/installed-tests' into 'master'
Merge branch 'ewlsh/callback-out-args' into 'master'
Merge branch 'ewlsh/chain-static' into 'master'
CI: Build images using Fedora 34 as the base
Merge branch 'fedora34-ci' into 'master'
CI: Remove false positives from IWYU 0.16
CI: Move thread sanitizer job to manual section
CI: Pin new image for build_recommended
Merge branch 'fedora34-ci' into 'master'
tests: Remove ignored argument
CI: Remove TASK_ID variable
context: Fix bad formatting
jsapi-util: Cast pointer to the correct type when calling ref/free-func
gjs-private: Remove dead code
arg: Remove double assignment of variable
foreign: Remove unused struct member
object: Combine consecutive if-blocks
importer: Don't reinitialize search path every time
objectbox: Rewrite loop using potentially faster std::find_if
Merge branch 'september-maintenance' into 'master'
Merge branch 'libatomic' into 'master'
maint: Rename variables
Merge branch 'mozjs91-prep' into 'master'
Merge branch 'ewlsh/interface-resolution' into 'master'
Merge branch 'sonny-master-patch-33257' into 'master'
Merge branch 'ewlsh/implicit-mainloop' into 'master'
Merge branch 'meson-0.60.2' into 'master'
maint: Use GjsAutoChar::out() for out-pointers
maint: Always include config.h
maint: Fix IWYU includes
CI: ignore warning about pragma once in IWYU
maint: Don't require lines between single-line class members
Merge branch 'october-maintenance' into 'master'
Merge branch 'ewlsh/fix-forever-callbacks' into 'master'
Merge branch 'sonny-master-patch-81174' into 'master'
Merge branch 'fix-gcc-12-build' into 'master'
Merge branch 'ewlsh/refactor-prototype-resolution' into 'master'
Merge branch 'ewlsh/enumerable-interfaces' into 'master'
Merge branch 'arg-cache-cpp-1' into 'master'
Merge branch 'revert-incorrect-meson-fix' into 'master'
Merge branch 'fix-windows' into 'master'
Merge branch 'ewlsh/top-level-await-mainloop' into 'master'
Merge branch 'ewlsh/iwyu-arch' into 'master'
Merge branch 'ewlsh/whatwg-timers' into 'master'
Add override for GObject.Object.new_with_properties()
Merge branch 'ewlsh/gobject-new' into 'master'
libgjs-private: Mark function as static
libgjs-private: Export GjsDBusImplementation unexport methods
doc: Add unexport_from_connection() to Gio module documentation
arg-cache: Update comment
context: Clarification in GjsContextPrivate::handle_exit_code()
object: Add null check for debug assertion
build: Skip running minimal SpiderMonkey program on cross builds
maint: Add common build directory names to eslintignore
object: Don't fetch property descriptor on interface
object: Fix interface property descriptor flags
jsapi-util: Remove return value of gjs_log_exception_full()
jsapi-util: Refactor gjs_log_exception_full()
jsapi-util: Include column number in SyntaxError output
debugger: Handle EOF at debugger prompt correctly
Merge branch 'january-maintenance' into 'master'
Use new property descriptor API to create complete descriptor
CI: Build only mozjs91 images
build: Remove workaround for Meson precompiled headers bug
context: Remove workaround for coverage bug
engine: Enable private fields and methods
closure: Warn about unhandled promise rejections right away
release: Add release notes for SpiderMonkey 91
test: Remove workaround for SpiderMonkey GC code coverage
Merge branch 'mozjs91' into 'master'
Merge branch 'wip/andyholmes/fix-home-links' into 'master'
Merge branch 'Nasah-Kuma/fix-outparam-check' into 'master'
Merge branch 'ewlsh/cleanup-import-uris' into 'master'
tests: Use GLib.SOURCE_CONTINUE in idle functions
tests: Rename variables with m_ prefix
Merge branch 'ewlsh/fix-error-prototype' into 'master'
Merge branch 'ewlsh/enable-weak-refs' into 'master'
maint: Suppress cppcheck warning about accessing a variable after moving
jsapi: Avoid creating unnecessary stringstreams when debug logging
arg: Remove dead code
arg: Fix obsolete comment
arg-cache: Use 3 bits to hold GIScopeType
arg: Fix marshalling GDK_NONE as GdkAtom argument in
Merge branch 'january-maintenance' into 'master'
jsapi-util: Improve BigInt debug functions
GLib: Add MAXINT64_BIGINT, MININT64_BIGINT, MAXUINT64_BIGINT constants
Merge branch 'bigint-as-input' into 'master'
Merge branch 'ewlsh/top-level-await' into 'master'
release: Copy NEWS from stable branches
Merge branch 'ewlsh/wrap-es-class' into 'master'
Merge branch 'ewlsh/construct-only-props' into 'master'
Merge branch 'ewlsh/enable-static-blocks' into 'master'
value: Fix regression converting Number to 64-bit int
value: Fix regression converting Infinity and NaN to C integers
tests: Add more GValue tests
Merge branch 'ewlsh/gvalue-arguments' into 'master'
jsapi-util: Print error cause, if available, when logging error
jsapi-util: Append cause when calling gjs_throw with exception pending
Gtk: Add overrides for Gtk.CustomSorter methods
cairo: Add binding for cairo_text_extents()
Merge branch '459-bigint-conversion' into 'master'
Merge branch 'text-extents' into 'master'
Merge branch '460-gtkcustomsorter' into 'master'
Merge branch '454-error-cause' into 'master'
release: Add missing lines from 1.70.1 NEWS
release: Prepare for 1.71.1
Sergei Trofimovich (1):
gjs/jsapi-util.cpp: fix build on gcc-12
Simon McVittie (2):
installed-tests: Install matchers.js
build: Link with libatomic if necessary
Sonny Piers (2):
doc: Add Junction to applications written in GJS
doc: Add Oh My SVG to standalone applications
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]