Quelle testCallNonGenericMethodOnProxy.cpp
Sprache: C
/* 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/. */
// Now create the second global object and compartment...
{
JS::RealmOptions options;
JS::RootedObject globalB(
cx, JS_NewGlobalObject(cx, getGlobalClass(), nullptr,
JS::FireOnNewGlobalHook, options));
CHECK(globalB);
// ...and enter it.
JSAutoRealm enter(cx, globalB);
JS::RootedObject customB(cx, JS_NewObject(cx, &CustomClass));
CHECK(customB);
JS_SetReservedSlot(customB, CUSTOM_SLOT, Int32Value(42));
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.