The `optional` keyword does not mean nullability, it means omitability. Suppose your have this IDL:
void func(optional DOMString stuff);
Then your JavaScript code `func(null)` will result in `stuff === "null"`. That's a non-null string of 4 characters whose value is`"null"`, not an actual `null` string. This IDL allows calling `func()`.
Suppose your have this IDL instead:
void func(DOMString? stuff);
Then your JavaScript code `func(null)` will result in `stuff === null`. That's the actual `null` string. This IDL does not allow calling `func()`.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/browser-payment-api/pull/413#issuecomment-278102257