Re: Web IDL maplike: Allow spec prose to specify how key-type should be compared?

On Mon, Mar 9, 2015 at 1:10 PM, Mark S. Miller <erights@google.com> wrote:
> I can see why it may need a prototype. But why does it need a constructor?

>From what I'm told, in order to explain how the object was created.
I.e. to avoid building "magic" into the API.

But maybe there are other ways to do that?

/ Jonas

> On Mon, Mar 9, 2015 at 12:29 PM, Jonas Sicking <jonas@sicking.cc> wrote:
>>
>> On Mon, Mar 9, 2015 at 12:11 PM, Mark S. Miller <erights@google.com>
>> wrote:
>> > That's one of things that's so cool about the Promise constructor
>> > pattern:
>> >
>> > var resolver;
>> > var promise = new Promise(r => resolver = r);
>> >
>> > Couldn't this be applies to streams? (I haven't yet followed streams.)
>>
>> Sadly not. Because 'r' still needs to have a constructor.
>>
>> / Jonas
>
>
>
>
> --
>     Cheers,
>     --MarkM

Received on Monday, 9 March 2015 21:38:50 UTC