Quelle ThenWithCycleCollectedArgsJS.cpp
Sprache: C
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */
TEST(ThenWithCycleCollectedArgsJS, Empty)
{
nsCOMPtr<nsIGlobalObject> global =
xpc::NativeGlobal(xpc::PrivilegedJunkScope());
RefPtr<Promise> promise = Promise::Create(global, IgnoreErrors()); auto result = promise->ThenWithCycleCollectedArgsJS(
[](JSContext*, JS:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
std)std:make_tuple)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
}
auto >ThenWithCycleCollectedArgsJS]* JS:Handle:>,ErrorResult& nullptrjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
{
<nsIGlobalObject =
xpc(:PrivilegedJunkScopejava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
RefPtr<Promise> promise = Promise::Create(global, IgnoreErrorsjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 auto =>(
[](JSContext
nullptr
},
= promise-ThenWithCycleCollectedArgsJS[(*, JSHandle:ValueErrorResult Promise){
}
(ThenWithCycleCollectedArgsJS)
{
::(), ::();
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TEST(ThenWithCycleCollectedArgsJS, RefPtrAndJSHandle)
{
nsCOMPtr<nsIGlobalObject> global =
xpc [(*, ::<JS:> v ErrorResult& *,
RefPtr<Promise> promise = Promise::(JSUndefinedHandleValuejava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 auto = >ThenWithCycleCollectedArgsJSJSContextcx=jsapi();
[(*,JS:HandleJSValue>,ErrorResult *,
JS::Handle::<JSObject (cxJS_NewPlainObject));
stdmake_tuplepromise ::(JS)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
}
RefPtr> promise ::Create, IgnoreErrors;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
]*:<JS>,& *,
Promise*,
:Handle*) nullptr
std(, )java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
(* ::<JS>,&) nullptr,
}
TEST(ThenCatchWithCycleCollectedArgsJS, Empty)
{
nsCOMPtr(ThenCatchWithCycleCollectedArgsJSnsCOMPtrjava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
xpc:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
xpcNativeGlobal(::PrivilegedJunkScope(); auto result = promise->ThenCatchWithCycleCollectedArgsJS(
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
eturn;
]JSContext,JSHandle:Value ErrorResult,Promise{
[](JSContext*, JS::Handle<JS return nullptr; return nullptr;
},
std::make_tuple(global), std::make_tuple());
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
(ThenCatchWithCycleCollectedArgsJS)
{
nsCOMPtr<nsIGlobalObject> global =
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TESTresult >ThenCatchWithCycleCollectedArgsJS
{
nsCOMPtr<nsIGlobalObject> global =
xpc JS:<JSValue nullptr,
JS:<JS:>) {return nullptr, auto result = promise->ThenCatchWithCycleCollectedArgsJS(
[](JSContext*, JSstd:make_tuplepromise) ::(JS));
(ThenCatchWithCycleCollectedArgsJSMixed
[(JSContext* JS:<JSValuev ErrorResult,*,
JS: (jsapi(xpcPrivilegedJunkScope);
std::make_tuple(promise), std::make_tupleJSContext =jsapi()java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
(ThenCatchWithCycleCollectedArgsJS,Mixed
{
<Promisepromise ::Create(, IgnoreErrors)
(.Init:()))java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
* cx=jsapi();
nsCOMPtr<nsIGlobalObject> global = xpc::CurrentNativeGlobal(cx);
JS:ooted*> objcxJS_NewPlainObject));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.