From 6815449caa294ecb5910365efad5830d995ea63f Mon Sep 17 00:00:00 2001 From: reillyg Date: Mon, 21 Apr 2025 19:36:05 +0000 Subject: [PATCH] Create dictionary return values as ordered maps From examples in other specifications it seems that the correct way to return a dictionary is to create an ordered map, for which we can either build it incrementally or by using the literal syntax. --- index.html | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/index.html b/index.html index eafec2a..032b4fb 100644 --- a/index.html +++ b/index.html @@ -614,8 +614,7 @@

getInfo() method

The {{SerialPort/getInfo()}} method steps are:
    -
  1. Let |info:SerialPortInfo| be a [=new=] {{SerialPortInfo}} - dictionary. +
  2. Let |info:SerialPortInfo| be an empty [=ordered map=].
  3. If the port is part of a USB device, perform the following steps:
      @@ -1501,25 +1500,24 @@

      task source=] to reject |promise| with a "{{NetworkError}}" {{DOMException}} and abort these steps. -
    1. Let |signals:SerialInputSignals| be a [=new=] - {{SerialInputSignals}}. +
    2. Let |dataCarrierDetect| be `true` if the "data carrier + detect" or "DCD" signal has been asserted by the device, and + `false` otherwise.
    3. -
    4. Set |signals|["{{SerialInputSignals/dataCarrierDetect}}"] to - `true` if the "data carrier detect" or "DCD" signal has been - asserted by the device, and `false` otherwise. +
    5. Let |clearToSend| be `true` if the "clear to send" or "CTS" + signal has been asserted by the device, and `false` otherwise.
    6. -
    7. Set |signals|["{{SerialInputSignals/clearToSend}}"] to `true` - if the "clear to send" or "CTS" signal has been asserted by the - device, and `false` otherwise. +
    8. Let |ringIndicator| be `true` if the "ring indicator" or "RI" + signal has been asserted by the device, and `false` otherwise.
    9. -
    10. Set |signals|["{{SerialInputSignals/ringIndicator}}"] to - `true` if the "ring indicator" or "RI" signal has been asserted - by the device, and `false` otherwise. -
    11. -
    12. Set |signals|["{{SerialInputSignals/dataSetReady}}"] to - `true` if the "data set ready" or "DSR" signal has been asserted - by the device, and `false` otherwise. +
    13. Let |dataSetReady| be `true` if the "data set ready" or "DSR" + signal has been asserted by the device, and `false` otherwise.
    14. +
    15. Let |signals| be the [=ordered map=] «[ + "{{SerialInputSignals/dataCarrierDetect}}" → |dataCarrierDetect|, + "{{SerialInputSignals/clearToSend}}" → |clearToSend|, + "{{SerialInputSignals/ringIndicator}}" → |ringIndicator|, + "{{SerialInputSignals/dataSetReady}}" → |dataSetReady| ]».
    16. [=Queue a global task=] on the [=relevant global object=] of [=this=] using the [=serial port task source=] to [=resolve=] |promise| with |signals|.