mirror of
https://github.com/danog/amp.git
synced 2025-01-22 05:11:42 +01:00
Avoid invalid escape sequences.
This commit is contained in:
parent
e925017519
commit
a78cc09dac
@ -775,7 +775,7 @@ function __coroutineAdvance(CoroutineState $cs) {
|
|||||||
$yielded = $cs->generator->current();
|
$yielded = $cs->generator->current();
|
||||||
if (!isset($yielded)) {
|
if (!isset($yielded)) {
|
||||||
if ($cs->generator->valid()) {
|
if ($cs->generator->valid()) {
|
||||||
$cs->reactor->immediately("Amp\__coroutineNextTick", ["cb_data" => $cs]);
|
$cs->reactor->immediately('Amp\__coroutineNextTick', ["cb_data" => $cs]);
|
||||||
} elseif (isset($cs->returnValue)) {
|
} elseif (isset($cs->returnValue)) {
|
||||||
$cs->promisor->succeed($cs->returnValue);
|
$cs->promisor->succeed($cs->returnValue);
|
||||||
} else {
|
} else {
|
||||||
@ -785,11 +785,11 @@ function __coroutineAdvance(CoroutineState $cs) {
|
|||||||
} elseif ($yielded instanceof Promise) {
|
} elseif ($yielded instanceof Promise) {
|
||||||
if ($cs->nestingLevel < 3) {
|
if ($cs->nestingLevel < 3) {
|
||||||
$cs->nestingLevel++;
|
$cs->nestingLevel++;
|
||||||
$yielded->when("Amp\__coroutineSend", $cs);
|
$yielded->when('Amp\__coroutineSend', $cs);
|
||||||
$cs->nestingLevel--;
|
$cs->nestingLevel--;
|
||||||
} else {
|
} else {
|
||||||
$cs->currentPromise = $yielded;
|
$cs->currentPromise = $yielded;
|
||||||
$cs->reactor->immediately("Amp\__coroutineNextTick", ["cb_data" => $cs]);
|
$cs->reactor->immediately('Amp\__coroutineNextTick', ["cb_data" => $cs]);
|
||||||
}
|
}
|
||||||
} elseif ($yielded instanceof CoroutineResult) {
|
} elseif ($yielded instanceof CoroutineResult) {
|
||||||
/**
|
/**
|
||||||
@ -841,7 +841,7 @@ function __coroutineNextTick($watcherId, CoroutineState $cs) {
|
|||||||
if ($cs->currentPromise) {
|
if ($cs->currentPromise) {
|
||||||
$promise = $cs->currentPromise;
|
$promise = $cs->currentPromise;
|
||||||
$cs->currentPromise = null;
|
$cs->currentPromise = null;
|
||||||
$promise->when("Amp\__coroutineSend", $cs);
|
$promise->when('Amp\__coroutineSend', $cs);
|
||||||
} else {
|
} else {
|
||||||
__coroutineSend(null, null, $cs);
|
__coroutineSend(null, null, $cs);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user