/* -*- 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/. */
// Some platform hooks must be implemented for single-step profiling. #ifdefined(JS_SIMULATOR_ARM) || defined(JS_SIMULATOR_MIPS64) || \ defined(JS_SIMULATOR_MIPS32) || defined(JS_SIMULATOR_ARM64) # define SINGLESTEP_PROFILING #endif
namespace js { namespace shell {
// Define use of application-specific slots on the shell's global object. enum GlobalAppSlot { GlobalAppSlotModuleRegistry, GlobalAppSlotCount };
static_assert(GlobalAppSlotCount <= JSCLASS_GLOBAL_APPLICATION_SLOTS, "Too many applications slots defined for shell global");
// Alias the global dstName to namespaceObj.srcName. For example, if dstName is // "snarf", namespaceObj represents "os.file", and srcName is "readFile", then // this is equivalent to the JS code: // // snarf = os.file.readFile; // // This provides a mechanism for namespacing the various JS shell helper // functions without breaking backwards compatibility with things that use the // global names. bool CreateAlias(JSContext* cx, constchar* dstName,
JS::HandleObject namespaceObj, constchar* srcName);
class NonshrinkingGCObjectVector
: public GCVector<HeapPtr<JSObject*>, 0, SystemAllocPolicy> { public: bool traceWeak(JSTracer* trc) { for (HeapPtr<JSObject*>& obj : *this) {
TraceWeakEdge(trc, &obj, "NonshrinkingGCObjectVector element");
} returntrue;
}
};
using MarkBitObservers = JS::WeakCache<NonshrinkingGCObjectVector>;
#ifdef SINGLESTEP_PROFILING using StackChars = Vector<char16_t, 0, SystemAllocPolicy>; #endif
// Rejected promises that are not yet handled. Added when rejection // happens, and removed when rejection is handled. This uses SetObject to // report unhandled rejections in the rejected order.
JS::PersistentRooted<SetObject*> unhandledRejectedPromises;
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.