WICG / serial

Serial ports API for the platform.
https://wicg.github.io/serial/
Other
255 stars 46 forks source link

Fail if filter contains both bluetooth and usb members #196

Closed beaufortfrancois closed 9 months ago

beaufortfrancois commented 9 months ago

This PR makes sure requestPort() fails if filter contains both bluetooth and usb members. This matches Chromium implementation.

  if (filter->hasBluetoothServiceClassId()) {
    if (filter->hasUsbVendorId() || filter->hasUsbProductId()) {
      exception_state.ThrowTypeError(
          "A filter cannot specify both bluetoothServiceClassId and "
          "usbVendorId or usbProductId.");
      return nullptr;
    }

@nondebug @reillyeon Please review.