GoogleChrome / samples

A repo containing samples tied to new functionality in each release of Google Chrome.
https://www.chromestatus.com/samples
Apache License 2.0
5.79k stars 2.38k forks source link

Manufacturer data filter example throws exception when data prefix filter is used #721

Closed gte1 closed 3 years ago

gte1 commented 3 years ago

https://github.com/GoogleChrome/samples/blob/7374ed5d69cd9f4a40bd14b0c48bbb7819d96435/web-bluetooth/manufacturer-data-filter.js#L41

const in this type of for loop causes an exception. ref https://medium.com/@mautayro/es6-variable-declaration-for-loops-why-const-works-in-a-for-in-loop-but-not-in-a-normal-a200cc5467c2

Tried https://googlechrome.github.io/samples/web-bluetooth/manufacturer-data-filter.html?dataPrefix=08 on chrome canary 92.0.4499.0 and got "Uncaught TypeError: Assignment to constant variable. (Your browser may not support this feature.)"

@beaufortfrancois

beaufortfrancois commented 3 years ago

Thank you @gte1!

gte1 commented 3 years ago

And thank you @beaufortfrancois for fixing this so fast !

beaufortfrancois commented 3 years ago

@gte1 See https://stackoverflow.com/questions/67020600/web-bluetooth-want-to-filter-on-manufacturer-data-when-using-navigator-bluetoot/67566056#67566056 ;)