1
0
mirror of https://github.com/danog/amp.git synced 2024-11-27 04:24:42 +01:00

Remove circular reference check

This commit is contained in:
Aaron Piotrowski 2016-06-14 21:53:50 -05:00
parent 60d560d70e
commit ae182165e5

View File

@ -71,21 +71,12 @@ trait Placeholder {
}
$this->resolved = true;
$this->result = $value;
if ($value instanceof Awaitable) {
if ($this === $value) {
throw new \InvalidArgumentException("Cannot resolve an awaitable with itself");
}
$this->result = $value;
if ($this->onResolved !== null) {
if ($this->onResolved !== null) {
if ($this->result instanceof Awaitable) {
$this->result->when($this->onResolved);
}
} else {
$this->result = $value;
if ($this->onResolved !== null) {
} else {
try {
$onResolved = $this->onResolved;
$onResolved(null, $this->result);
@ -99,9 +90,9 @@ trait Placeholder {
});
}
}
}
$this->onResolved = null;
$this->onResolved = null;
}
}
/**