/* -*- 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/. */
/* Start the essence of the test via invoking the first resolve hook. */
JS::RootedValue v(cx);
EVAL("obj1.x", &v);
CHECK(v.isFalse());
CHECK_EQUAL(resolveEntryCount, 4);
CHECK_EQUAL(resolveExitCount, 4);
obj1 = nullptr;
obj2 = nullptr; returntrue;
}
enum Slots { TestSlot, SlotCount };
JS::PersistentRootedObject obj1;
JS::PersistentRootedObject obj2; int resolveEntryCount; int resolveExitCount;
/* * Test that JS_InitStandardClasses does not cause resolve hooks to be called. * * (XPConnect apparently does have global classes, such as the one created by * nsMessageManagerScriptExecutor::InitChildGlobalInternal(), that have resolve * hooks which can call back into JS, and on which JS_InitStandardClasses is * called. Calling back into JS in the middle of resolving `undefined` is bad.)
*/
BEGIN_TEST(testResolveRecursion_InitStandardClasses) {
CHECK(JS::InitRealmStandardClasses(cx)); returntrue;
}
staticbool my_resolve(JSContext* cx, JS::HandleObject obj, JS::HandleId id, bool* resolvedp) {
MOZ_ASSERT_UNREACHABLE( "resolve hook should not be called from InitStandardClasses");
JS_ReportErrorASCII(cx, "FAIL"); returnfalse;
}
END_TEST(testResolveRecursion_InitStandardClasses)
¤ Dauer der Verarbeitung: 0.13 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.