/* -*- 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/. */
// Static assertion tests for the `binding_detail::ScriptableInterfaceType` // helper template, used by `ToJSValue`. namespace binding_detail {
static_assert(std::is_same_v<ScriptableInterfaceType<nsISupports>, nsISupports>, "nsISupports works with ScriptableInterfaceType");
static_assert(
std::is_same_v<ScriptableInterfaceType<nsIGlobalObject>, nsISupports>, "non-scriptable interfaces get a fallback");
static_assert(std::is_same_v<ScriptableInterfaceType<nsIObserver>, nsIObserver>, "scriptable interfaces should get the correct type");
static_assert(std::is_same_v<ScriptableInterfaceType<nsIRunnable>, nsIRunnable>, "scriptable interfaces should get the correct type"); class SingleScriptableInterface : public nsIObserver {};
static_assert(
std::is_same_v<ScriptableInterfaceType<SingleScriptableInterface>,
nsIObserver>, "Concrete type with one scriptable interface picks the correct interface"); class MultiScriptableInterface : public nsIObserver, public nsIRunnable {};
static_assert(std::is_same_v<ScriptableInterfaceType<MultiScriptableInterface>,
nsISupports>, "Concrete type with multiple scriptable interfaces falls back");
} // namespace binding_detail
} // namespace mozilla::dom
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
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 ist noch experimentell.