diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2019-12-13 21:29:23 -0500 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2019-12-17 06:25:27 -0500 |
commit | d5086ac3aa308bb1ef177834366eeaf7b39bb17e (patch) | |
tree | 9b2c84158cf996b388bcb191130a5062fd7d6992 /js/src/builtin | |
parent | 82f9efff935a4ac4379bdfddddc84aae84fc869e (diff) | |
download | UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar.gz UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar.lz UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.tar.xz UXP-d5086ac3aa308bb1ef177834366eeaf7b39bb17e.zip |
Bug 1331092 - Part 2: Implement Async Generator except yield*.
Tag #1287
Diffstat (limited to 'js/src/builtin')
-rw-r--r-- | js/src/builtin/AsyncIteration.js | 7 | ||||
-rw-r--r-- | js/src/builtin/Promise.h | 17 |
2 files changed, 24 insertions, 0 deletions
diff --git a/js/src/builtin/AsyncIteration.js b/js/src/builtin/AsyncIteration.js new file mode 100644 index 000000000..029c7c0f8 --- /dev/null +++ b/js/src/builtin/AsyncIteration.js @@ -0,0 +1,7 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +function AsyncIteratorIdentity() { + return this; +} diff --git a/js/src/builtin/Promise.h b/js/src/builtin/Promise.h index 8f716dfbc..680ab2abd 100644 --- a/js/src/builtin/Promise.h +++ b/js/src/builtin/Promise.h @@ -151,6 +151,23 @@ AsyncFunctionThrown(JSContext* cx, Handle<PromiseObject*> resultPromise); MOZ_MUST_USE bool AsyncFunctionAwait(JSContext* cx, Handle<PromiseObject*> resultPromise, HandleValue value); +class AsyncGeneratorObject; + +MOZ_MUST_USE bool +AsyncGeneratorAwait(JSContext* cx, Handle<AsyncGeneratorObject*> asyncGenObj, HandleValue value); + +MOZ_MUST_USE bool +AsyncGeneratorResolve(JSContext* cx, Handle<AsyncGeneratorObject*> asyncGenObj, + HandleValue value, bool done); + +MOZ_MUST_USE bool +AsyncGeneratorReject(JSContext* cx, Handle<AsyncGeneratorObject*> asyncGenObj, + HandleValue exception); + +MOZ_MUST_USE bool +AsyncGeneratorEnqueue(JSContext* cx, HandleValue asyncGenVal, CompletionKind completionKind, + HandleValue completionValue, MutableHandleValue result); + /** * A PromiseTask represents a task that can be dispatched to a helper thread * (via StartPromiseTask), executed (by implementing PromiseTask::execute()), |