mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
3e507adf99
Implement the common steps for the next method from https://webidl.spec.whatwg.org/#es-asynchronous-iterator-prototype-object in a base class, that all async iterable iterator objects inherit from. Natives that implement an async iterable only need to implement the "getting the next iteration result" part in their GetNextPromise method. This means they don't have to create the object according to "CreateIterResultObject" themselves, but can just create promise and often resolve it with a native value directly. We've switched to a special JS::Value to signal "end of iteration", but that's hidden inside the iterator_utils::ResolvePromiseForFinished helper. The WebIDL parser now uses the right return type for the generated "next" method, which means that any exceptions in the binding code itself will actually be correctly converted to a rejected promise instead of being rethrown. This also uses a class for the generated iterable iterator that's not exposed outside the binding code. No other code should create and/or wrap these anyway. Differential Revision: https://phabricator.services.mozilla.com/D156323 |
||
---|---|---|
.. | ||
crashtests | ||
docs | ||
mozwebidlcodegen | ||
parser | ||
test | ||
AtomList.h | ||
BindingCallContext.h | ||
BindingDeclarations.h | ||
BindingIPCUtils.h | ||
Bindings.conf | ||
BindingUtils.cpp | ||
BindingUtils.h | ||
CallbackFunction.h | ||
CallbackInterface.cpp | ||
CallbackInterface.h | ||
CallbackObject.cpp | ||
CallbackObject.h | ||
Codegen.py | ||
Configuration.py | ||
DOMExceptionNames.h | ||
DOMJSClass.h | ||
DOMJSProxyHandler.cpp | ||
DOMJSProxyHandler.h | ||
DOMString.h | ||
ErrorIPCUtils.h | ||
ErrorResult.h | ||
Errors.msg | ||
Exceptions.cpp | ||
Exceptions.h | ||
FakeString.h | ||
GenerateCSS2PropertiesWebIDL.py | ||
IterableIterator.cpp | ||
IterableIterator.h | ||
JSSlots.h | ||
mach_commands.py | ||
Makefile.in | ||
moz.build | ||
NonRefcountedDOMObject.h | ||
nsIScriptError.idl | ||
nsScriptError.cpp | ||
nsScriptError.h | ||
nsScriptErrorWithStack.cpp | ||
Nullable.h | ||
ObservableArrayProxyHandler.cpp | ||
ObservableArrayProxyHandler.h | ||
PinnedStringId.h | ||
PrimitiveConversions.h | ||
ProxyHandlerUtils.h | ||
Record.h | ||
RemoteObjectProxy.cpp | ||
RemoteObjectProxy.h | ||
RootedDictionary.h | ||
RootedOwningNonNull.h | ||
RootedRefPtr.h | ||
SimpleGlobalObject.cpp | ||
SimpleGlobalObject.h | ||
SpiderMonkeyInterface.h | ||
ToJSValue.cpp | ||
ToJSValue.h | ||
TypedArray.h | ||
UnionMember.h | ||
WebIDLGlobalNameHash.cpp | ||
WebIDLGlobalNameHash.h | ||
XrayExpandoClass.h |