W3C home > Mailing lists > Public > public-webauthn@w3.org > October 2017

[webauthn] isPlatformAuthenticatorAvailable's examples imply it should be static

From: J.C. Jones via GitHub <sysbot+gh@w3.org>
Date: Mon, 09 Oct 2017 22:32:34 +0000
To: public-webauthn@w3.org
Message-ID: <issues.opened-264045418-1507588339-sysbot+gh@w3.org>
jcjones has just created a new issue for https://github.com/w3c/webauthn:

== isPlatformAuthenticatorAvailable's examples imply it should be static ==
The example in the spec shows static usage of `isPlatformAuthenticatorAvailable`:

https://github.com/w3c/webauthn/blob/089c10e16bdcda0bd75db1d7f1d6a2be21304e08/index.bs#L3432-L3451

However, isPlatformAuthenticatorAvailable is defined [`[Unscopable]`](https://www.w3.org/2017/08/webidl-fpwd-draft.html#Unscopable), which is a [regular operation](https://www.w3.org/2017/08/webidl-fpwd-draft.html#dfn-regular-operation) which is defined as being **not** static.

I think the static method of using this is what we want, actually. Declaring this as a non-static method on `PublicKeyCredential` means users need to obtain a concrete `PublicKeyCredential` object on which to call `isPlatformAuthenticatorAvailable()`. This leads to a situation where you have to first complete a call to `navigator.credentials.create()` in order to call `isPlatformAuthenticatorAvailable()`.

Firefox's implementation is thus - until I hear otherwise - replacing `[Unscopable]` with `static` and I'll open a PR to do the same to the spec.

Please view or discuss this issue at https://github.com/w3c/webauthn/issues/618 using your GitHub account
Received on Monday, 9 October 2017 22:32:23 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 07:26:28 UTC