1
0
mirror of https://github.com/danog/amp.git synced 2024-11-26 20:15:00 +01:00

Null circular reference on resolution

This commit is contained in:
Aaron Piotrowski 2017-04-06 09:24:21 -05:00
parent cdf28fa938
commit d01ee68dd2

View File

@ -20,9 +20,6 @@ final class Coroutine implements Promise {
/** @var callable(\Throwable|null $exception, mixed $value): void */
private $onResolve;
/** @var int */
private $depth = 0;
/**
* @param \Generator $generator
*/
@ -46,6 +43,7 @@ final class Coroutine implements Promise {
if (!$yielded instanceof Promise) {
if (!$this->generator->valid()) {
$this->resolve($this->generator->getReturn());
$this->onResolve = null;
return;
}
@ -64,6 +62,7 @@ final class Coroutine implements Promise {
if (!$yielded instanceof Promise) {
if (!$this->generator->valid()) {
$this->resolve($this->generator->getReturn());
$this->onResolve = null;
return;
}
@ -135,5 +134,6 @@ final class Coroutine implements Promise {
}
$this->fail($exception);
$this->onResolve = null;
}
}