-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Pin Specifiers are passed to IO constructors:
new Digital({pin: 1, mode: Digital.Input});
During development of ECMA-419 2nd Edition, it was observed that when the pin is undefined
-- often because the user accidentally left out the pin property -- that pin 0 was used. This is because undefined
becomes 0
when coerced to a number. Using pin 0
is entirely unexpected.
The Moddable SDK implementation of ECMA-419 IO was updated to throw on a value of undefined
for a pin specifier. This is not currently reflected in the specification. I think we should update this for 3rd Edition.
There are likely other cases where undefined
should be rejected as a value, such as Port Specifiers and mode
.
Metadata
Metadata
Assignees
Labels
No labels