Enqueue promise jobs from SpiderMonkey callbacks, and execute them in batches. Implement native Promise APIs.

Add SpiderMonkey hooks for enqueuing promise jobs. Start porting various native Promise APIs.
This commit is contained in:
Mátyás Mustoha 2016-07-20 12:47:55 +02:00 committed by Josh Matthews
parent a1091772ec
commit fd778b4240
4 changed files with 154 additions and 20 deletions

View file

@ -826,7 +826,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
rooted!(in(cx) let globalObj = CurrentGlobalOrNull(cx));
let promiseGlobal = global_root_from_object_maybe_wrapped(globalObj.handle().get());
let mut valueToResolve = RootedValue::new(cx, $${val}.get());
rooted!(in(cx) let mut valueToResolve = $${val}.get());
if !JS_WrapValue(cx, valueToResolve.handle_mut()) {
$*{exceptionCode}
}
@ -5482,6 +5482,7 @@ def generate_imports(config, cgthings, descriptors, callbacks=None, dictionaries
'js::jsapi::JS_SetProperty',
'js::jsapi::JS_SetReservedSlot',
'js::jsapi::JS_SplicePrototype',
'js::jsapi::JS_WrapValue',
'js::jsapi::MutableHandle',
'js::jsapi::MutableHandleObject',
'js::jsapi::MutableHandleValue',