Bug 1103152 - Remove JS_DeletePropertyStub, JS_EnumerateStub, JS_ResolveStub, and JS_ConvertStub. Make five mandatory JSClass hooks optional (nullable). r=bhackett.

--HG--
extra : rebase_source : 40b75b926ae59d91c80374fc5b25d2a459ecb717
This commit is contained in:
Jason Orendorff 2014-11-21 15:14:58 -06:00
Родитель f1f1c2a5c6
Коммит 195aa9ff10
88 изменённых файлов: 557 добавлений и 742 удалений

Просмотреть файл

@ -431,8 +431,7 @@ NS_INTERFACE_MAP_END
static const JSClass sDOMConstructorProtoClass = {
"DOM Constructor.prototype", 0,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nullptr
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
@ -2053,8 +2052,7 @@ nsWindowSH::NameStructEnabled(JSContext* aCx, nsGlobalWindow *aWin,
#ifdef USE_CONTROLLERS_SHIM
static const JSClass ControllersShimClass = {
"XULControllers", 0,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nullptr
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
#endif

Просмотреть файл

@ -425,8 +425,8 @@ class CGDOMJSClass(CGThing):
resolveHook = "mozilla::dom::ResolveGlobal"
enumerateHook = "mozilla::dom::EnumerateGlobal"
else:
resolveHook = "JS_ResolveStub"
enumerateHook = "JS_EnumerateStub"
resolveHook = "nullptr"
enumerateHook = "nullptr"
return fill(
"""
@ -434,12 +434,12 @@ class CGDOMJSClass(CGThing):
{ "${name}",
${flags},
${addProperty}, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
${enumerate}, /* enumerate */
${resolve}, /* resolve */
JS_ConvertStub,
nullptr, /* convert */
${finalize}, /* finalize */
${call}, /* call */
nullptr, /* hasInstance */
@ -457,7 +457,7 @@ class CGDOMJSClass(CGThing):
""",
name=self.descriptor.interface.identifier.name,
flags=classFlags,
addProperty=ADDPROPERTY_HOOK_NAME if wantsAddProperty(self.descriptor) else 'JS_PropertyStub',
addProperty=ADDPROPERTY_HOOK_NAME if wantsAddProperty(self.descriptor) else 'nullptr',
enumerate=enumerateHook,
resolve=resolveHook,
finalize=FINALIZE_HOOK_NAME,
@ -649,13 +649,13 @@ class CGPrototypeJSClass(CGThing):
{
"${name}Prototype",
JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(${slotCount}),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
@ -745,13 +745,13 @@ class CGInterfaceObjectJSClass(CGThing):
{
"Function",
JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(${slotCount}),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
${ctorname}, /* call */
${hasInstance}, /* hasInstance */

Просмотреть файл

@ -14193,13 +14193,13 @@ CreateIndexOp::DoDatabaseWork(TransactionBase* aTransaction)
const JSClass CreateIndexOp::ThreadLocalJSRuntime::kGlobalClass = {
"IndexedDBTransactionThreadGlobal",
JSCLASS_GLOBAL_FLAGS,
/* addProperty*/ JS_PropertyStub,
/* delProperty */ JS_DeletePropertyStub,
/* addProperty */ nullptr,
/* delProperty */ nullptr,
/* getProperty */ JS_PropertyStub,
/* setProperty */ JS_StrictPropertyStub,
/* enumerate */ JS_EnumerateStub,
/* resolve */ JS_ResolveStub,
/* convert */ JS_ConvertStub,
/* enumerate */ nullptr,
/* resolve */ nullptr,
/* convert */ nullptr,
/* finalize */ nullptr,
/* call */ nullptr,
/* hasInstance */ nullptr,

Просмотреть файл

@ -843,14 +843,10 @@ ClearStructuredCloneBuffer(JSAutoStructuredCloneBuffer& aBuffer)
const JSClass IDBObjectStore::sDummyPropJSClass = {
"IDBObjectStore Dummy",
0 /* flags */,
JS_PropertyStub /* addProperty */,
JS_DeletePropertyStub /* delProperty */,
nullptr /* addProperty */,
nullptr /* delProperty */,
JS_PropertyStub /* getProperty */,
JS_StrictPropertyStub /* setProperty */,
JS_EnumerateStub /* enumerate */,
JS_ResolveStub /* resolve */,
JS_ConvertStub /* convert */,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_StrictPropertyStub /* setProperty */
};
IDBObjectStore::IDBObjectStore(IDBTransaction* aTransaction,

Просмотреть файл

@ -229,9 +229,9 @@ NPObjectMember_Trace(JSTracer *trc, JSObject *obj);
static const JSClass sNPObjectMemberClass =
{
"NPObject Ambiguous Member class", JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS,
JS_PropertyStub, JS_DeletePropertyStub,
JS_PropertyStub, JS_StrictPropertyStub, JS_EnumerateStub,
JS_ResolveStub, NPObjectMember_Convert,
nullptr, nullptr,
JS_PropertyStub, JS_StrictPropertyStub, nullptr,
nullptr, NPObjectMember_Convert,
NPObjectMember_Finalize, NPObjectMember_Call,
nullptr, nullptr, NPObjectMember_Trace
};
@ -1713,16 +1713,16 @@ NPObjWrapper_Convert(JSContext *cx, JS::Handle<JSObject*> obj, JSType hint, JS::
{
MOZ_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID);
// Plugins do not simply use JS_ConvertStub, and the default [[DefaultValue]]
// behavior, because that behavior involves calling toString or valueOf on
// objects which weren't designed to accommodate this. Usually this wouldn't
// be a problem, because the absence of either property, or the presence of
// either property with a value that isn't callable, will cause that property
// to simply be ignored. But there is a problem in one specific case: Java,
// specifically java.lang.Integer. The Integer class has static valueOf
// methods, none of which are nullary, so the JS-reflected method will behave
// poorly when called with no arguments. We work around this problem by
// giving plugins a [[DefaultValue]] which uses only toString and not valueOf.
// Plugins do not simply use the default [[DefaultValue]] behavior, because
// that behavior involves calling toString or valueOf on objects which
// weren't designed to accommodate this. Usually this wouldn't be a problem,
// because the absence of either property, or the presence of either property
// with a value that isn't callable, will cause that property to simply be
// ignored. But there is a problem in one specific case: Java, specifically
// java.lang.Integer. The Integer class has static valueOf methods, none of
// which are nullary, so the JS-reflected method will behave poorly when
// called with no arguments. We work around this problem by giving plugins a
// [[DefaultValue]] which uses only toString and not valueOf.
JS::Rooted<JS::Value> v(cx, JSVAL_VOID);
if (!JS_GetProperty(cx, obj, "toString", &v))

Просмотреть файл

@ -92,10 +92,10 @@ static const JSClass gPrototypeJSClass = {
JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS |
// Our one reserved slot holds the relevant nsXBLPrototypeBinding
JSCLASS_HAS_RESERVED_SLOTS(1),
JS_PropertyStub, JS_DeletePropertyStub,
nullptr, nullptr,
JS_PropertyStub, JS_StrictPropertyStub,
XBLEnumerate, JS_ResolveStub,
JS_ConvertStub, XBLFinalize,
XBLEnumerate, nullptr,
nullptr, XBLFinalize,
nullptr, nullptr, nullptr, nullptr
};

Просмотреть файл

@ -939,12 +939,12 @@ const Class AsmJSModuleObject::class_ = {
"AsmJSModuleObject",
JSCLASS_IS_ANONYMOUS | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(AsmJSModuleObject::RESERVED_SLOTS),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
AsmJSModuleObject_finalize,
nullptr, /* call */

Просмотреть файл

@ -146,18 +146,10 @@ MSC_FETCHBITOP(uint32_t, long, _InterlockedAnd, _InterlockedOr, _InterlockedXor)
const Class AtomicsObject::class_ = {
"Atomics",
JSCLASS_HAS_CACHED_PROTO(JSProto_Atomics),
nullptr, // addProperty
nullptr, // delProperty
JS_PropertyStub,
JS_DeletePropertyStub,
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, // finalize
nullptr, // call
nullptr, // hasInstance
nullptr, // construct
nullptr // trace
JS_StrictPropertyStub
};
static bool

Просмотреть файл

@ -559,13 +559,13 @@ static const uint32_t COLLATOR_SLOTS_COUNT = 1;
static const Class CollatorClass = {
js_Object_str,
JSCLASS_HAS_RESERVED_SLOTS(COLLATOR_SLOTS_COUNT),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
collator_finalize
};
@ -1048,13 +1048,13 @@ static const uint32_t NUMBER_FORMAT_SLOTS_COUNT = 1;
static const Class NumberFormatClass = {
js_Object_str,
JSCLASS_HAS_RESERVED_SLOTS(NUMBER_FORMAT_SLOTS_COUNT),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
numberFormat_finalize
};
@ -1505,13 +1505,13 @@ static const uint32_t DATE_TIME_FORMAT_SLOTS_COUNT = 1;
static const Class DateTimeFormatClass = {
js_Object_str,
JSCLASS_HAS_RESERVED_SLOTS(DATE_TIME_FORMAT_SLOTS_COUNT),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
dateTimeFormat_finalize
};
@ -2001,13 +2001,10 @@ js::intl_FormatDateTime(JSContext *cx, unsigned argc, Value *vp)
const Class js::IntlClass = {
js_Object_str,
JSCLASS_HAS_CACHED_PROTO(JSProto_Intl),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
#if JS_HAS_TOSOURCE

Просмотреть файл

@ -867,13 +867,13 @@ const Class MapIteratorObject::class_ = {
"Map Iterator",
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(MapIteratorObject::SlotCount),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
MapIteratorObject::finalize
};
@ -1011,13 +1011,13 @@ const Class MapObject::class_ = {
"Map",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_CACHED_PROTO(JSProto_Map),
JS_PropertyStub, // addProperty
JS_DeletePropertyStub, // delProperty
nullptr, // addProperty
nullptr, // delProperty
JS_PropertyStub, // getProperty
JS_StrictPropertyStub, // setProperty
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, // enumerate
nullptr, // resolve
nullptr, // convert
finalize,
nullptr, // call
nullptr, // hasInstance
@ -1524,13 +1524,13 @@ const Class SetIteratorObject::class_ = {
"Set Iterator",
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(SetIteratorObject::SlotCount),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
SetIteratorObject::finalize
};
@ -1664,13 +1664,13 @@ const Class SetObject::class_ = {
"Set",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_CACHED_PROTO(JSProto_Set),
JS_PropertyStub, // addProperty
JS_DeletePropertyStub, // delProperty
nullptr, // addProperty
nullptr, // delProperty
JS_PropertyStub, // getProperty
JS_StrictPropertyStub, // setProperty
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, // enumerate
nullptr, // resolve
nullptr, // convert
finalize,
nullptr, // call
nullptr, // hasInstance

Просмотреть файл

@ -168,13 +168,13 @@ static bool type##SignMask(JSContext *cx, unsigned argc, Value *vp) { \
const Class SimdTypeDescr::class_ = {
"SIMD",
JSCLASS_HAS_RESERVED_SLOTS(JS_DESCR_SLOTS),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
call, /* call */
nullptr, /* hasInstance */
@ -354,18 +354,10 @@ SimdTypeDescr::call(JSContext *cx, unsigned argc, Value *vp)
const Class SIMDObject::class_ = {
"SIMD",
JSCLASS_HAS_CACHED_PROTO(JSProto_SIMD),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr
JS_StrictPropertyStub /* setProperty */
};
JSObject *

Просмотреть файл

@ -19,12 +19,12 @@ using namespace js;
const Class SymbolObject::class_ = {
"Symbol",
JSCLASS_HAS_RESERVED_SLOTS(RESERVED_SLOTS) | JSCLASS_HAS_CACHED_PROTO(JSProto_Symbol),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
nullptr, /* enumerate */
nullptr, /* resolve */
convert
};

Просмотреть файл

@ -959,13 +959,10 @@ OOMAfterAllocations(JSContext *cx, unsigned argc, jsval *vp)
static const js::Class FakePromiseClass = {
"Promise", JSCLASS_IS_ANONYMOUS,
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
static bool
@ -1011,13 +1008,13 @@ finalize_counter_finalize(JSFreeOp *fop, JSObject *obj)
static const JSClass FinalizeCounterClass = {
"FinalizeCounter", JSCLASS_IS_ANONYMOUS,
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
finalize_counter_finalize
};
@ -1553,13 +1550,13 @@ class CloneBufferObject : public NativeObject {
const Class CloneBufferObject::class_ = {
"CloneBuffer", JSCLASS_HAS_RESERVED_SLOTS(CloneBufferObject::NUM_SLOTS),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
Finalize,
nullptr, /* call */
nullptr, /* hasInstance */

Просмотреть файл

@ -36,13 +36,10 @@ const Class js::TypedObjectModuleObject::class_ = {
"TypedObject",
JSCLASS_HAS_RESERVED_SLOTS(SlotCount) |
JSCLASS_HAS_CACHED_PROTO(JSProto_TypedObject),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
static const JSFunctionSpec TypedObjectMethods[] = {
@ -209,18 +206,10 @@ GetPrototype(JSContext *cx, HandleObject obj)
const Class js::TypedProto::class_ = {
"TypedProto",
JSCLASS_HAS_RESERVED_SLOTS(JS_TYPROTO_SLOTS),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr
JS_StrictPropertyStub /* setProperty */
};
/***************************************************************************
@ -235,18 +224,15 @@ const Class js::TypedProto::class_ = {
const Class js::ScalarTypeDescr::class_ = {
"Scalar",
JSCLASS_HAS_RESERVED_SLOTS(JS_DESCR_SLOTS),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr,
ScalarTypeDescr::call,
nullptr,
nullptr,
nullptr
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
ScalarTypeDescr::call
};
const JSFunctionSpec js::ScalarTypeDescr::typeObjectMethods[] = {
@ -331,18 +317,15 @@ ScalarTypeDescr::call(JSContext *cx, unsigned argc, Value *vp)
const Class js::ReferenceTypeDescr::class_ = {
"Reference",
JSCLASS_HAS_RESERVED_SLOTS(JS_DESCR_SLOTS),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr,
ReferenceTypeDescr::call,
nullptr,
nullptr,
nullptr
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
ReferenceTypeDescr::call
};
const JSFunctionSpec js::ReferenceTypeDescr::typeObjectMethods[] = {
@ -513,14 +496,14 @@ CreatePrototypeObjectForComplexTypeInstance(JSContext *cx,
const Class ArrayTypeDescr::class_ = {
"ArrayType",
JSCLASS_HAS_RESERVED_SLOTS(JS_DESCR_SLOTS),
JS_PropertyStub,
JS_DeletePropertyStub,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr,
nullptr,
TypedObject::construct,
@ -741,13 +724,13 @@ js::IsTypedObjectArray(JSObject &obj)
const Class StructTypeDescr::class_ = {
"StructType",
JSCLASS_HAS_RESERVED_SLOTS(JS_DESCR_SLOTS),
JS_PropertyStub,
JS_DeletePropertyStub,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
@ -2420,13 +2403,13 @@ LazyArrayBufferTable::sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf)
const Class Name::class_ = { \
# Name, \
Class::NON_NATIVE | JSCLASS_IMPLEMENTS_BARRIERS, \
JS_PropertyStub, \
JS_DeletePropertyStub, \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, \
JS_StrictPropertyStub, \
JS_EnumerateStub, \
JS_ResolveStub, \
JS_ConvertStub, \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \
nullptr, /* finalize */ \
nullptr, /* call */ \
nullptr, /* hasInstance */ \
@ -3204,4 +3187,3 @@ TypeDescr::traceInstances(JSTracer *trace, uint8_t *mem, size_t length)
mem += size();
}
}

Просмотреть файл

@ -23,13 +23,10 @@ const Class WeakSetObject::class_ = {
"WeakSet",
JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_CACHED_PROTO(JSProto_WeakSet) |
JSCLASS_HAS_RESERVED_SLOTS(WeakSetObject::RESERVED_SLOTS),
JS_PropertyStub, // addProperty
JS_DeletePropertyStub, // delProperty
nullptr, // addProperty
nullptr, // delProperty
JS_PropertyStub, // getProperty
JS_StrictPropertyStub, // setProperty
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub // setProperty
};
const JSPropertySpec WeakSetObject::properties[] = {

Просмотреть файл

@ -514,15 +514,13 @@ namespace UInt64 {
static const JSClass sCTypesGlobalClass = {
"ctypes",
JSCLASS_HAS_RESERVED_SLOTS(CTYPESGLOBAL_SLOTS),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
static const JSClass sCABIClass = {
"CABI",
JSCLASS_HAS_RESERVED_SLOTS(CABI_SLOTS),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
// Class representing ctypes.{C,Pointer,Array,Struct,Function}Type.prototype.
@ -531,8 +529,8 @@ static const JSClass sCABIClass = {
static const JSClass sCTypeProtoClass = {
"CType",
JSCLASS_HAS_RESERVED_SLOTS(CTYPEPROTO_SLOTS),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nullptr,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
ConstructAbstract, nullptr, ConstructAbstract
};
@ -541,15 +539,14 @@ static const JSClass sCTypeProtoClass = {
static const JSClass sCDataProtoClass = {
"CData",
0,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
static const JSClass sCTypeClass = {
"CType",
JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(CTYPE_SLOTS),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CType::Finalize,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, CType::Finalize,
CType::ConstructData, CType::HasInstance, CType::ConstructData,
CType::Trace
};
@ -557,16 +554,16 @@ static const JSClass sCTypeClass = {
static const JSClass sCDataClass = {
"CData",
JSCLASS_HAS_RESERVED_SLOTS(CDATA_SLOTS),
JS_PropertyStub, JS_DeletePropertyStub, ArrayType::Getter, ArrayType::Setter,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CData::Finalize,
nullptr, nullptr, ArrayType::Getter, ArrayType::Setter,
nullptr, nullptr, nullptr, CData::Finalize,
FunctionType::Call, nullptr, FunctionType::Call
};
static const JSClass sCClosureClass = {
"CClosure",
JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(CCLOSURE_SLOTS),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CClosure::Finalize,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, CClosure::Finalize,
nullptr, nullptr, nullptr, CClosure::Trace
};
@ -576,8 +573,7 @@ static const JSClass sCClosureClass = {
static const JSClass sCDataFinalizerProtoClass = {
"CDataFinalizer",
0,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
/*
@ -589,8 +585,8 @@ static const JSClass sCDataFinalizerProtoClass = {
static const JSClass sCDataFinalizerClass = {
"CDataFinalizer",
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(CDATAFINALIZER_SLOTS),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, CDataFinalizer::Finalize,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, CDataFinalizer::Finalize,
};
@ -765,29 +761,27 @@ static const JSFunctionSpec sFunctionInstanceFunctions[] = {
static const JSClass sInt64ProtoClass = {
"Int64",
0,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
static const JSClass sUInt64ProtoClass = {
"UInt64",
0,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
static const JSClass sInt64Class = {
"Int64",
JSCLASS_HAS_RESERVED_SLOTS(INT64_SLOTS),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Int64Base::Finalize
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, Int64Base::Finalize
};
static const JSClass sUInt64Class = {
"UInt64",
JSCLASS_HAS_RESERVED_SLOTS(INT64_SLOTS),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Int64Base::Finalize
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, Int64Base::Finalize
};
static const JSFunctionSpec sInt64StaticFunctions[] = {

Просмотреть файл

@ -34,8 +34,8 @@ typedef Rooted<JSFlatString*> RootedFlatString;
static const JSClass sLibraryClass = {
"Library",
JSCLASS_HAS_RESERVED_SLOTS(LIBRARY_SLOTS),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub,JS_ResolveStub, JS_ConvertStub, Library::Finalize
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, Library::Finalize
};
#define CTYPESFN_FLAGS \

Просмотреть файл

@ -15,9 +15,9 @@ using namespace JS;
/* The class of the global object. */
const JSClass global_class = {
"global", JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook
};

Просмотреть файл

@ -3364,7 +3364,7 @@ CheckHasNoSuchProperty(JSContext *cx, HandleObject obj, HandlePropertyName name,
return false;
// Don't handle proto chains with resolve hooks.
if (curObj->getClass()->resolve != JS_ResolveStub)
if (curObj->getClass()->resolve)
return false;
Shape *shape = curObj->as<NativeObject>().lookup(cx, NameToId(name));
@ -3515,8 +3515,8 @@ IsCacheableSetPropAddSlot(JSContext *cx, HandleObject obj, HandleShape oldShape,
return false;
}
// If object has a non-default resolve hook, don't inline
if (obj->getClass()->resolve != JS_ResolveStub)
// If object has a resolve hook, don't inline
if (obj->getClass()->resolve)
return false;
size_t chainDepth = 0;
@ -3535,7 +3535,7 @@ IsCacheableSetPropAddSlot(JSContext *cx, HandleObject obj, HandleShape oldShape,
// Otherise, if there's no such property, watch out for a resolve hook that would need
// to be invoked and thus prevent inlining of property addition.
if (proto->getClass()->resolve != JS_ResolveStub)
if (proto->getClass()->resolve)
return false;
}

Просмотреть файл

@ -6556,7 +6556,7 @@ ClassHasResolveHook(CompileCompartment *comp, const Class *clasp, PropertyName *
if (clasp == &ArrayObject::class_)
return name == comp->runtime()->names().length;
if (clasp->resolve == JS_ResolveStub)
if (!clasp->resolve)
return false;
if (clasp->resolve == str_resolve) {

Просмотреть файл

@ -2731,13 +2731,12 @@ IsPropertyAddInlineable(NativeObject *obj, HandleId id, ConstantOrRegister val,
// the shape must be the one we just added.
MOZ_ASSERT(shape == obj->lastProperty());
// If object has a non-default resolve hook, don't inline
if (obj->getClass()->resolve != JS_ResolveStub)
// If object has a resolve hook, don't inline
if (obj->getClass()->resolve)
return false;
// Likewise for a non-default addProperty hook, since we'll need
// to invoke it.
if (obj->getClass()->addProperty != JS_PropertyStub)
// Likewise for an addProperty hook, since we'll need to invoke it.
if (obj->getClass()->addProperty)
return false;
if (!obj->nonProxyIsExtensible() || !shape->writable())
@ -2759,7 +2758,7 @@ IsPropertyAddInlineable(NativeObject *obj, HandleId id, ConstantOrRegister val,
// Otherwise, if there's no such property, watch out for a resolve
// hook that would need to be invoked and thus prevent inlining of
// property addition.
if (proto->getClass()->resolve != JS_ResolveStub)
if (proto->getClass()->resolve)
return false;
}

Просмотреть файл

@ -20,12 +20,9 @@ static const JSClass AddPropertyClass = {
"AddPropertyTester",
0,
AddProperty,
JS_DeletePropertyStub, /* delProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
BEGIN_TEST(testAddPropertyHook)

Просмотреть файл

@ -9,13 +9,10 @@ using namespace JS;
static const JSClass CustomClass = {
"CustomClass",
JSCLASS_HAS_RESERVED_SLOTS(1),
nullptr,
nullptr,
JS_PropertyStub,
JS_DeletePropertyStub,
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub
};
static const uint32_t CUSTOM_SLOT = 0;

Просмотреть файл

@ -11,13 +11,13 @@ static TestJSPrincipals system_principals(1);
static const JSClass global_class = {
"global",
JSCLASS_IS_GLOBAL | JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub,
JS_DeletePropertyStub,
nullptr,
nullptr,
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,

Просмотреть файл

@ -25,13 +25,10 @@ static const JSClass ptestClass = {
"PTest",
JSCLASS_HAS_PRIVATE,
JS_PropertyStub, // add
JS_DeletePropertyStub, // delete
nullptr, // add
nullptr, // delete
test_prop_get, // get
JS_StrictPropertyStub, // set
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub // set
};
static bool

Просмотреть файл

@ -23,8 +23,8 @@ BEGIN_TEST(testRedefineGlobalEval)
{
static const JSClass cls = {
"global", JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
GlobalEnumerate, GlobalResolve, JS_ConvertStub,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
GlobalEnumerate, GlobalResolve, nullptr,
nullptr, nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook
};

Просмотреть файл

@ -40,13 +40,10 @@ END_TEST(testLookup_bug522590)
static const JSClass DocumentAllClass = {
"DocumentAll",
JSCLASS_EMULATES_UNDEFINED,
nullptr,
nullptr,
JS_PropertyStub,
JS_DeletePropertyStub,
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub
};
bool
@ -83,8 +80,8 @@ document_resolve(JSContext *cx, JS::HandleObject obj, JS::HandleId id, bool *res
static const JSClass document_class = {
"document", 0,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, document_resolve, JS_ConvertStub
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, document_resolve, nullptr
};
BEGIN_TEST(testLookup_bug570195)

Просмотреть файл

@ -96,8 +96,8 @@ BEGIN_TEST(testNewObject_1)
static const JSClass cls = {
"testNewObject_1",
0,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nullptr,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, constructHook
};
JS::RootedObject ctor(cx, JS_NewObject(cx, &cls, JS::NullPtr(), JS::NullPtr()));

Просмотреть файл

@ -7,13 +7,10 @@
static const JSClass ObjectEmulatingUndefinedClass = {
"ObjectEmulatingUndefined",
JSCLASS_EMULATES_UNDEFINED,
nullptr,
nullptr,
JS_PropertyStub,
JS_DeletePropertyStub,
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub
};
static bool

Просмотреть файл

@ -22,8 +22,8 @@ my_convert(JSContext* context, JS::HandleObject obj, JSType type, JS::MutableHan
static const JSClass myClass = {
"MyClass",
0,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, my_convert
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, my_convert
};
static bool

Просмотреть файл

@ -22,13 +22,13 @@ int BarkWhenTracedClass::traceCount;
const JSClass BarkWhenTracedClass::class_ = {
"BarkWhenTracedClass", 0,
JS_PropertyStub,
JS_DeletePropertyStub,
nullptr,
nullptr,
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr,
nullptr,
nullptr,
finalize,
nullptr,
nullptr,

Просмотреть файл

@ -26,8 +26,7 @@ reset(JSContext *cx)
}
static const JSClass ptestClass = {
"Prof", 0, JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub,
JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
"Prof", 0, nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
static bool

Просмотреть файл

@ -19,8 +19,7 @@ CounterAdd(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHand
static const JSClass CounterClass = {
"Counter", /* name */
0, /* flags */
CounterAdd, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
CounterAdd, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
BEGIN_TEST(testPropCache_bug505798)

Просмотреть файл

@ -17,13 +17,12 @@ BEGIN_TEST(testResolveRecursion)
static const JSClass my_resolve_class = {
"MyResolve",
JSCLASS_HAS_PRIVATE,
JS_PropertyStub, // add
JS_DeletePropertyStub, // delete
nullptr, // add
nullptr, // delete
JS_PropertyStub, // get
JS_StrictPropertyStub, // set
JS_EnumerateStub,
my_resolve,
JS_ConvertStub
nullptr,
my_resolve
};
obj1 = obj2 = nullptr;

Просмотреть файл

@ -68,7 +68,7 @@ BEGIN_TEST(testSetProperty_InheritedGlobalSetter)
// This is a JSAPI test because jsapi-test globals do not have a resolve
// hook and therefore can use the property cache in some cases where the
// shell can't.
MOZ_ASSERT(JS_GetClass(global)->resolve == &JS_ResolveStub);
MOZ_ASSERT(!JS_GetClass(global)->resolve);
CHECK(JS_DefineProperty(cx, global, "HOTLOOP", 8, 0));
EXEC("var n = 0;\n"

Просмотреть файл

@ -138,14 +138,14 @@ JSObject *newKey()
static const js::Class keyClass = {
"keyWithDelgate",
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(1),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr,
nullptr,
nullptr,
@ -200,14 +200,14 @@ JSObject *newDelegate()
static const JSClass delegateClass = {
"delegate",
JSCLASS_GLOBAL_FLAGS | JSCLASS_HAS_RESERVED_SLOTS(1),
JS_PropertyStub,
JS_DeletePropertyStub,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr,
nullptr,
nullptr,

Просмотреть файл

@ -228,8 +228,8 @@ class JSAPITest
static const JSClass * basicGlobalClass() {
static const JSClass c = {
"global", JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nullptr,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook
};

Просмотреть файл

@ -2144,27 +2144,7 @@ JS_StrictPropertyStub(JSContext *cx, HandleObject obj, HandleId id, bool strict,
}
JS_PUBLIC_API(bool)
JS_DeletePropertyStub(JSContext *cx, HandleObject obj, HandleId id, bool *succeeded)
{
*succeeded = true;
return true;
}
JS_PUBLIC_API(bool)
JS_EnumerateStub(JSContext *cx, HandleObject obj)
{
return true;
}
JS_PUBLIC_API(bool)
JS_ResolveStub(JSContext *cx, HandleObject obj, HandleId id, bool *resolvedp)
{
MOZ_ASSERT(*resolvedp == false);
return true;
}
JS_PUBLIC_API(bool)
JS_ConvertStub(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue vp)
JS::OrdinaryToPrimitive(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue vp)
{
MOZ_ASSERT(type != JSTYPE_OBJECT && type != JSTYPE_FUNCTION);
MOZ_ASSERT(obj);
@ -2819,7 +2799,6 @@ DefinePropertyById(JSContext *cx, HandleObject obj, HandleId id, HandleValue val
MOZ_ASSERT_IF(setter == JS_StrictPropertyStub,
getter == JS_PropertyStub || (attrs & JSPROP_PROPOP_ACCESSORS));
// If !(attrs & JSPROP_PROPOP_ACCESSORS), then either getter/setter are both
// possibly-null JSNatives (or possibly-null JSFunction* if JSPROP_GETTER or
// JSPROP_SETTER is appropriately set), or both are the well-known property

Просмотреть файл

@ -1159,6 +1159,17 @@ ToString(JSContext *cx, HandleValue v)
return js::ToStringSlow(cx, v);
}
/*
* Implements ES6 draft rev 28 (2014 Oct 14) 7.1.1, second algorithm.
*
* Most users should not call this -- use JS::ToNumber, ToBoolean, or ToString
* instead. This should only be called from custom convert hooks. It implements
* the default conversion behavior shared by most objects in JS, so it's useful
* as a fallback.
*/
extern JS_PUBLIC_API(bool)
OrdinaryToPrimitive(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue vp);
} /* namespace JS */
extern JS_PUBLIC_API(bool)
@ -2368,20 +2379,6 @@ extern JS_PUBLIC_API(bool)
JS_StrictPropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id, bool strict,
JS::MutableHandleValue vp);
extern JS_PUBLIC_API(bool)
JS_DeletePropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
bool *succeeded);
extern JS_PUBLIC_API(bool)
JS_EnumerateStub(JSContext *cx, JS::HandleObject obj);
extern JS_PUBLIC_API(bool)
JS_ResolveStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id, bool *resolvedp);
extern JS_PUBLIC_API(bool)
JS_ConvertStub(JSContext *cx, JS::HandleObject obj, JSType type,
JS::MutableHandleValue vp);
template<typename T>
struct JSConstScalarSpec {
const char *name;

Просмотреть файл

@ -2785,12 +2785,8 @@ GetIndexedPropertiesInRange(JSContext *cx, HandleObject obj, uint32_t begin, uin
// properties.
JSObject *pobj = obj;
do {
if (!pobj->isNative() ||
pobj->getClass()->resolve != JS_ResolveStub ||
pobj->getOps()->lookupGeneric)
{
if (!pobj->isNative() || pobj->getClass()->resolve || pobj->getOps()->lookupGeneric)
return true;
}
} while ((pobj = pobj->getProto()));
// Collect indexed property names.
@ -3364,13 +3360,13 @@ const Class ArrayObject::class_ = {
"Array",
JSCLASS_HAS_CACHED_PROTO(JSProto_Array),
array_addProperty,
JS_DeletePropertyStub, /* delProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */

Просмотреть файл

@ -28,13 +28,10 @@ using namespace js::types;
const Class BooleanObject::class_ = {
"Boolean",
JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Boolean),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
MOZ_ALWAYS_INLINE bool

Просмотреть файл

@ -322,7 +322,10 @@ CallJSDeletePropertyOp(JSContext *cx, JSDeletePropertyOp op, HandleObject receiv
JS_CHECK_RECURSION(cx, return false);
assertSameCompartment(cx, receiver, id);
if (op)
return op(cx, receiver, id, succeeded);
*succeeded = true;
return true;
}
inline bool

Просмотреть файл

@ -3020,12 +3020,12 @@ const Class DateObject::class_ = {
js_Date_str,
JSCLASS_HAS_RESERVED_SLOTS(RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_Date),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
nullptr, /* enumerate */
nullptr, /* resolve */
date_convert,
nullptr, /* finalize */
nullptr, /* call */

Просмотреть файл

@ -64,13 +64,13 @@ static const JSFunctionSpec exception_methods[] = {
JSCLASS_IMPLEMENTS_BARRIERS | \
JSCLASS_HAS_CACHED_PROTO(JSProto_##name) | \
JSCLASS_HAS_RESERVED_SLOTS(ErrorObject::RESERVED_SLOTS), \
JS_PropertyStub, /* addProperty */ \
JS_DeletePropertyStub, /* delProperty */ \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, /* getProperty */ \
JS_StrictPropertyStub, /* setProperty */ \
JS_EnumerateStub, \
JS_ResolveStub, \
JS_ConvertStub, \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \
exn_finalize, \
nullptr, /* call */ \
nullptr, /* hasInstance */ \
@ -94,13 +94,13 @@ ErrorObject::classes[JSEXN_LIMIT] = {
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_CACHED_PROTO(JSProto_Error) |
JSCLASS_HAS_RESERVED_SLOTS(ErrorObject::RESERVED_SLOTS),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
exn_finalize,
nullptr, /* call */
nullptr, /* hasInstance */

Просмотреть файл

@ -277,12 +277,12 @@ namespace js {
JSCLASS_IS_PROXY | \
JSCLASS_IMPLEMENTS_BARRIERS | \
flags, \
JS_PropertyStub, /* addProperty */ \
JS_DeletePropertyStub, /* delProperty */ \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, /* getProperty */ \
JS_StrictPropertyStub, /* setProperty */ \
JS_EnumerateStub, \
JS_ResolveStub, \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
js::proxy_Convert, \
js::proxy_Finalize, /* finalize */ \
nullptr, /* call */ \

Просмотреть файл

@ -894,13 +894,13 @@ const Class JSFunction::class_ = {
js_Function_str,
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_CACHED_PROTO(JSProto_Function),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
fun_enumerate,
js::fun_resolve,
JS_ConvertStub,
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
fun_hasInstance,

Просмотреть файл

@ -2363,8 +2363,7 @@ types::UseNewTypeForInitializer(JSScript *script, jsbytecode *pc, const Class *c
static inline bool
ClassCanHaveExtraProperties(const Class *clasp)
{
MOZ_ASSERT(clasp->resolve);
return clasp->resolve != JS_ResolveStub
return clasp->resolve
|| clasp->ops.lookupGeneric
|| clasp->ops.getGeneric
|| IsAnyTypedArrayClass(clasp);

Просмотреть файл

@ -286,8 +286,10 @@ Snapshot(JSContext *cx, HandleObject pobj_, unsigned flags, AutoIdVector *props)
!pobj->getOps()->enumerate &&
!(clasp->flags & JSCLASS_NEW_ENUMERATE))
{
if (!clasp->enumerate(cx, pobj.as<NativeObject>()))
if (JSEnumerateOp enumerate = clasp->enumerate) {
if (!enumerate(cx, pobj.as<NativeObject>()))
return false;
}
if (!EnumerateNativeProperties(cx, pobj.as<NativeObject>(), flags, ht, props))
return false;
} else {
@ -723,7 +725,7 @@ js::GetIterator(JSContext *cx, HandleObject obj, unsigned flags, MutableHandleOb
IsAnyTypedArray(pobj) ||
pobj->hasUncacheableProto() ||
pobj->getOps()->enumerate ||
pobj->getClass()->enumerate != JS_EnumerateStub ||
pobj->getClass()->enumerate ||
pobj->as<NativeObject>().containsPure(cx->names().iteratorIntrinsic))
{
shapes.clear();
@ -921,13 +923,13 @@ const Class PropertyIteratorObject::class_ = {
JSCLASS_HAS_CACHED_PROTO(JSProto_Iterator) |
JSCLASS_HAS_PRIVATE |
JSCLASS_BACKGROUND_FINALIZE,
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
finalize,
nullptr, /* call */
nullptr, /* hasInstance */
@ -946,14 +948,10 @@ const Class ArrayIteratorObject::class_ = {
"Array Iterator",
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(ArrayIteratorSlotCount),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr /* finalize */
JS_StrictPropertyStub /* setProperty */
};
static const JSFunctionSpec array_iterator_methods[] = {
@ -965,14 +963,10 @@ static const JSFunctionSpec array_iterator_methods[] = {
static const Class StringIteratorPrototypeClass = {
"String Iterator",
JSCLASS_IMPLEMENTS_BARRIERS,
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr /* finalize */
JS_StrictPropertyStub /* setProperty */
};
enum {
@ -985,14 +979,10 @@ const Class StringIteratorObject::class_ = {
"String Iterator",
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(StringIteratorSlotCount),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr /* finalize */
JS_StrictPropertyStub /* setProperty */
};
static const JSFunctionSpec string_iterator_methods[] = {
@ -1319,13 +1309,13 @@ stopiter_hasInstance(JSContext *cx, HandleObject obj, MutableHandleValue v, bool
const Class StopIterationObject::class_ = {
"StopIteration",
JSCLASS_HAS_CACHED_PROTO(JSProto_StopIteration),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
stopiter_hasInstance,

Просмотреть файл

@ -79,13 +79,10 @@ MathCache::sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf)
const Class js::MathClass = {
js_Math_str,
JSCLASS_HAS_CACHED_PROTO(JSProto_Math),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
bool

Просмотреть файл

@ -464,13 +464,10 @@ static const JSFunctionSpec number_functions[] = {
const Class NumberObject::class_ = {
js_Number_str,
JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Number),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
static bool

Просмотреть файл

@ -177,13 +177,13 @@ FinishObjectClassInit(JSContext *cx, JS::HandleObject ctor, JS::HandleObject pro
const Class JSObject::class_ = {
js_Object_str,
JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
@ -2724,14 +2724,10 @@ js_InitClass(JSContext *cx, HandleObject obj, JSObject *protoProto_,
{
RootedObject protoProto(cx, protoProto_);
/* Assert mandatory function pointer members. */
MOZ_ASSERT(clasp->addProperty);
MOZ_ASSERT(clasp->delProperty);
/* Check function pointer members. */
MOZ_ASSERT(clasp->addProperty != JS_PropertyStub); // (use null instead)
MOZ_ASSERT(clasp->getProperty);
MOZ_ASSERT(clasp->setProperty);
MOZ_ASSERT(clasp->enumerate);
MOZ_ASSERT(clasp->resolve);
MOZ_ASSERT(clasp->convert);
RootedAtom atom(cx, Atomize(cx, clasp->name, strlen(clasp->name)));
if (!atom)
@ -3287,8 +3283,7 @@ LookupPropertyPureInline(ThreadSafeContext *cx, JSObject *obj, jsid id, NativeOb
// if we know it will never add a property with this name.
do {
const Class *clasp = current->getClass();
MOZ_ASSERT(clasp->resolve);
if (clasp->resolve == JS_ResolveStub)
if (!clasp->resolve)
break;
if (clasp->resolve == fun_resolve && !FunctionHasResolveHook(cx->names(), id))
break;
@ -3658,13 +3653,13 @@ JS_EnumerateState(JSContext *cx, HandleObject obj, JSIterateOp enum_op,
/* If the class has a custom JSCLASS_NEW_ENUMERATE hook, call it. */
const Class *clasp = obj->getClass();
JSEnumerateOp enumerate = clasp->enumerate;
if (clasp->flags & JSCLASS_NEW_ENUMERATE) {
MOZ_ASSERT(enumerate != JS_EnumerateStub);
if (enumerate) {
if (clasp->flags & JSCLASS_NEW_ENUMERATE)
return ((JSNewEnumerateOp) enumerate)(cx, obj, enum_op, statep, idp);
}
if (!enumerate(cx, obj))
return false;
}
/* Tell InitNativeIterator to treat us like a native object. */
MOZ_ASSERT(enum_op == JSENUMERATE_INIT || enum_op == JSENUMERATE_INIT_ALL);
@ -4245,7 +4240,7 @@ JSObject::hasIdempotentProtoChain() const
return false;
JSResolveOp resolve = obj->getClass()->resolve;
if (resolve != JS_ResolveStub && resolve != js::fun_resolve)
if (resolve && resolve != js::fun_resolve)
return false;
if (obj->getOps()->lookupProperty || obj->getOps()->lookupGeneric || obj->getOps()->lookupElement)

Просмотреть файл

@ -688,7 +688,7 @@ class JSObject : public js::gc::Cell
{
JSConvertOp op = obj->getClass()->convert;
bool ok;
if (op == JS_ConvertStub)
if (!op)
ok = js::DefaultValue(cx, obj, hint, vp);
else
ok = op(cx, obj, hint, vp);

Просмотреть файл

@ -38,13 +38,10 @@ using mozilla::RangedPtr;
const Class js::JSONClass = {
js_JSON_str,
JSCLASS_HAS_CACHED_PROTO(JSProto_JSON),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
static inline bool

Просмотреть файл

@ -1348,13 +1348,13 @@ const Class ScriptSourceObject::class_ = {
"ScriptSource",
JSCLASS_HAS_RESERVED_SLOTS(RESERVED_SLOTS) |
JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_IS_ANONYMOUS,
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
finalize,
nullptr, /* call */
nullptr, /* hasInstance */

Просмотреть файл

@ -426,13 +426,12 @@ const Class StringObject::class_ = {
js_String_str,
JSCLASS_HAS_RESERVED_SLOTS(StringObject::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_String),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
str_enumerate,
str_resolve,
JS_ConvertStub
str_resolve
};
/*

Просмотреть файл

@ -585,13 +585,13 @@ const Class WeakMapObject::class_ = {
"WeakMap",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_CACHED_PROTO(JSProto_WeakMap),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
WeakMap_finalize,
nullptr, /* call */
nullptr, /* construct */

Просмотреть файл

@ -161,8 +161,8 @@ static void pm_finalize(JSFreeOp* fop, JSObject* obj);
static const JSClass pm_class = {
"PerfMeasurement", JSCLASS_HAS_PRIVATE,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, pm_finalize
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, pm_finalize
};
// Constructor and destructor

Просмотреть файл

@ -1020,13 +1020,13 @@ static const uint32_t CacheEntry_BYTECODE = 1;
static const JSClass CacheEntry_class = {
"CacheEntryObject", JSCLASS_HAS_RESERVED_SLOTS(2),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
@ -2569,10 +2569,10 @@ sandbox_resolve(JSContext *cx, HandleObject obj, HandleId id, bool *resolvedp)
static const JSClass sandbox_class = {
"sandbox",
JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub, JS_DeletePropertyStub,
nullptr, nullptr,
JS_PropertyStub, JS_StrictPropertyStub,
sandbox_enumerate, sandbox_resolve,
JS_ConvertStub, nullptr,
nullptr, nullptr,
nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook
};
@ -3962,13 +3962,10 @@ ObjectEmulatingUndefined(JSContext *cx, unsigned argc, jsval *vp)
static const JSClass cls = {
"ObjectEmulatingUndefined",
JSCLASS_EMULATES_UNDEFINED,
nullptr,
nullptr,
JS_PropertyStub,
JS_DeletePropertyStub,
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub
};
RootedObject obj(cx, JS_NewObject(cx, &cls, JS::NullPtr(), JS::NullPtr()));
@ -4785,10 +4782,10 @@ global_resolve(JSContext *cx, HandleObject obj, HandleId id, bool *resolvedp)
static const JSClass global_class = {
"global", JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub, JS_DeletePropertyStub,
nullptr, nullptr,
JS_PropertyStub, JS_StrictPropertyStub,
global_enumerate, global_resolve,
JS_ConvertStub, nullptr,
nullptr, nullptr,
nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook
};
@ -4902,13 +4899,13 @@ static const JSFunctionSpec dom_methods[] = {
static const JSClass dom_class = {
"FakeDOMObject", JSCLASS_IS_DOMJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(2),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */

Просмотреть файл

@ -570,13 +570,13 @@ const Class NormalArgumentsObject::class_ = {
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(NormalArgumentsObject::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_Object) | JSCLASS_BACKGROUND_FINALIZE,
JS_PropertyStub, /* addProperty */
nullptr, /* addProperty */
args_delProperty,
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
args_enumerate,
args_resolve,
JS_ConvertStub,
nullptr, /* convert */
ArgumentsObject::finalize,
nullptr, /* call */
nullptr, /* hasInstance */
@ -594,13 +594,13 @@ const Class StrictArgumentsObject::class_ = {
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(StrictArgumentsObject::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_Object) | JSCLASS_BACKGROUND_FINALIZE,
JS_PropertyStub, /* addProperty */
nullptr, /* addProperty */
args_delProperty,
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
strictargs_enumerate,
strictargs_resolve,
JS_ConvertStub,
nullptr, /* convert */
ArgumentsObject::finalize,
nullptr, /* call */
nullptr, /* hasInstance */

Просмотреть файл

@ -95,13 +95,10 @@ js::ToClampedIndex(JSContext *cx, HandleValue v, uint32_t length, uint32_t *out)
const Class ArrayBufferObject::protoClass = {
"ArrayBufferPrototype",
JSCLASS_HAS_CACHED_PROTO(JSProto_ArrayBuffer),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
const Class ArrayBufferObject::class_ = {
@ -110,13 +107,13 @@ const Class ArrayBufferObject::class_ = {
JSCLASS_HAS_RESERVED_SLOTS(RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_ArrayBuffer) |
JSCLASS_BACKGROUND_FINALIZE,
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
ArrayBufferObject::finalize,
nullptr, /* call */
nullptr, /* hasInstance */

Просмотреть файл

@ -2348,8 +2348,8 @@ const Class Debugger::jsclass = {
"Debugger",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUG_COUNT),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Debugger::finalize,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, Debugger::finalize,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
@ -3828,8 +3828,8 @@ const Class DebuggerScript_class = {
"Script",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGSCRIPT_COUNT),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nullptr,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
@ -4782,8 +4782,8 @@ const Class DebuggerSource_class = {
"Source",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGSOURCE_COUNT),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nullptr,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
@ -5128,8 +5128,8 @@ DebuggerFrame_finalize(FreeOp *fop, JSObject *obj)
const Class DebuggerFrame_class = {
"Frame", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGFRAME_COUNT),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, DebuggerFrame_finalize
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, DebuggerFrame_finalize
};
static NativeObject *
@ -5347,8 +5347,7 @@ DebuggerFrame_getOlder(JSContext *cx, unsigned argc, Value *vp)
const Class DebuggerArguments_class = {
"Arguments", JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGARGUMENTS_COUNT),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
/* The getter used for each element of frame.arguments. See DebuggerFrame_getArguments. */
@ -5861,8 +5860,8 @@ const Class DebuggerObject_class = {
"Object",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGOBJECT_COUNT),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nullptr,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
@ -6769,8 +6768,8 @@ const Class DebuggerEnv_class = {
"Environment",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGENV_COUNT),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, nullptr,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */

Просмотреть файл

@ -72,13 +72,10 @@ DebuggerMemory::construct(JSContext *cx, unsigned argc, Value *vp)
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_COUNT),
JS_PropertyStub, // addProperty
JS_DeletePropertyStub, // delProperty
nullptr, // addProperty
nullptr, // delProperty
JS_PropertyStub, // getProperty
JS_StrictPropertyStub, // setProperty
JS_EnumerateStub, // enumerate
JS_ResolveStub, // resolve
JS_ConvertStub, // convert
JS_StrictPropertyStub // setProperty
};
/* static */ DebuggerMemory *

Просмотреть файл

@ -203,35 +203,19 @@ LegacyGeneratorObject::close(JSContext *cx, HandleObject obj)
const Class LegacyGeneratorObject::class_ = {
"Generator",
JSCLASS_HAS_RESERVED_SLOTS(GeneratorObject::RESERVED_SLOTS),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
JS_StrictPropertyStub /* setProperty */
};
const Class StarGeneratorObject::class_ = {
"Generator",
JSCLASS_HAS_RESERVED_SLOTS(GeneratorObject::RESERVED_SLOTS),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
JS_StrictPropertyStub /* setProperty */
};
static const JSFunctionSpec star_generator_methods[] = {

Просмотреть файл

@ -462,8 +462,8 @@ GlobalDebuggees_finalize(FreeOp *fop, JSObject *obj)
static const Class
GlobalDebuggees_class = {
"GlobalDebuggee", JSCLASS_HAS_PRIVATE,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, GlobalDebuggees_finalize
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, GlobalDebuggees_finalize
};
GlobalObject::DebuggerVector *

Просмотреть файл

@ -176,10 +176,9 @@ js::CancelOffThreadIonCompile(JSCompartment *compartment, JSScript *script)
static const JSClass parseTaskGlobalClass = {
"internal-parse-task-global", JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub, JS_DeletePropertyStub,
nullptr, nullptr,
JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub,
JS_ConvertStub, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook
};

Просмотреть файл

@ -142,8 +142,7 @@ static const uint32_t JSSLOT_SAVED_ID = 1;
static const Class js_NoSuchMethodClass = {
"NoSuchMethod",
JSCLASS_HAS_RESERVED_SLOTS(2) | JSCLASS_IS_ANONYMOUS,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
/*

Просмотреть файл

@ -566,7 +566,7 @@ LookupOwnPropertyInline(ExclusiveContext *cx,
}
// id was not found in obj. Try obj's resolve hook, if any.
if (obj->getClass()->resolve != JS_ResolveStub) {
if (obj->getClass()->resolve) {
if (!cx->shouldBeJSContext() || !allowGC)
return false;

Просмотреть файл

@ -1075,7 +1075,9 @@ CallAddPropertyHook(typename ExecutionModeTraits<mode>::ExclusiveContextType cxA
const Class *clasp, HandleNativeObject obj, HandleShape shape,
HandleValue nominal)
{
if (clasp->addProperty != JS_PropertyStub) {
if (clasp->addProperty) {
MOZ_ASSERT(clasp->addProperty != JS_PropertyStub);
if (mode == ParallelExecution)
return false;
@ -1122,7 +1124,9 @@ CallAddPropertyHookDense(typename ExecutionModeTraits<mode>::ExclusiveContextTyp
return true;
}
if (clasp->addProperty != JS_PropertyStub) {
if (clasp->addProperty) {
MOZ_ASSERT(clasp->addProperty != JS_PropertyStub);
if (mode == ParallelExecution)
return false;

Просмотреть файл

@ -302,8 +302,8 @@ ForOfPIC_traceObject(JSTracer *trc, JSObject *obj)
const Class ForOfPIC::jsclass = {
"ForOfPIC", JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, ForOfPIC_finalize,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, ForOfPIC_finalize,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */

Просмотреть файл

@ -266,13 +266,13 @@ const Class RegExpObject::class_ = {
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(RegExpObject::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_RegExp),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub, /* enumerate */
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */

Просмотреть файл

@ -38,13 +38,13 @@ resc_trace(JSTracer *trc, JSObject *obj)
const Class RegExpStaticsObject::class_ = {
"RegExpStatics",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS,
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
resc_finalize,
nullptr, /* call */
nullptr, /* hasInstance */

Просмотреть файл

@ -141,14 +141,13 @@ SavedFrame::HashPolicy::rekey(Key &key, const Key &newKey)
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(SavedFrame::JSSLOT_COUNT),
JS_PropertyStub, // addProperty
JS_DeletePropertyStub, // delProperty
nullptr, // addProperty
nullptr, // delProperty
JS_PropertyStub, // getProperty
JS_StrictPropertyStub, // setProperty
JS_EnumerateStub, // enumerate
JS_ResolveStub, // resolve
JS_ConvertStub, // convert
nullptr, // enumerate
nullptr, // resolve
nullptr, // convert
SavedFrame::finalize // finalize
};

Просмотреть файл

@ -292,26 +292,20 @@ CallObject::createForStrictEval(JSContext *cx, AbstractFramePtr frame)
const Class CallObject::class_ = {
"Call",
JSCLASS_IS_ANONYMOUS | JSCLASS_HAS_RESERVED_SLOTS(CallObject::RESERVED_SLOTS),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
nullptr /* convert: Leave it nullptr so we notice if calls ever escape */
JS_StrictPropertyStub /* setProperty */
};
const Class DeclEnvObject::class_ = {
js_Object_str,
JSCLASS_HAS_RESERVED_SLOTS(DeclEnvObject::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
/*
@ -588,26 +582,23 @@ const Class StaticWithObject::class_ = {
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(StaticWithObject::RESERVED_SLOTS) |
JSCLASS_IS_ANONYMOUS,
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
const Class DynamicWithObject::class_ = {
"With",
JSCLASS_HAS_RESERVED_SLOTS(DynamicWithObject::RESERVED_SLOTS) |
JSCLASS_IS_ANONYMOUS,
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
@ -745,13 +736,10 @@ const Class BlockObject::class_ = {
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(BlockObject::RESERVED_SLOTS) |
JSCLASS_IS_ANONYMOUS,
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
template<XDRMode mode>
@ -1041,13 +1029,13 @@ const Class UninitializedLexicalObject::class_ = {
"UninitializedLexical",
JSCLASS_HAS_RESERVED_SLOTS(UninitializedLexicalObject::RESERVED_SLOTS) |
JSCLASS_IS_ANONYMOUS,
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */

Просмотреть файл

@ -51,10 +51,9 @@ selfHosting_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *rep
static const JSClass self_hosting_global_class = {
"self-hosting-global", JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub, JS_DeletePropertyStub,
nullptr, nullptr,
JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub,
JS_ConvertStub, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook
};

Просмотреть файл

@ -300,13 +300,10 @@ SharedArrayBufferObject::addSizeOfExcludingThis(JSObject *obj, mozilla::MallocSi
const Class SharedArrayBufferObject::protoClass = {
"SharedArrayBufferPrototype",
JSCLASS_HAS_CACHED_PROTO(JSProto_SharedArrayBuffer),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
const Class SharedArrayBufferObject::class_ = {
@ -314,13 +311,13 @@ const Class SharedArrayBufferObject::class_ = {
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(SharedArrayBufferObject::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_SharedArrayBuffer),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
SharedArrayBufferObject::Finalize,
nullptr, /* call */
nullptr, /* hasInstance */

Просмотреть файл

@ -704,13 +704,13 @@ IMPL_SHARED_TYPED_ARRAY_COMBINED_UNWRAPPERS(Float64, double, double)
JSCLASS_HAS_RESERVED_SLOTS(SharedTypedArrayObject::RESERVED_SLOTS) | \
JSCLASS_HAS_PRIVATE | \
JSCLASS_HAS_CACHED_PROTO(JSProto_Shared##_typedArray), \
JS_PropertyStub, /* addProperty */ \
JS_DeletePropertyStub, /* delProperty */ \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, /* getProperty */ \
JS_StrictPropertyStub, /* setProperty */ \
JS_EnumerateStub, \
JS_ResolveStub, \
JS_ConvertStub, \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \
nullptr, /* finalize */ \
nullptr, /* call */ \
nullptr, /* hasInstance */ \
@ -725,13 +725,13 @@ IMPL_SHARED_TYPED_ARRAY_COMBINED_UNWRAPPERS(Float64, double, double)
JSCLASS_HAS_RESERVED_SLOTS(SharedTypedArrayObject::RESERVED_SLOTS) | \
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS | \
JSCLASS_HAS_CACHED_PROTO(JSProto_Shared##_typedArray), \
JS_PropertyStub, /* addProperty */ \
JS_DeletePropertyStub, /* delProperty */ \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, /* getProperty */ \
JS_StrictPropertyStub, /* setProperty */ \
JS_EnumerateStub, \
JS_ResolveStub, \
JS_ConvertStub, \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \
nullptr, /* finalize */ \
nullptr, /* call */ \
nullptr, /* hasInstance */ \

Просмотреть файл

@ -804,13 +804,13 @@ TypedArrayObject::sharedTypedArrayPrototypeClass = {
// until we implement @@toStringTag.
"???",
JSCLASS_HAS_CACHED_PROTO(JSProto_TypedArray),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
@ -1759,13 +1759,13 @@ IMPL_TYPED_ARRAY_COMBINED_UNWRAPPERS(Float64, double, double)
JSCLASS_HAS_RESERVED_SLOTS(TypedArrayLayout::RESERVED_SLOTS) | \
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS | \
JSCLASS_HAS_CACHED_PROTO(JSProto_##_typedArray), \
JS_PropertyStub, /* addProperty */ \
JS_DeletePropertyStub, /* delProperty */ \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, /* getProperty */ \
JS_StrictPropertyStub, /* setProperty */ \
JS_EnumerateStub, \
JS_ResolveStub, \
JS_ConvertStub, \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \
nullptr, /* finalize */ \
nullptr, /* call */ \
nullptr, /* hasInstance */ \
@ -1804,13 +1804,13 @@ const Class TypedArrayObject::classes[Scalar::TypeMax] = {
*/ \
#typedArray "Prototype", \
JSCLASS_HAS_CACHED_PROTO(JSProto_##typedArray), \
JS_PropertyStub, /* addProperty */ \
JS_DeletePropertyStub, /* delProperty */ \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, /* getProperty */ \
JS_StrictPropertyStub, /* setProperty */ \
JS_EnumerateStub, \
JS_ResolveStub, \
JS_ConvertStub, \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \
nullptr, /* finalize */ \
nullptr, /* call */ \
nullptr, /* hasInstance */ \
@ -1850,13 +1850,10 @@ const Class DataViewObject::protoClass = {
JSCLASS_HAS_PRIVATE |
JSCLASS_HAS_RESERVED_SLOTS(TypedArrayLayout::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_DataView),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub /* setProperty */
};
const Class DataViewObject::class_ = {
@ -1865,18 +1862,18 @@ const Class DataViewObject::class_ = {
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(TypedArrayLayout::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_DataView),
JS_PropertyStub, /* addProperty */
JS_DeletePropertyStub, /* delProperty */
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
ArrayBufferViewObject::trace, /* trace */
ArrayBufferViewObject::trace
};
const JSFunctionSpec DataViewObject::jsfuncs[] = {

Просмотреть файл

@ -57,13 +57,10 @@ static const JSClass kFakeBackstagePassJSClass =
{
"FakeBackstagePass",
0,
nullptr,
nullptr,
JS_PropertyStub,
JS_DeletePropertyStub,
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub
JS_StrictPropertyStub
};
static const char kXPConnectServiceContractID[] = "@mozilla.org/js/xpc/XPConnect;1";

Просмотреть файл

@ -343,7 +343,7 @@ sandbox_convert(JSContext *cx, HandleObject obj, JSType type, MutableHandleValue
return true;
}
return JS_ConvertStub(cx, obj, type, vp);
return JS::OrdinaryToPrimitive(cx, obj, type, vp);
}
static bool
@ -459,7 +459,7 @@ sandbox_addProperty(JSContext *cx, HandleObject obj, HandleId id, MutableHandleV
static const js::Class SandboxClass = {
"Sandbox",
XPCONNECT_GLOBAL_FLAGS_WITH_EXTRA_SLOTS(1),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
sandbox_enumerate, sandbox_resolve, sandbox_convert, sandbox_finalize,
nullptr, nullptr, nullptr, JS_GlobalObjectTraceHook,
JS_NULL_CLASS_SPEC,
@ -478,7 +478,7 @@ static const js::Class SandboxClass = {
static const js::Class SandboxWriteToProtoClass = {
"Sandbox",
XPCONNECT_GLOBAL_FLAGS_WITH_EXTRA_SLOTS(1),
sandbox_addProperty, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
sandbox_addProperty, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
sandbox_enumerate, sandbox_resolve, sandbox_convert, sandbox_finalize,
nullptr, nullptr, nullptr, JS_GlobalObjectTraceHook,
JS_NULL_CLASS_SPEC,

Просмотреть файл

@ -772,10 +772,9 @@ env_resolve(JSContext *cx, HandleObject obj, HandleId id, bool *resolvedp)
static const JSClass env_class = {
"environment", JSCLASS_HAS_PRIVATE,
JS_PropertyStub, JS_DeletePropertyStub,
nullptr, nullptr,
JS_PropertyStub, env_setProperty,
env_enumerate, env_resolve,
JS_ConvertStub, nullptr
env_enumerate, env_resolve
};
/***************************************************************************/

Просмотреть файл

@ -1425,13 +1425,13 @@ FinalizeStub(JSFreeOp *fop, JSObject *obj)
static const JSClass XPCOutParamClass = {
"XPCOutParam",
0,
JS_PropertyStub,
JS_DeletePropertyStub,
nullptr,
nullptr,
JS_PropertyStub,
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
FinalizeStub,
nullptr, /* call */
nullptr, /* hasInstance */

Просмотреть файл

@ -804,11 +804,8 @@ XPCWrappedNative::Init(HandleObject parent,
MOZ_ASSERT(jsclazz &&
jsclazz->name &&
jsclazz->flags &&
jsclazz->addProperty &&
jsclazz->delProperty &&
jsclazz->getProperty &&
jsclazz->setProperty &&
jsclazz->enumerate &&
jsclazz->resolve &&
jsclazz->convert &&
jsclazz->finalize, "bad class");

Просмотреть файл

@ -1101,7 +1101,7 @@ XPCNativeScriptableShared::PopulateJSClass()
if (mFlags.WantAddProperty())
addProperty = XPC_WN_Helper_AddProperty;
else if (mFlags.UseJSStubForAddProperty())
addProperty = JS_PropertyStub;
addProperty = nullptr;
else if (mFlags.AllowPropModsDuringResolve())
addProperty = XPC_WN_MaybeResolvingPropertyStub;
else
@ -1112,7 +1112,7 @@ XPCNativeScriptableShared::PopulateJSClass()
if (mFlags.WantDelProperty())
delProperty = XPC_WN_Helper_DelProperty;
else if (mFlags.UseJSStubForDelProperty())
delProperty = JS_DeletePropertyStub;
delProperty = nullptr;
else if (mFlags.AllowPropModsDuringResolve())
delProperty = XPC_WN_MaybeResolvingDeletePropertyStub;
else
@ -1139,7 +1139,7 @@ XPCNativeScriptableShared::PopulateJSClass()
if (mFlags.WantNewEnumerate() || mFlags.WantEnumerate() ||
mFlags.DontEnumStaticProps())
mJSClass.base.enumerate = JS_EnumerateStub;
mJSClass.base.enumerate = nullptr;
else
mJSClass.base.enumerate = XPC_WN_Shared_Enumerate;
@ -1392,14 +1392,14 @@ const js::Class XPC_WN_ModsAllowed_WithCall_Proto_JSClass = {
"XPC_WN_ModsAllowed_WithCall_Proto_JSClass", // name;
WRAPPER_SLOTS, // flags;
/* Mandatory non-null function pointer members. */
JS_PropertyStub, // addProperty;
JS_DeletePropertyStub, // delProperty;
/* Function pointer members. */
nullptr, // addProperty;
nullptr, // delProperty;
JS_PropertyStub, // getProperty;
JS_StrictPropertyStub, // setProperty;
XPC_WN_Shared_Proto_Enumerate, // enumerate;
XPC_WN_ModsAllowed_Proto_Resolve, // resolve;
JS_ConvertStub, // convert;
nullptr, // convert;
XPC_WN_Shared_Proto_Finalize, // finalize;
/* Optionally non-null members start here. */
@ -1417,14 +1417,14 @@ const js::Class XPC_WN_ModsAllowed_NoCall_Proto_JSClass = {
"XPC_WN_ModsAllowed_NoCall_Proto_JSClass", // name;
WRAPPER_SLOTS, // flags;
/* Mandatory non-null function pointer members. */
JS_PropertyStub, // addProperty;
JS_DeletePropertyStub, // delProperty;
/* Function pointer members. */
nullptr, // addProperty;
nullptr, // delProperty;
JS_PropertyStub, // getProperty;
JS_StrictPropertyStub, // setProperty;
XPC_WN_Shared_Proto_Enumerate, // enumerate;
XPC_WN_ModsAllowed_Proto_Resolve, // resolve;
JS_ConvertStub, // convert;
nullptr, // convert;
XPC_WN_Shared_Proto_Finalize, // finalize;
/* Optionally non-null members start here. */
@ -1511,7 +1511,7 @@ const js::Class XPC_WN_NoMods_WithCall_Proto_JSClass = {
XPC_WN_OnlyIWrite_Proto_SetPropertyStub, // setProperty;
XPC_WN_Shared_Proto_Enumerate, // enumerate;
XPC_WN_NoMods_Proto_Resolve, // resolve;
JS_ConvertStub, // convert;
nullptr, // convert;
XPC_WN_Shared_Proto_Finalize, // finalize;
/* Optionally non-null members start here. */
@ -1536,7 +1536,7 @@ const js::Class XPC_WN_NoMods_NoCall_Proto_JSClass = {
XPC_WN_OnlyIWrite_Proto_SetPropertyStub, // setProperty;
XPC_WN_Shared_Proto_Enumerate, // enumerate;
XPC_WN_NoMods_Proto_Resolve, // resolve;
JS_ConvertStub, // convert;
nullptr, // convert;
XPC_WN_Shared_Proto_Finalize, // finalize;
/* Optionally non-null members start here. */

Просмотреть файл

@ -145,17 +145,13 @@ XPCWrappedNativeXrayTraits::getWN(JSObject *wrapper)
const JSClass XPCWrappedNativeXrayTraits::HolderClass = {
"NativePropertyHolder", JSCLASS_HAS_RESERVED_SLOTS(2),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub,
JS_StrictPropertyStub, JS_EnumerateStub, JS_ResolveStub,
JS_ConvertStub
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
const JSClass JSXrayTraits::HolderClass = {
"JSXrayHolder", JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT),
JS_PropertyStub, JS_DeletePropertyStub,
JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
bool
@ -851,8 +847,8 @@ ExpandoObjectFinalize(JSFreeOp *fop, JSObject *obj)
const JSClass ExpandoObjectClass = {
"XrayExpandoObject",
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_EXPANDO_COUNT),
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, ExpandoObjectFinalize
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, ExpandoObjectFinalize
};
bool

Просмотреть файл

@ -603,8 +603,8 @@ private:
const JSClass JSRuntimeWrapper::sGlobalClass = {
"PACResolutionThreadGlobal",
JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook
};

Просмотреть файл

@ -115,13 +115,13 @@ void Finalize(JSFreeOp *fop, JSObject *objSelf)
static const JSClass sWitnessClass = {
"FinalizationWitness",
JSCLASS_HAS_RESERVED_SLOTS(WITNESS_INSTANCES_SLOTS),
JS_PropertyStub /* addProperty */,
JS_DeletePropertyStub /* delProperty */,
nullptr /* addProperty */,
nullptr /* delProperty */,
JS_PropertyStub /* getProperty */,
JS_StrictPropertyStub /* setProperty */,
JS_EnumerateStub /* enumerate */,
JS_ResolveStub /* resolve */,
JS_ConvertStub /* convert */,
nullptr /* enumerate */,
nullptr /* resolve */,
nullptr /* convert */,
Finalize /* finalize */
};

Просмотреть файл

@ -1268,8 +1268,7 @@ WrapAndReturnHistogram(Histogram *h, JSContext *cx, JS::MutableHandle<JS::Value>
static const JSClass JSHistogram_class = {
"JSHistogram", /* name */
JSCLASS_HAS_PRIVATE, /* flags */
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
JS::Rooted<JSObject*> obj(cx, JS_NewObject(cx, &JSHistogram_class, JS::NullPtr(), JS::NullPtr()));
@ -1446,8 +1445,7 @@ WrapAndReturnKeyedHistogram(KeyedHistogram *h, JSContext *cx, JS::MutableHandle<
static const JSClass JSHistogram_class = {
"JSKeyedHistogram", /* name */
JSCLASS_HAS_PRIVATE, /* flags */
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
};
JS::Rooted<JSObject*> obj(cx, JS_NewObject(cx, &JSHistogram_class, JS::NullPtr(), JS::NullPtr()));

Просмотреть файл

@ -90,9 +90,9 @@ CreateGlobalAndRunTest(JSRuntime* rt, JSContext* cx)
{
static const JSClass GlobalClass = {
"global", JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook
};