On 2015/05/12 13:01:50, rossberg wrote:
Hm, I'm a bit confused about this change. A couple of questions:
Why is the new code manually running the "then" call in a separate task?
Isn't
that asynchronicity encapsulated in the .then method itself already? At
least
I
don't see this extra step in the spec. AFAICS, it would be sufficient to
simply
do
} else if (IsPromise(result)) {
var chain = PromiseChain;
if (thenable) {
chain = result.then;
if (!IS_SPEC_FUNCTION(then)) {
deferred.resolve(result);
return;
}
}
%_CallFunction(result, deferred.resolve, deferred.reject, chain);
}
Why would that not work?
My understanding is that calling |then| should be in a separate task.
Please see
the 12th step in
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-resolve-functions
and correct me if I'm wrong.
And if you actually do need the duplicated logic, why don't you need to go
through PromiseEnqueue? It seems like you're bypassing all the debugger
hooks
in
that case. Is that intentional?
Ah, you mean calling
PromiseEnqueue(result, [then, deferred, true], +1)
? That would be a good idea. If my understanding for the first question is
correct, I would do that.
https://codereview.chromium.org/1098663002/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.