From c490bc724160d328c68a674bd38de4ededdbdd4b Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 6 Aug 2019 16:06:21 +0200 Subject: [PATCH] Improve the definition of the void type. (#757) In particular, this acknowledges that `Promise` exists. This also ensures that the handling of `void` return types is defined fully. Fixes #737. --- index.bs | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/index.bs b/index.bs index 5ffaf184..fdc352ef 100644 --- a/index.bs +++ b/index.bs @@ -2073,7 +2073,7 @@ defined on the same [=interface=]. The return type of the operation is given by the type (matching ReturnType) that appears before the operation’s optional [=identifier=]. -A return type of void indicates that the operation returns no value. +A return type of {{void}} indicates that the operation returns no value. If the return type is an [=identifier=] followed by ?, then the identifier must @@ -5536,6 +5536,15 @@ value is known as its specific type. (Values of [=union types=] also have [=specific types=].) +

void

+ +The {{void}} type has a unique value. + +It can only be used as the [=return type=] of an [=operation=] or the parameter of a +[=promise type=]. + +The [=type name=] of the {{void}} type is "Void". +

boolean

@@ -6892,16 +6901,15 @@ ECMAScript value type.

void

-The only place that the {{void}} type may appear -in IDL is as the [=return type=] of an -[=operation=]. Functions on [=platform objects=] -that implement an operation whose IDL specifies a -{{void}} return type must return the -undefined value. +

+ An ECMAScript value |V| is [=converted to an IDL value|converted=] to an IDL {{void}} value by + returning the unique {{void}} value, ignoring |V|. +

-ECMAScript functions that implement an operation whose IDL -specifies a {{void}} return type -may return any value, which will be discarded. +

+ The unique IDL {{void}} value is [=converted to an ECMAScript value|converted=] to the + ECMAScript undefined value. +

boolean