Re: Bug 24878 - Remove algorithm aliases

Alexey, you put this in the bug:

"""
The spec used to say that passing "foo" is equivalent to passing {name:
"foo"}.
Was dropping this while adding the more general aliases mechanism just an
editorial mistake?

I think that allowing crypto.subtle.digest('sha-1', myArray) in place of
crypto.subtle.digest({name: 'sha-1'}, myArray) is desirable. There is no
need
to expose a silly looking API to people who just want to compute a hash, and
don't care about the full complexity of CryptoAlgorithms being dictionaries.
"""

I would actually be OK keeping that flavor of aliasing, because it doesn't
require us to maintain a list of explicit aliases.

--Richard




On Sun, Mar 2, 2014 at 1:31 AM, Alexey Proskuryakov <ap@webkit.org> wrote:

>
> 01 марта 2014 г., в 14:53, Richard Barnes <rlb@ipv.sx> написал(а):
>
> But is there really any use case besides "it's silly and saves the
> developer a few characters"?
>
>
> Both are pretty important considerations in API design, I think. When all
> one needs is to compute a hash, why expose them to the full complexity of
> Algorithm being a dictionary?
>
> It seems like apps are going to define aliases anyway, so there's not much
> point to the browser doing it as well.
>
>
> I now see what you mean when saying that there are no aliases defined - I
> just overlooked it when the spec draft changed.
>
> It used to say that passing "foo" is equivalent to passing {name: "foo"}.
> Looks like this feature was quietly removed when adding the provision for a
> more general mechanism. I suggest bringing this back as is, regardless of
> whether there are any more aliases to define.
>
> - WBR, Alexey Proskuryakov
>
>
>

Received on Tuesday, 4 March 2014 09:23:22 UTC