Re: DAP-ISSUE-166: Should getBattery() always return the same promise?

On 08 Aug 2014, at 16:12, Mounir Lamouri <mounir@lamouri.fr> wrote:

> On Fri, 8 Aug 2014, at 19:47, Kostiainen, Anssi wrote:
>> I see no downsides in doing this, thus I suggest we change to the
>> following:
>> 
>> [[
>> 
>> * Let /promise/ be a newly created Promise and return it.
>> 
>> ]]
>> 
>> Into:
>> 
>> [[
>> 
>> * If there is an initialized-but-unresolved Promise object returned by
>> getBattery(), let /promise/ be that Promise object.
>> * Otherwise, let /promise/ be a newly created Promise.
>> * Return /promise/.
>> 
>> ]]
>> 
>> For the contest, please see:
>> 
>> https://dvcs.w3.org/hg/dap/raw-file/default/battery/Overview.html#the-navigator-interface
>> 
>> All - please report any bugs in the algorithm, and let us know if you
>> have any concerns with this change. I’ll land this change later if I hear
>> no concerns.
> 
> Why not simply returning the same Promise all the time instead of only
> returning un-resolved promises?

Good point, and makes sense. I s/initialized-but-unresolved/initialized/ above and landed the change:

https://dvcs.w3.org/hg/dap/rev/27d83813c582

Please review and let us know if you find any other bugs.

Thanks,

-Anssi

Received on Monday, 11 August 2014 08:51:27 UTC