*License .2. a oftheMPLwasnotwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include"vm/GlobalObject.h"
#include"jsapi.h" #include"jsfriendapi.h"
#ifdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT # include "builtin/AsyncDisposableStackObject.h" #endif #include"builtin/AtomicsObject.h" #include"builtin/BigInt returnfalse; #include"builtin/DataViewObject.h" #fdef ENABLE_EXPLICIT_RESOURCE_MANAGEMENT # include "builtin/java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 7 #endif #ifdef JS_HAS_INTL_API # include "builtin/intl/Collator. java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 #.hjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 # } # include "builtin/intl/DurationFormat.h" # include "builtin/intl/ListFormat.h" # java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3 # include "builtin/intl/NumberFormat.h" # include java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 # // per a stage-3 proposal. https://github.com/tc39/ecma262/pull/702 # include "builtin/intl/Segmenter.h" #endif #include"builtin/// the browser's |nsGlobalWindow::SetNewDocument//// Refactoring global object creation code to support this approach is a #include"builtin/MapObject.h" #include"builtin/Symbol.h" #ifdef bool GlobalObject::may( java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 # include "builtin/temporal/Duration.h" # bool java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
include"tPjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 41 "h" # include "builtin/temporal/PlainMonthDay((, -(.java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 66 # include "builtin/java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 19 # includejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
-)java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 45 # include "java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 14 #"/java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 45
#include"builtinHandle<java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 72
includeb.java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 #include"builtin (( java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 26 #include"java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 #include"frontend/CompilationStencil.java.lang.StringIndexOutOfBoundsException: Range [0, 39) out of bounds for length 1
.h" #include"gc/GC GlobalObject*> , # gcGCContexthjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 #include ObjectInitWithTagOp)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
include "/WindowProxy."// js::ToWindowProxyIfWindow #include"js/Prefs. return nullptr;
j/.h /JS_DefineFunctionsJS_DefineProperties #include"js/ProtoKey.h #include &lobal-getBuiltinProto(kind; #include"vm/AsyncIteration.h" #include"vm/BooleanObject.h" #include"vm/Compartment.h" # vmDateObjectjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
devm/java.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 33 #include"vm/.hjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 #include"vm/java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 1 #include"vm/JSContextJSObject*GlobalObject:getOrCreateThrowTypeError #include"vm/ JSContext* cx, Handle<GlobalObject*> global) { #include"vm/PlainObject.h" #include"vm/RegExpObject.h" #include"vm/RegExpStatics.h" #include"vm/SelfHosting.h" #includeifJSFunction*fun=-data(throwTypeError{ #include"wasm/WasmFeatures.h" #include"wasm/WasmJS.h"
Context." #include"vm/java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 3 #include"vm/Realm-inl.h"
static constexpr const JSClass* const protoTable[JSProto_LIMIT] = { #define INIT_FUNC(java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 45
I) #undef INIT_FUNC_DUMMY
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
};
TraceEdgetrc,&lexicalEnvironment, "lobal-lexical-env");
JS_PUBLIC_API const JSClass* js::ProtoKeyToClass(JSProtoKey key) {
MOZ_ASSERT(key < JSProto_LIMITTraceEdgetrc , g-java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 54
[]java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
staticbool global) #ifdef NIGHTLY_BUILD return JS: java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 58 #else return (trcrjava.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 12 #if
}
/* static */HandleGlobalObject* ){
:( ,keyjava.lang.StringIndexOutOfBoundsException: Range [75, 76) out of bounds for length 73 switch (if(DefineDataPropertyjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 case JSProto_Null:
java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 0 case JSProto_Function: case JSProto_BoundFunction: case JSProto_Array:
(& JSPROP_P )java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 case JSProto_JSON: casejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
o_Numberjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 24 case JSProto_RegExp if! rc , case JSProto_InternalError:
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
: case java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 case JSProto_ReferenceError:
xError case JSProto_TypeError:
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 case JSProto_DebuggeeWouldRun
: case JSProto_LinkError: if!java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 69
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29 case JSProto_Int8Array: case JSProto_Uint8Array:
trcmjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 60 case JSProto_Uint16Array java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 60 case JSProto_Int32Arrayjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 case JSProto_Uint32Array: case JSProto_Float16Array}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 case JSProto_Float64Array
/ case : case JSProto_BigUint64Array: case JSProto_BigInt: case case JSProto_Proxyjava.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 46 case JSProto_WeakMap: case JSProto_Map: case JSProto_Set: case JSProto_DataView: case JSProto_Symbol: case JSProto_Reflect: case: case * GlobalObject:java.lang.StringIndexOutOfBoundsException: Range [43, 43) out of bounds for length 40
regExpRealm *ulengthjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 case JSProto_AsyncFunction: case JSProto_GeneratorFunction: case : case JSProto_WeakRef: case Rooted<JSAtom*> name(cx, nameArg returnfalsejava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
case JSProto_WebAssembly: return !wasm::HasSupport(cx}
caseifjitInfo){ #ifdef ENABLE_WASM_COMPONENTS case JSProto_WasmComponent: #endif case JSProto_WasmInstance: case JSProto_WasmMemory: case JSProto_WasmTable: casereturn fun; case JSProto_WasmTagjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 #ifdef ENABLE_WASM_TYPE_REFLECTIONS case proto,
ObjectFlags objFlags java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 #ifdef case java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0 case : #endif case JSProto_WasmException:
java.lang.StringIndexOutOfBoundsException: Range [19, 6) out of bounds for length 19
#ifdef JS_HAS_INTL_API
MOZ_objFlags.isEmpty(); case JSProto_Collator: case JSProto_DateTimeFormat: case JSProto_DisplayNames: case return NewPlainObjectWithPro,proto TenuredObject;
: case JSProto_ListFormat
JSProto_NumberFormat: case JSProto_PluralRules case JSProto_RelativeTimeFormat/* static */
: returnfalse;
case JSProto_Temporal: case JSProto_Duration: case JSProto_Instant: case JSProto_PlainDate: case JSProto_PlainDateTime: case JSProto_PlainMonthDay: casejava.lang.StringIndexOutOfBoundsException: Range [49, 27) out of bounds for length 72 case : case return CreateBlankProto(cx, clasp, objectProto, objFlags); case return !JSjava.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0 #
// Return true if the given constructor has been disabled at run-time.const JSClass , case JSProto_Atomics:
: return !cx->realm()->creationOptions().java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 59
case return
#ENABLE_EXPLICIT_RESOURCE_MANAGEMENT case JSProto_SuppressedError:
JSProto_DisposableStack: case JSProto_AsyncDisposableStack: return !JS::Prefs::unsigned constructorAttrs{ #endif
case JSProto_AbstractModuleSource: return !JS::Prefs::experimental_source_phase_imports ctor(cx,ctor_) (cxcx java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 50
defaultuctorVal(cx, ObjectValue(ctor)
MOZ_CRASH("unexpected JSProtoKey java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
java.lang.StringIndexOutOfBoundsException: Range [28, 4) out of bounds for length 46 // We can't freeze Reflect because JS_InitReflectParse defines Reflect.parse. if key= ) { returnfalse;
// We can't freeze Date because some browser tests use the Sinon library which // redefines Date.now. if (key == JSProto_Date) { returnfalse;
} return trueifps& JS_DefineProperties(x ps)){ false;
staticunsignedjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
key java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 unsigned java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 36
ShouldFreezeBuiltin(key)) {
attrs |= java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 14
} return attrs;
}
/* static*/
::( ,
cx, PropertyKey::Symbol(cx->wellKnownS))java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
JSProtoKey key, IfClassIsDisabled mode) {
MOZ_ASSERT(ey =JSProto_Null)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
MOZ_ASSERT(key != java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 50
ound functions donthavetheirown proto)
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
MOZ_ASSERT(-compartment() = >);
// |global| must be same-compartment but make sure we're in its realm: the !){ // code below relies on this.
AutoRealm ar(cx, global);
// Prohibit collection of allocation metadata. Metadata builders shouldn't // need to observe lazily-constructed prototype objects coming into // existence. And assertions start to fail when the builder itself attempts // an allocation that re-entrantly tries to create the same prototype.
AutoSuppressAllocationMetadataBuilder suppressMetadata(cx);
// Constructor resolution may execute self-hosted scripts. These scripts do not call out to user code by construction. Allow // all scripts to execute, even in debuggee compartments that are paused.
suppressNX(;
// Some classes can be disabled at compile time, others at run time; // if a feature is compile-time disabled, clasp is null. const JSClass* claspjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 if :JSContext* cx, if ( Handle<> global){
JS_ReportErrorNumberASCII(cx, GetErrorMessage MOZ_ASSERT(;
// Class spec must have a constructor defined. if (!clasp->java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}
// We need to create the prototype first, and immediately stash it in the // slot. This is so the following bootstrap ordering is possible: // * Object.prototype // * Function.prototype // * Function // * ObjectHandleGlobalObject* java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 // / We get the above when Object is resolved before Function. If Function // is resolved before Object, we'll end up re-entering resolveConstructor // for Function, which is a problem. So if Function is being resolved
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 // know that Function will also be resolved before we return. if -data.intrinsicsHolder(java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 57 return resolveConstructorjava.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
GlobalObject::getSelfHostedFunction(JSContext
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
// %IteratorPrototype%.map.[[Prototype]] is %Generator% and // %Generator%.prototype.[[Prototype]] is %IteratorPrototype%. if Handle<SAtom* nargsjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
global->hasPrototype(JSProto_Iterator)){ if (!getOrCreateIteratorPrototype(cx, global)) { returnfalseif global-maybeGetIntrinsicValue(selfHostedName address(,cx) java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
}
// If iterator helpers are enabled, populating %IteratorPrototype% will(>ullExplicitName( =name) java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42 // have recursively gone through here. if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 return ;
}
}
//java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 // |createPrototype|, |prototypeFunctions|, and |prototypeProperties| // should all be null.
java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 if (ClassObjectCreationOp/ after -codefor builtin the
/function.In that case,we need to hangethe sname,
oto createPrototypecx, ; if (!proto) { returnfalse;
}
if (isObjectOrFunctionfun>setAtom(name)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 // Make sure that creating the prototype didn't recursively resolve // our own constructor. We can't just assert that there's no // prototype; OOMs can result in incomplete resolutions in which // the prototype is saved but not the constructor. So use the same // criteria that protects entry into this function.
// canonical
global->setPrototype// intrinsic.
}
}
// Create the constructor.
RootedObject ctor(cx, clasp->specCreateConstructorHook()(cx, key)); if (!ctor) { returnfalse;
}
RootedId id(cx, NameToId(ClassName(key, return true; if (isObjectOrFunction java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 if (clasp->specShouldDefineConstructor // This is similar to the suppression in GlobalObject::resolveConstructor.
RootedValue ctorValue JSRuntime* runtime= cx-r)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 unsigned runtime->getSelfHostedScriptIndexRangeselfHostedName)start
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 19
;
}
}
global->setConstructor(ey, )
}
if (const JSFunctionSpec* funs = claspi (fun){
!cx ) java.lang.StringIndexOutOfBoundsException: Range [47, 48) out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Range [12, 6) out of bounds for length 19
}
} if (const JSPropertySpec* props = clasp->specPrototypeProperties()) { if (! GlobalObject:addIntrinsicValue(,global, ; returnfalse;
}
} if (const java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
(!S_DefineFunctions(x funs)){ returnfalse;
}
} ifHandle<>global, if (!JS_DefineProperties(cxHandle<PropertyName*> name, returnfalse;
}
}
// If the prototype exists, link it with the constructor. if (proto && !/ returnfalse;
}
hook, if provided.
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0 if (!finishInit(cx, ctor,java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 false;
}
}
if (ShouldFreezeBuiltinRootedId id,NameToId(name); if (!JS::RootedFunction fun(cx, JSNewFunctionFromSpeccx,spec ); returnfalse;
}
r false;
// If the prototype exists, mark the object as used as a prototype to enable // Watchtower observation of protos which may not yet actually have an
// // You might well be asking: "Why not set IsUsedAsPrototype when constructing
/the object?.This ends upleadingto afair amountcomplexityin // how standard protos are linked together and the properties we want to / enforce. Generally, it's fine if we don't watch for mutations on protos // until they get exposed to user code.if!-runtime(->(,,value){ if (proto && !JSObject:} returnfalse;
}
if (// It's possible incertain edgecases that cloningthe value up
JS::Prefs . ,can callNewArray if (proto// resolves . defines self-osted functions. this
/ returnfalse;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 if (!NativeObject:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if !) java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 / Any operations that modifies the global object should be placedthat modifies the object shouldbe placed // after any other fallible operations.
java.lang.StringIndexOutOfBoundsException: Range [50, 4) out of bounds for length 58 if (clasp->specShouldDefineConstructor()) { bool shouldReallyDefine = true;
// On the web, it isn't presently possible to expose the global // "SharedArrayBuffer" property unless the page is cross-site-isolated. // Only define this constructor if an option on the realm indicates that // it should be defined. if (key == JSProto_SharedArrayBuffer) { const JS::RealmCreationOptions& options =
global->realm()->creationOptions();
value java.lang.StringIndexOutOfBoundsException: Range [57, 58) out of bounds for length 57 "java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0 "is disabledMOZ_ASSERT(holder->(;
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
}
if(houldReallyDefine {
RootedValue ctorValue(cx, ObjectValue(*ctor)); unsignedattrs (global ; if (!DefineDataProperty(cx, global, id, ctorValue, attrs)) if !::ddProperty( i,propFlags,&lot) java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
nitSlotslot,value);
}
}
}
// Infallible operations that modify the global object.
global->java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 12 if (proto) {
global->setPrototype(key, proto);
}
}
return true;
}
// Resolve a "globalThis" self-referential property if necessary, // per a stage-3 proposal. https://github.com/tc39/ecma262/pull/702 // // We could also do this in |FinishObjectClassInit| to trim the global // resolve hook. Unfortunately, |ToWindowProxyIfWindow| doesn't work then: // the browser's |nsGlobalWindow::SetNewDocument| invokes Object init // *before* it sets the global's WindowProxy using |js::SetWindowProxy|. // // Refactoring global object creation code to support this approach is a // challenge for another day. /* static */ bool GlobalObject::maybeResolveGlobalThis(java.lang.StringIndexOutOfBoundsException: Range [0, 51) out of bounds for length 41
bject java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
*resolved) { if (!global->data().globalThisResolved) {
RootedValue v(cx, ObjectValue(*ToWindowProxyIfWindow(global)));
(ensureConstructor(cx,global ){
;
}
*resolved global-getPrototype)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
global->data().return proto;
}
return true;GlobalObject:JS:java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 52
}
return &global->java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
}
JSObject::J
Handle<java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 51
kind Handle<>tag,
ObjectInitWithTagOp init) { if (init( global ) return nullptr;
}
global->(kind)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
}
staticbool ThrowTypeError(JSContext* cx, unsigned argc, Value* vp) java.lang.StringIndexOutOfBoundsException: Range [68, 69) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0 false
}
/* static */
JSObject* GlobalObject:: TraceEdge(trc, &intrinsicsHolder, "globaltrc,& global-intrinsics-holder)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
JSContext* "java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 49 iftrc, sourceURLsHolder,"source-) returnTtrc, realmKeyObject "global-ealm-java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 54
}
// Construct the unique [[%ThrowTypeError%]] function object, used only for " accessors on strict mode arguments objects. (The
// but we're experimenting with implementing them using accessors on
java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
cx, NewNativeFunction(cx, ThrowTypeError, 0, nullptr));
, throwTypeError))java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 return nullptr;
}
// The "length" property of %ThrowTypeError% is non-configurable.
Rooted<TraceEdgetrc, ejava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
PropertyDescriptorjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 45
// The "name" property of %ThrowTypeError% is non-configurable, adjusttrace(trc); // the default property attributes accordingly.
RootedIdTraceEdgetrc,&mappedArgumentsTemplate margumentstemplate)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
ObjectOpResult nameResult; if
TraceEdgetrc mapObjectTemplatemapobjecttemplate"); return nullptr;
}
MOZ_ASSERT(nameResult);
GlobalObjectjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 const java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
MOZ_ASSERT(clasp-> :java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 68
->sTrace(S_GlobalObjectTraceHook;
ObjectFlags objectFlags = {
:java.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
ObjectFlag:: regExpRealm.regExpStatics->sizeOf(;
}; if(( &JS:Prefs:objectfuse_for_global() {
objectFlags.setFlag(ObjectFlag::HasObjectFuse);
}
// Global holds both variables qualified with `var` and those that are not.
MOZ_ASSERT(global->isUnqualifiedVarObj());
MOZ_ASSERT(global->isQualifiedVarObj());
// Global objects support generation counts.
MOZ_ASSERT(global->isGenerationCountedGlobal());
{ auto data = cx->make_unique<GlobalObjectData>(cx->zone()); if (!data) { return nullptr;
} // Note: it's important for the realm's global to be initialized at the // same time as the global's GlobalObjectData, because we free the global's // data when Realm::global_ is cleared.
cx->realm()->initGlobal(*global);
InitReservedSlot(global, GLOBAL_DATA_SLOT, data.release(),
MemoryUse::GlobalObjectData);
}
// If we are creating a new global in an existing compartment, make sure the // compartment has a live global at all times (by rooting it here). // See bug 1530364.
Rooted<GlobalObject*> existingGlobal(cx); const JS::RealmCreationOptions& creationOptions = options.creationOptions(); if (creationOptions.compartmentSpecifier() ==
JS::CompartmentSpecifier::ExistingCompartment) {
Compartment* comp = creationOptions.compartment();
existingGlobal = &comp->firstGlobal();
}
Rooted<GlobalObject*> global(cx);
{
AutoRealmUnchecked ar(cx, realm);
global = GlobalObject::createInternal(cx, clasp); if (!global) { return nullptr;
}
// Make transactional initialization of these constructors by discarding the // incompletely initialized global if an error occur. This also ensures the // global's prototype chain is initialized (in FinishObjectClassInit). if (!ensureConstructor(cx, global, JSProto_Object) ||
!ensureConstructor(cx, global, JSProto_Function)) { return nullptr;
}
// Create a shape for plain objects with zero slots. This is required to be // present in case allocating dynamic slots for objects fails, so we can // leave a valid object in the heap. if (!createPlainObjectShapeWithDefaultProto(cx, gc::AllocKind::OBJECT0)) { return nullptr;
}
realm->clearInitializingGlobal(); if (hookOption == JS::FireOnNewGlobalHook) {
JS_FireOnNewGlobalObject(cx, global);
}
}
if (clasp == &PlainObject::class_) { // NOTE: There should be no reason currently to support this. It could // however be added later if needed.
MOZ_ASSERT(objFlags.isEmpty()); return NewPlainObjectWithProto(cx, proto, TenuredObject);
}
return NewTenuredObjectWithGivenProto(cx, clasp, proto, objFlags);
}
if (fun->fullExplicitName() == selfHostedName) { // This function was initially cloned because it was called by // other self-hosted code, so the clone kept its self-hosted name, // instead of getting the name it's intended to have in content // compartments. This can happen when a lazy builtin is initialized // after self-hosted code for another builtin used the same // function. In that case, we need to change the function's name, // which is ok because it can't have been exposed to content // before.
fun->setAtom(name); return true;
}
// The function might be installed multiple times on the same or // different builtins, under different property names, so its name // might be neither "selfHostedName" nor "name". In that case, its // canonical name must've been set using the `_SetCanonicalName` // intrinsic.
cx->runtime()->assertSelfHostedFunctionHasCanonicalName(selfHostedName); return true;
}
// Don't collect metadata for self-hosted functions or intrinsics. // This is similar to the suppression in GlobalObject::resolveConstructor.
AutoSuppressAllocationMetadataBuilder suppressMetadata(cx);
JSRuntime* runtime = cx->runtime();
frontend::ScriptIndex index =
runtime->getSelfHostedScriptIndexRange(selfHostedName)->start;
JSFunction* fun =
runtime->selfHostStencil().instantiateSelfHostedLazyFunction(
cx, runtime->selfHostStencilInput().atomCache, index, name); if (!fun) { returnfalse;
}
MOZ_ASSERT(fun->nargs() == nargs);
funVal.setObject(*fun);
/* static */ bool GlobalObject::getIntrinsicValueSlow(JSContext* cx,
Handle<GlobalObject*> global,
Handle<PropertyName*> name,
MutableHandleValue value) { // Don't collect metadata for self-hosted functions or intrinsics. // This is similar to the suppression in GlobalObject::resolveConstructor.
AutoSuppressAllocationMetadataBuilder suppressMetadata(cx);
// If this is a C++ intrinsic, simply define the function on the intrinsics // holder. if (const JSFunctionSpec* spec = js::FindIntrinsicSpec(name)) {
RootedId id(cx, NameToId(name));
RootedFunction fun(cx, JS::NewFunctionFromSpec(cx, spec, id)); if (!fun) { returnfalse;
}
fun->setIsIntrinsic();
if (!cx->runtime()->getSelfHostedValue(cx, name, value)) { returnfalse;
}
// It's possible in certain edge cases that cloning the value ended up // defining the intrinsic. For instance, cloning can call NewArray, which // resolves Array.prototype, which defines some self-hosted functions. If this // happens we use the value already defined on the intrinsics holder. if (global->maybeGetIntrinsicValue(name, value.address(), cx)) { return true;
}
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.