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:
parent
60d560d70e
commit
ae182165e5
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user