Bug 1103368, part 5 - Make Class::getProperty and setProperty nullable instead of needing stub functions. Never store stub functions in JSPropertyDescriptors. r=bhackett.

--HG--
extra : rebase_source : a44070dd6155426ef6026c1575116f90b5fdac0c
extra : amend_source : 8d8fcf05dfd5fdf214a39501663347a6d6b56463
This commit is contained in:
Jason Orendorff 2014-11-22 12:23:39 -06:00
parent 1c534dd02f
commit 92f1bf16c5
89 changed files with 534 additions and 734 deletions

View File

@ -430,8 +430,7 @@ NS_INTERFACE_MAP_END
static const JSClass sDOMConstructorProtoClass = {
"DOM Constructor.prototype", 0,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
"DOM Constructor.prototype", 0
};
@ -2051,8 +2050,7 @@ nsWindowSH::NameStructEnabled(JSContext* aCx, nsGlobalWindow *aWin,
#ifdef USE_CONTROLLERS_SHIM
static const JSClass ControllersShimClass = {
"XULControllers", 0,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
"XULControllers", 0
};
#endif

View File

@ -1198,8 +1198,8 @@ ResolvePrototypeOrConstructor(JSContext* cx, JS::Handle<JSObject*> wrapper,
desc.object().set(wrapper);
desc.setAttributes(attrs);
desc.setGetter(JS_PropertyStub);
desc.setSetter(JS_StrictPropertyStub);
desc.setGetter(nullptr);
desc.setSetter(nullptr);
desc.value().set(JS::ObjectValue(*protoOrIface));
}
return JS_WrapPropertyDescriptor(cx, desc);

View File

@ -435,8 +435,8 @@ class CGDOMJSClass(CGThing):
${flags},
${addProperty}, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
${enumerate}, /* enumerate */
${resolve}, /* resolve */
nullptr, /* convert */
@ -651,8 +651,8 @@ class CGPrototypeJSClass(CGThing):
JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(${slotCount}),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
@ -747,8 +747,8 @@ class CGInterfaceObjectJSClass(CGThing):
JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(${slotCount}),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */

View File

@ -14075,8 +14075,8 @@ const JSClass CreateIndexOp::ThreadLocalJSRuntime::kGlobalClass = {
JSCLASS_GLOBAL_FLAGS,
/* addProperty */ nullptr,
/* delProperty */ nullptr,
/* getProperty */ JS_PropertyStub,
/* setProperty */ JS_StrictPropertyStub,
/* getProperty */ nullptr,
/* setProperty */ nullptr,
/* enumerate */ nullptr,
/* resolve */ nullptr,
/* convert */ nullptr,

View File

@ -842,11 +842,7 @@ ClearStructuredCloneBuffer(JSAutoStructuredCloneBuffer& aBuffer)
const JSClass IDBObjectStore::sDummyPropJSClass = {
"IDBObjectStore Dummy",
0 /* flags */,
nullptr /* addProperty */,
nullptr /* delProperty */,
JS_PropertyStub /* getProperty */,
JS_StrictPropertyStub /* setProperty */
0 /* flags */
};
IDBObjectStore::IDBObjectStore(IDBTransaction* aTransaction,

View File

@ -229,9 +229,8 @@ NPObjectMember_Trace(JSTracer *trc, JSObject *obj);
static const JSClass sNPObjectMemberClass =
{
"NPObject Ambiguous Member class", JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS,
nullptr, nullptr,
JS_PropertyStub, JS_StrictPropertyStub, nullptr,
nullptr, NPObjectMember_Convert,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, NPObjectMember_Convert,
NPObjectMember_Finalize, NPObjectMember_Call,
nullptr, nullptr, NPObjectMember_Trace
};

View File

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

View File

@ -554,10 +554,8 @@ JavaScriptShared::fromDescriptor(JSContext *cx, Handle<JSPropertyDescriptor> des
return false;
out->getter() = objVar;
} else {
if (desc.getter() == JS_PropertyStub)
out->getter() = 0;
else
out->getter() = UnknownPropertyOp;
MOZ_ASSERT(desc.getter() != JS_PropertyStub);
out->getter() = UnknownPropertyOp;
}
if (!desc.setter()) {
@ -569,10 +567,8 @@ JavaScriptShared::fromDescriptor(JSContext *cx, Handle<JSPropertyDescriptor> des
return false;
out->setter() = objVar;
} else {
if (desc.setter() == JS_StrictPropertyStub)
out->setter() = 0;
else
out->setter() = UnknownPropertyOp;
MOZ_ASSERT(desc.setter() != JS_StrictPropertyStub);
out->setter() = UnknownPropertyOp;
}
return true;

View File

@ -282,7 +282,7 @@ typedef void
const char *name; \
uint32_t flags; \
\
/* Mandatory function pointer members. */ \
/* Function pointer members (may be null). */ \
JSPropertyOp addProperty; \
JSDeletePropertyOp delProperty; \
JSPropertyOp getProperty; \
@ -290,8 +290,6 @@ typedef void
JSEnumerateOp enumerate; \
JSResolveOp resolve; \
JSConvertOp convert; \
\
/* Optional members (may be null). */ \
FinalizeOpType finalize; \
JSNative call; \
JSHasInstanceOp hasInstance; \

View File

@ -924,17 +924,17 @@ const Class AsmJSModuleObject::class_ = {
"AsmJSModuleObject",
JSCLASS_IS_ANONYMOUS | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(AsmJSModuleObject::RESERVED_SLOTS),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
AsmJSModuleObject_finalize,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
AsmJSModuleObject_trace
};

View File

@ -145,11 +145,7 @@ 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_StrictPropertyStub
JSCLASS_HAS_CACHED_PROTO(JSProto_Atomics)
};
static bool

View File

@ -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),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
collator_finalize
};
@ -1045,13 +1045,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),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
numberFormat_finalize
};
@ -1502,13 +1502,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),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
dateTimeFormat_finalize
};
@ -1997,11 +1997,7 @@ js::intl_FormatDateTime(JSContext *cx, unsigned argc, Value *vp)
const Class js::IntlClass = {
js_Object_str,
JSCLASS_HAS_CACHED_PROTO(JSProto_Intl),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_CACHED_PROTO(JSProto_Intl)
};
#if JS_HAS_TOSOURCE

View File

@ -868,13 +868,13 @@ const Class MapIteratorObject::class_ = {
"Map Iterator",
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(MapIteratorObject::SlotCount),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
MapIteratorObject::finalize
};
@ -1012,17 +1012,17 @@ const Class MapObject::class_ = {
"Map",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_CACHED_PROTO(JSProto_Map),
nullptr, // addProperty
nullptr, // delProperty
JS_PropertyStub, // getProperty
JS_StrictPropertyStub, // setProperty
nullptr, // enumerate
nullptr, // resolve
nullptr, // convert
nullptr, // addProperty
nullptr, // delProperty
nullptr, // getProperty
nullptr, // setProperty
nullptr, // enumerate
nullptr, // resolve
nullptr, // convert
finalize,
nullptr, // call
nullptr, // hasInstance
nullptr, // construct
nullptr, // call
nullptr, // hasInstance
nullptr, // construct
mark
};
@ -1544,13 +1544,13 @@ const Class SetIteratorObject::class_ = {
"Set Iterator",
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(SetIteratorObject::SlotCount),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
SetIteratorObject::finalize
};
@ -1684,17 +1684,17 @@ const Class SetObject::class_ = {
"Set",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_CACHED_PROTO(JSProto_Set),
nullptr, // addProperty
nullptr, // delProperty
JS_PropertyStub, // getProperty
JS_StrictPropertyStub, // setProperty
nullptr, // enumerate
nullptr, // resolve
nullptr, // convert
nullptr, // addProperty
nullptr, // delProperty
nullptr, // getProperty
nullptr, // setProperty
nullptr, // enumerate
nullptr, // resolve
nullptr, // convert
finalize,
nullptr, // call
nullptr, // hasInstance
nullptr, // construct
nullptr, // call
nullptr, // hasInstance
nullptr, // construct
mark
};

View File

@ -1339,18 +1339,18 @@ FinishObjectClassInit(JSContext *cx, JS::HandleObject ctor, JS::HandleObject pro
const Class PlainObject::class_ = {
js_Object_str,
JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
{
CreateObjectConstructor,
CreateObjectPrototype,

View File

@ -168,18 +168,15 @@ static bool type##SignMask(JSContext *cx, unsigned argc, Value *vp) { \
const Class SimdTypeDescr::class_ = {
"SIMD",
JSCLASS_HAS_RESERVED_SLOTS(JS_DESCR_SLOTS) | JSCLASS_BACKGROUND_FINALIZE,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
TypeDescr::finalize,
call,
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr
call
};
// These classes just exist to group together various properties and so on.
@ -354,11 +351,7 @@ SimdTypeDescr::call(JSContext *cx, unsigned argc, Value *vp)
const Class SIMDObject::class_ = {
"SIMD",
JSCLASS_HAS_CACHED_PROTO(JSProto_SIMD),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_CACHED_PROTO(JSProto_SIMD)
};
JSObject *

View File

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

View File

@ -941,11 +941,7 @@ OOMAfterAllocations(JSContext *cx, unsigned argc, jsval *vp)
#endif
static const js::Class FakePromiseClass = {
"Promise", JSCLASS_IS_ANONYMOUS,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
"Promise", JSCLASS_IS_ANONYMOUS
};
static bool
@ -991,13 +987,13 @@ finalize_counter_finalize(JSFreeOp *fop, JSObject *obj)
static const JSClass FinalizeCounterClass = {
"FinalizeCounter", JSCLASS_IS_ANONYMOUS,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
finalize_counter_finalize
};
@ -1533,21 +1529,14 @@ class CloneBufferObject : public NativeObject {
const Class CloneBufferObject::class_ = {
"CloneBuffer", JSCLASS_HAS_RESERVED_SLOTS(CloneBufferObject::NUM_SLOTS),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
Finalize,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
JS_NULL_CLASS_SPEC,
JS_NULL_CLASS_EXT,
JS_NULL_OBJECT_OPS
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
Finalize
};
const JSPropertySpec CloneBufferObject::props_[] = {

View File

@ -36,11 +36,7 @@ using namespace js;
const Class js::TypedObjectModuleObject::class_ = {
"TypedObject",
JSCLASS_HAS_RESERVED_SLOTS(SlotCount) |
JSCLASS_HAS_CACHED_PROTO(JSProto_TypedObject),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_CACHED_PROTO(JSProto_TypedObject)
};
static const JSFunctionSpec TypedObjectMethods[] = {
@ -206,11 +202,7 @@ GetPrototype(JSContext *cx, HandleObject obj)
const Class js::TypedProto::class_ = {
"TypedProto",
JSCLASS_HAS_RESERVED_SLOTS(JS_TYPROTO_SLOTS),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_RESERVED_SLOTS(JS_TYPROTO_SLOTS)
};
/***************************************************************************
@ -225,13 +217,13 @@ const Class js::TypedProto::class_ = {
const Class js::ScalarTypeDescr::class_ = {
"Scalar",
JSCLASS_HAS_RESERVED_SLOTS(JS_DESCR_SLOTS) | JSCLASS_BACKGROUND_FINALIZE,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
TypeDescr::finalize,
ScalarTypeDescr::call
};
@ -322,13 +314,13 @@ ScalarTypeDescr::call(JSContext *cx, unsigned argc, Value *vp)
const Class js::ReferenceTypeDescr::class_ = {
"Reference",
JSCLASS_HAS_RESERVED_SLOTS(JS_DESCR_SLOTS) | JSCLASS_BACKGROUND_FINALIZE,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
TypeDescr::finalize,
ReferenceTypeDescr::call
};
@ -501,18 +493,17 @@ CreatePrototypeObjectForComplexTypeInstance(JSContext *cx,
const Class ArrayTypeDescr::class_ = {
"ArrayType",
JSCLASS_HAS_RESERVED_SLOTS(JS_DESCR_SLOTS) | JSCLASS_BACKGROUND_FINALIZE,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub,
JS_StrictPropertyStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
TypeDescr::finalize,
nullptr,
nullptr,
TypedObject::construct,
nullptr
nullptr, /* call */
nullptr, /* hasInstance */
TypedObject::construct
};
const JSPropertySpec ArrayMetaTypeDescr::typeObjectProperties[] = {
@ -731,16 +722,15 @@ const Class StructTypeDescr::class_ = {
JSCLASS_HAS_RESERVED_SLOTS(JS_DESCR_SLOTS) | JSCLASS_BACKGROUND_FINALIZE,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub,
JS_StrictPropertyStub,
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
TypeDescr::finalize,
nullptr, /* call */
nullptr, /* hasInstance */
TypedObject::construct,
nullptr /* trace */
TypedObject::construct
};
const JSPropertySpec StructMetaTypeDescr::typeObjectProperties[] = {
@ -2413,8 +2403,8 @@ LazyArrayBufferTable::sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf)
Class::NON_NATIVE | JSCLASS_IMPLEMENTS_BARRIERS, \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, \
JS_StrictPropertyStub, \
nullptr, /* getProperty */ \
nullptr, /* setProperty */ \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \

View File

@ -24,11 +24,7 @@ using namespace js;
const Class WeakSetObject::class_ = {
"WeakSet",
JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_CACHED_PROTO(JSProto_WeakSet) |
JSCLASS_HAS_RESERVED_SLOTS(WeakSetObject::RESERVED_SLOTS),
nullptr, // addProperty
nullptr, // delProperty
JS_PropertyStub, // getProperty
JS_StrictPropertyStub // setProperty
JSCLASS_HAS_RESERVED_SLOTS(WeakSetObject::RESERVED_SLOTS)
};
const JSPropertySpec WeakSetObject::properties[] = {

View File

@ -513,14 +513,12 @@ namespace UInt64 {
// JSCTypesCallbacks set of function pointers.
static const JSClass sCTypesGlobalClass = {
"ctypes",
JSCLASS_HAS_RESERVED_SLOTS(CTYPESGLOBAL_SLOTS),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
JSCLASS_HAS_RESERVED_SLOTS(CTYPESGLOBAL_SLOTS)
};
static const JSClass sCABIClass = {
"CABI",
JSCLASS_HAS_RESERVED_SLOTS(CABI_SLOTS),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
JSCLASS_HAS_RESERVED_SLOTS(CABI_SLOTS)
};
// Class representing ctypes.{C,Pointer,Array,Struct,Function}Type.prototype.
@ -529,7 +527,7 @@ static const JSClass sCABIClass = {
static const JSClass sCTypeProtoClass = {
"CType",
JSCLASS_HAS_RESERVED_SLOTS(CTYPEPROTO_SLOTS),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
ConstructAbstract, nullptr, ConstructAbstract
};
@ -538,14 +536,13 @@ static const JSClass sCTypeProtoClass = {
// of CTypes. This exists to give said prototypes a class of "CData".
static const JSClass sCDataProtoClass = {
"CData",
0,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
0
};
static const JSClass sCTypeClass = {
"CType",
JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(CTYPE_SLOTS),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, CType::Finalize,
CType::ConstructData, CType::HasInstance, CType::ConstructData,
CType::Trace
@ -562,7 +559,7 @@ static const JSClass sCDataClass = {
static const JSClass sCClosureClass = {
"CClosure",
JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_HAS_RESERVED_SLOTS(CCLOSURE_SLOTS),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, CClosure::Finalize,
nullptr, nullptr, nullptr, CClosure::Trace
};
@ -572,8 +569,7 @@ static const JSClass sCClosureClass = {
*/
static const JSClass sCDataFinalizerProtoClass = {
"CDataFinalizer",
0,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
0
};
/*
@ -585,8 +581,8 @@ static const JSClass sCDataFinalizerProtoClass = {
static const JSClass sCDataFinalizerClass = {
"CDataFinalizer",
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(CDATAFINALIZER_SLOTS),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, CDataFinalizer::Finalize,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, CDataFinalizer::Finalize
};
@ -760,27 +756,25 @@ static const JSFunctionSpec sFunctionInstanceFunctions[] = {
static const JSClass sInt64ProtoClass = {
"Int64",
0,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
0
};
static const JSClass sUInt64ProtoClass = {
"UInt64",
0,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
0
};
static const JSClass sInt64Class = {
"Int64",
JSCLASS_HAS_RESERVED_SLOTS(INT64_SLOTS),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, Int64Base::Finalize
};
static const JSClass sUInt64Class = {
"UInt64",
JSCLASS_HAS_RESERVED_SLOTS(INT64_SLOTS),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, Int64Base::Finalize
};

View File

@ -34,7 +34,7 @@ typedef Rooted<JSFlatString*> RootedFlatString;
static const JSClass sLibraryClass = {
"Library",
JSCLASS_HAS_RESERVED_SLOTS(LIBRARY_SLOTS),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, Library::Finalize
};

View File

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

View File

@ -542,7 +542,7 @@ IsCacheableNoProperty(JSObject *obj, JSObject *holder, Shape *shape, jsbytecode
// Just because we didn't find the property on the object doesn't mean it
// won't magically appear through various engine hacks:
if (obj->getClass()->getProperty && obj->getClass()->getProperty != JS_PropertyStub)
if (obj->getClass()->getProperty)
return false;
// Don't generate missing property ICs if we skipped a non-native object, as

View File

@ -19,10 +19,7 @@ AddProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::MutableHan
static const JSClass AddPropertyClass = {
"AddPropertyTester",
0,
AddProperty,
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
AddProperty
};
BEGIN_TEST(testAddPropertyHook)

View File

@ -8,11 +8,7 @@ using namespace JS;
static const JSClass CustomClass = {
"CustomClass",
JSCLASS_HAS_RESERVED_SLOTS(1),
nullptr,
nullptr,
JS_PropertyStub,
JS_StrictPropertyStub
JSCLASS_HAS_RESERVED_SLOTS(1)
};
static const uint32_t CUSTOM_SLOT = 0;

View File

@ -13,8 +13,8 @@ static const JSClass global_class = {
JSCLASS_IS_GLOBAL | JSCLASS_GLOBAL_FLAGS,
nullptr,
nullptr,
JS_PropertyStub,
JS_StrictPropertyStub,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,

View File

@ -24,11 +24,10 @@ PTest(JSContext* cx, unsigned argc, jsval *vp);
static const JSClass ptestClass = {
"PTest",
JSCLASS_HAS_PRIVATE,
nullptr, // add
nullptr, // delete
test_prop_get, // get
JS_StrictPropertyStub // set
nullptr, // addProperty
nullptr, // delProperty
test_prop_get,
nullptr // setProperty
};
static bool

View File

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

View File

@ -39,11 +39,7 @@ END_TEST(testLookup_bug522590)
static const JSClass DocumentAllClass = {
"DocumentAll",
JSCLASS_EMULATES_UNDEFINED,
nullptr,
nullptr,
JS_PropertyStub,
JS_StrictPropertyStub
JSCLASS_EMULATES_UNDEFINED
};
bool
@ -80,7 +76,7 @@ document_resolve(JSContext *cx, JS::HandleObject obj, JS::HandleId id, bool *res
static const JSClass document_class = {
"document", 0,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, document_resolve, nullptr
};

View File

@ -96,7 +96,7 @@ BEGIN_TEST(testNewObject_1)
static const JSClass cls = {
"testNewObject_1",
0,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, constructHook
};

View File

@ -6,11 +6,7 @@
static const JSClass ObjectEmulatingUndefinedClass = {
"ObjectEmulatingUndefined",
JSCLASS_EMULATES_UNDEFINED,
nullptr,
nullptr,
JS_PropertyStub,
JS_StrictPropertyStub
JSCLASS_EMULATES_UNDEFINED
};
static bool

View File

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

View File

@ -21,19 +21,19 @@ int BarkWhenTracedClass::finalizeCount;
int BarkWhenTracedClass::traceCount;
const JSClass BarkWhenTracedClass::class_ = {
"BarkWhenTracedClass", 0,
nullptr,
nullptr,
JS_PropertyStub,
JS_StrictPropertyStub,
nullptr,
nullptr,
nullptr,
finalize,
nullptr,
nullptr,
nullptr,
trace
"BarkWhenTracedClass", 0,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
finalize,
nullptr,
nullptr,
nullptr,
trace
};
struct Kennel {

View File

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

View File

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

View File

@ -17,11 +17,11 @@ BEGIN_TEST(testResolveRecursion)
static const JSClass my_resolve_class = {
"MyResolve",
JSCLASS_HAS_PRIVATE,
nullptr, // add
nullptr, // delete
JS_PropertyStub, // get
JS_StrictPropertyStub, // set
nullptr,
nullptr, // add
nullptr, // delete
nullptr, // get
nullptr, // set
nullptr, // enumerate
my_resolve
};

View File

@ -142,18 +142,18 @@ JSObject *newKey()
static const js::Class keyClass = {
"keyWithDelgate",
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(1),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr,
nullptr,
nullptr,
nullptr,
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
JS_NULL_CLASS_SPEC,
{
nullptr,
@ -202,17 +202,17 @@ JSObject *newDelegate()
static const js::Class delegateClass = {
"delegate",
JSCLASS_GLOBAL_FLAGS | JSCLASS_HAS_RESERVED_SLOTS(1),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub,
JS_StrictPropertyStub,
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr,
nullptr,
nullptr,
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
JS_GlobalObjectTraceHook,
JS_NULL_CLASS_SPEC,
{

View File

@ -228,7 +228,7 @@ class JSAPITest
static const JSClass * basicGlobalClass() {
static const JSClass c = {
"global", JSCLASS_GLOBAL_FLAGS,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook

View File

@ -3102,8 +3102,14 @@ class MutablePropertyDescriptorOperations : public PropertyDescriptorOperations<
void setEnumerable() { desc()->attrs |= JSPROP_ENUMERATE; }
void setAttributes(unsigned attrs) { desc()->attrs = attrs; }
void setGetter(JSPropertyOp op) { desc()->getter = op; }
void setSetter(JSStrictPropertyOp op) { desc()->setter = op; }
void setGetter(JSPropertyOp op) {
MOZ_ASSERT(op != JS_PropertyStub);
desc()->getter = op;
}
void setSetter(JSStrictPropertyOp op) {
MOZ_ASSERT(op != JS_StrictPropertyStub);
desc()->setter = op;
}
void setGetterObject(JSObject *obj) { desc()->getter = reinterpret_cast<JSPropertyOp>(obj); }
void setSetterObject(JSObject *obj) { desc()->setter = reinterpret_cast<JSStrictPropertyOp>(obj); }

View File

@ -467,15 +467,8 @@ array_length_setter(JSContext *cx, HandleObject obj, HandleId id, bool strict, M
// chain. Ideally the setter should not have been called, but since
// we're here, do an impression of SetPropertyByDefining.
const Class *clasp = obj->getClass();
JSPropertyOp getter = clasp->getProperty;
if (getter == JS_PropertyStub)
getter = nullptr;
JSStrictPropertyOp setter = clasp->setProperty;
if (setter == JS_StrictPropertyStub)
setter = nullptr;
return JSObject::defineProperty(cx, obj, cx->names().length, vp,
getter, setter, JSPROP_ENUMERATE);
clasp->getProperty, clasp->setProperty, JSPROP_ENUMERATE);
}
Rooted<ArrayObject*> arr(cx, &obj->as<ArrayObject>());
@ -3371,17 +3364,17 @@ const Class ArrayObject::class_ = {
"Array",
JSCLASS_HAS_CACHED_PROTO(JSProto_Array),
array_addProperty,
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
{
GenericCreateConstructor<js_Array, 1, JSFunction::FinalizeKind>,
CreateArrayPrototype,

View File

@ -27,11 +27,7 @@ using namespace js::types;
const Class BooleanObject::class_ = {
"Boolean",
JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Boolean),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Boolean)
};
MOZ_ALWAYS_INLINE bool

View File

@ -340,6 +340,9 @@ CallSetter(JSContext *cx, HandleObject obj, HandleId id, StrictPropertyOp op, un
if (attrs & JSPROP_GETTER)
return js_ReportGetterOnlyAssignment(cx, strict);
if (!op)
return true;
return CallJSPropertyOpSetter(cx, op, obj, id, strict, vp);
}

View File

@ -3020,18 +3020,18 @@ const Class DateObject::class_ = {
js_Date_str,
JSCLASS_HAS_RESERVED_SLOTS(RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_Date),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
date_convert,
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
{
GenericCreateConstructor<js_Date, MAXARGS, JSFunction::FinalizeKind>,
GenericCreatePrototype,

View File

@ -67,8 +67,8 @@ static const JSFunctionSpec exception_methods[] = {
JSCLASS_HAS_RESERVED_SLOTS(ErrorObject::RESERVED_SLOTS), \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, /* getProperty */ \
JS_StrictPropertyStub, /* setProperty */ \
nullptr, /* getProperty */ \
nullptr, /* setProperty */ \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \
@ -97,8 +97,8 @@ ErrorObject::classes[JSEXN_LIMIT] = {
JSCLASS_HAS_RESERVED_SLOTS(ErrorObject::RESERVED_SLOTS),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */

View File

@ -280,15 +280,15 @@ namespace js {
flags, \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, /* getProperty */ \
JS_StrictPropertyStub, /* setProperty */ \
nullptr, /* getProperty */ \
nullptr, /* setProperty */ \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
js::proxy_Convert, \
js::proxy_Finalize, /* finalize */ \
nullptr, /* call */ \
nullptr, /* call */ \
js::proxy_HasInstance, /* hasInstance */ \
nullptr, /* construct */ \
nullptr, /* construct */ \
js::proxy_Trace, /* trace */ \
JS_NULL_CLASS_SPEC, \
ext, \

View File

@ -895,8 +895,8 @@ const Class JSFunction::class_ = {
JSCLASS_HAS_CACHED_PROTO(JSProto_Function),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
fun_enumerate,
js::fun_resolve,
nullptr, /* convert */
@ -2124,10 +2124,8 @@ js::DefineFunction(JSContext *cx, HandleObject obj, HandleId id, Native native,
} else {
gop = obj->getClass()->getProperty;
sop = obj->getClass()->setProperty;
if (gop == JS_PropertyStub)
gop = nullptr;
if (sop == JS_StrictPropertyStub)
sop = nullptr;
MOZ_ASSERT(gop != JS_PropertyStub);
MOZ_ASSERT(sop != JS_StrictPropertyStub);
}
JSFunction::Flags funFlags;

View File

@ -919,18 +919,18 @@ const Class PropertyIteratorObject::class_ = {
JSCLASS_HAS_CACHED_PROTO(JSProto_Iterator) |
JSCLASS_HAS_PRIVATE |
JSCLASS_BACKGROUND_FINALIZE,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
finalize,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
trace,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
trace
};
enum {
@ -943,11 +943,7 @@ enum {
const Class ArrayIteratorObject::class_ = {
"Array Iterator",
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(ArrayIteratorSlotCount),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_RESERVED_SLOTS(ArrayIteratorSlotCount)
};
static const JSFunctionSpec array_iterator_methods[] = {
@ -958,11 +954,7 @@ static const JSFunctionSpec array_iterator_methods[] = {
static const Class StringIteratorPrototypeClass = {
"String Iterator",
JSCLASS_IMPLEMENTS_BARRIERS,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_IMPLEMENTS_BARRIERS
};
enum {
@ -974,11 +966,7 @@ enum {
const Class StringIteratorObject::class_ = {
"String Iterator",
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(StringIteratorSlotCount),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_RESERVED_SLOTS(StringIteratorSlotCount)
};
static const JSFunctionSpec string_iterator_methods[] = {
@ -1305,17 +1293,16 @@ stopiter_hasInstance(JSContext *cx, HandleObject obj, MutableHandleValue v, bool
const Class StopIterationObject::class_ = {
"StopIteration",
JSCLASS_HAS_CACHED_PROTO(JSProto_StopIteration),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
stopiter_hasInstance,
nullptr /* construct */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
stopiter_hasInstance
};
/* static */ bool

View File

@ -78,11 +78,7 @@ MathCache::sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf)
const Class js::MathClass = {
js_Math_str,
JSCLASS_HAS_CACHED_PROTO(JSProto_Math),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_CACHED_PROTO(JSProto_Math)
};
bool

View File

@ -463,11 +463,7 @@ static const JSFunctionSpec number_functions[] = {
const Class NumberObject::class_ = {
js_Number_str,
JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Number),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_HAS_CACHED_PROTO(JSProto_Number)
};
static bool

View File

@ -2595,9 +2595,9 @@ js_InitClass(JSContext *cx, HandleObject obj, JSObject *protoProto_,
RootedObject protoProto(cx, protoProto_);
/* Check function pointer members. */
MOZ_ASSERT(clasp->addProperty != JS_PropertyStub); // (use null instead)
MOZ_ASSERT(clasp->getProperty);
MOZ_ASSERT(clasp->setProperty);
MOZ_ASSERT(clasp->addProperty != JS_PropertyStub);
MOZ_ASSERT(clasp->getProperty != JS_PropertyStub);
MOZ_ASSERT(clasp->setProperty != JS_StrictPropertyStub);
RootedAtom atom(cx, Atomize(cx, clasp->name, strlen(clasp->name)));
if (!atom)
@ -3223,8 +3223,8 @@ js::GetPropertyPure(ThreadSafeContext *cx, JSObject *obj, jsid id, Value *vp)
return false;
if (!shape) {
/* Fail if we have a non-stub class op hooks. */
if (obj->getClass()->getProperty && obj->getClass()->getProperty != JS_PropertyStub)
/* Fail if we have a class getter op. */
if (obj->getClass()->getProperty)
return false;
if (obj->getOps()->getElement)

View File

@ -37,11 +37,7 @@ using mozilla::RangedPtr;
const Class js::JSONClass = {
js_JSON_str,
JSCLASS_HAS_CACHED_PROTO(JSProto_JSON),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_CACHED_PROTO(JSProto_JSON)
};
static inline bool

View File

@ -1348,17 +1348,17 @@ const Class ScriptSourceObject::class_ = {
"ScriptSource",
JSCLASS_HAS_RESERVED_SLOTS(RESERVED_SLOTS) |
JSCLASS_IMPLEMENTS_BARRIERS | JSCLASS_IS_ANONYMOUS,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
finalize,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
trace
};

View File

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

View File

@ -612,17 +612,17 @@ const Class WeakMapObject::class_ = {
"WeakMap",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_CACHED_PROTO(JSProto_WeakMap),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
WeakMap_finalize,
nullptr, /* call */
nullptr, /* construct */
nullptr, /* xdrObject */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
WeakMap_mark
};

View File

@ -161,7 +161,7 @@ static void pm_finalize(JSFreeOp* fop, JSObject* obj);
static const JSClass pm_class = {
"PerfMeasurement", JSCLASS_HAS_PRIVATE,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, pm_finalize
};

View File

@ -56,9 +56,8 @@ BaseProxyHandler::get(JSContext *cx, HandleObject proxy, HandleObject receiver,
vp.setUndefined();
return true;
}
if (!desc.getter() ||
(!desc.hasGetterObject() && desc.getter() == JS_PropertyStub))
{
MOZ_ASSERT(desc.getter() != JS_PropertyStub);
if (!desc.getter()) {
vp.set(desc.value());
return true;
}
@ -118,6 +117,7 @@ BaseProxyHandler::set(JSContext *cx, HandleObject proxy, HandleObject receiver,
// Nonstandard SpiderMonkey special case: setter ops.
StrictPropertyOp setter = ownDesc.setter();
MOZ_ASSERT(setter != JS_StrictPropertyStub);
if (setter && setter != JS_StrictPropertyStub)
return CallSetter(cx, receiver, id, setter, ownDesc.attributes(), strict, vp);
@ -136,13 +136,10 @@ BaseProxyHandler::set(JSContext *cx, HandleObject proxy, HandleObject receiver,
// A very old nonstandard SpiderMonkey extension: default to the Class
// getter and setter ops.
const Class *clasp = receiver->getClass();
PropertyOp getter = clasp->getProperty;
if (getter == JS_PropertyStub)
getter = nullptr;
setter = clasp->setProperty;
if (setter == JS_StrictPropertyStub)
setter = nullptr;
return JSObject::defineGeneric(cx, receiver, id, vp, getter, setter, attrs);
MOZ_ASSERT(clasp->getProperty != JS_PropertyStub);
MOZ_ASSERT(clasp->setProperty != JS_StrictPropertyStub);
return JSObject::defineGeneric(cx, receiver, id, vp,
clasp->getProperty, clasp->setProperty, attrs);
}
// Step 6.
@ -165,6 +162,9 @@ js::SetPropertyIgnoringNamedGetter(JSContext *cx, const BaseProxyHandler *handle
/* The control-flow here differs from ::get() because of the fall-through case below. */
MOZ_ASSERT_IF(descIsOwn, desc.object());
if (desc.object()) {
MOZ_ASSERT(desc.getter() != JS_PropertyStub);
MOZ_ASSERT(desc.setter() != JS_StrictPropertyStub);
// Check for read-only properties.
if (desc.isReadonly()) {
if (strict)
@ -172,8 +172,6 @@ js::SetPropertyIgnoringNamedGetter(JSContext *cx, const BaseProxyHandler *handle
return true;
}
MOZ_ASSERT(desc.getter() != JS_PropertyStub);
MOZ_ASSERT(desc.setter() != JS_StrictPropertyStub);
if (desc.hasSetterObject() || desc.setter()) {
if (!CallSetter(cx, receiver, id, desc.setter(), desc.attributes(), strict, vp))
return false;

View File

@ -339,8 +339,10 @@ Proxy::set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id
Rooted<PropertyDescriptor> desc(cx);
if (!Proxy::getPropertyDescriptor(cx, proxy, id, &desc))
return false;
if (desc.object() && desc.setter() && desc.setter() != JS_StrictPropertyStub)
if (desc.object() && desc.setter()) {
MOZ_ASSERT(desc.setter() != JS_StrictPropertyStub);
return CallSetter(cx, receiver, id, desc.setter(), desc.attributes(), strict, vp);
}
if (desc.isReadonly()) {
return strict ? Throw(cx, id, JSMSG_READ_ONLY) : true;
@ -353,13 +355,10 @@ Proxy::set(JSContext *cx, HandleObject proxy, HandleObject receiver, HandleId id
? JSPROP_IGNORE_ENUMERATE | JSPROP_IGNORE_READONLY | JSPROP_IGNORE_PERMANENT
: JSPROP_ENUMERATE;
const Class *clasp = receiver->getClass();
JSPropertyOp getter = clasp->getProperty;
if (getter == JS_PropertyStub)
getter = nullptr;
JSStrictPropertyOp setter = clasp->setProperty;
if (setter == JS_StrictPropertyStub)
setter = nullptr;
return JSObject::defineGeneric(cx, receiver, id, vp, getter, setter, attrs);
MOZ_ASSERT(clasp->getProperty != JS_PropertyStub);
MOZ_ASSERT(clasp->setProperty != JS_StrictPropertyStub);
return JSObject::defineGeneric(cx, receiver, id, vp, clasp->getProperty, clasp->setProperty,
attrs);
}
bool

View File

@ -1019,20 +1019,7 @@ static const uint32_t CacheEntry_SOURCE = 0;
static const uint32_t CacheEntry_BYTECODE = 1;
static const JSClass CacheEntry_class = {
"CacheEntryObject", JSCLASS_HAS_RESERVED_SLOTS(2),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
JSCLASS_NO_INTERNAL_MEMBERS
"CacheEntryObject", JSCLASS_HAS_RESERVED_SLOTS(2)
};
static bool
@ -2569,8 +2556,7 @@ sandbox_resolve(JSContext *cx, HandleObject obj, HandleId id, bool *resolvedp)
static const JSClass sandbox_class = {
"sandbox",
JSCLASS_GLOBAL_FLAGS,
nullptr, nullptr,
JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
sandbox_enumerate, sandbox_resolve,
nullptr, nullptr,
nullptr, nullptr, nullptr,
@ -3961,11 +3947,7 @@ ObjectEmulatingUndefined(JSContext *cx, unsigned argc, jsval *vp)
static const JSClass cls = {
"ObjectEmulatingUndefined",
JSCLASS_EMULATES_UNDEFINED,
nullptr,
nullptr,
JS_PropertyStub,
JS_StrictPropertyStub
JSCLASS_EMULATES_UNDEFINED
};
RootedObject obj(cx, JS_NewObject(cx, &cls, JS::NullPtr(), JS::NullPtr()));
@ -4782,8 +4764,7 @@ global_resolve(JSContext *cx, HandleObject obj, HandleId id, bool *resolvedp)
static const JSClass global_class = {
"global", JSCLASS_GLOBAL_FLAGS,
nullptr, nullptr,
JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
global_enumerate, global_resolve,
nullptr, nullptr,
nullptr, nullptr, nullptr,
@ -4898,20 +4879,7 @@ static const JSFunctionSpec dom_methods[] = {
};
static const JSClass dom_class = {
"FakeDOMObject", JSCLASS_IS_DOMJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(2),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
JSCLASS_NO_INTERNAL_MEMBERS
"FakeDOMObject", JSCLASS_IS_DOMJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(2)
};
#ifdef DEBUG

View File

@ -570,8 +570,8 @@ const Class NormalArgumentsObject::class_ = {
JSCLASS_HAS_CACHED_PROTO(JSProto_Object) | JSCLASS_BACKGROUND_FINALIZE,
nullptr, /* addProperty */
args_delProperty,
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
args_enumerate,
args_resolve,
nullptr, /* convert */
@ -594,8 +594,8 @@ const Class StrictArgumentsObject::class_ = {
JSCLASS_HAS_CACHED_PROTO(JSProto_Object) | JSCLASS_BACKGROUND_FINALIZE,
nullptr, /* addProperty */
args_delProperty,
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
strictargs_enumerate,
strictargs_resolve,
nullptr, /* convert */

View File

@ -94,11 +94,7 @@ js::ToClampedIndex(JSContext *cx, HandleValue v, uint32_t length, uint32_t *out)
const Class ArrayBufferObject::protoClass = {
"ArrayBufferPrototype",
JSCLASS_HAS_CACHED_PROTO(JSProto_ArrayBuffer),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_CACHED_PROTO(JSProto_ArrayBuffer)
};
const Class ArrayBufferObject::class_ = {
@ -109,8 +105,8 @@ const Class ArrayBufferObject::class_ = {
JSCLASS_BACKGROUND_FINALIZE,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */

View File

@ -2340,7 +2340,7 @@ const Class Debugger::jsclass = {
"Debugger",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUG_COUNT),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, Debugger::finalize,
nullptr, /* call */
nullptr, /* hasInstance */
@ -3815,7 +3815,7 @@ const Class DebuggerScript_class = {
"Script",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGSCRIPT_COUNT),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, /* call */
nullptr, /* hasInstance */
@ -4769,7 +4769,7 @@ const Class DebuggerSource_class = {
"Source",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGSOURCE_COUNT),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, /* call */
nullptr, /* hasInstance */
@ -5115,7 +5115,7 @@ DebuggerFrame_finalize(FreeOp *fop, JSObject *obj)
const Class DebuggerFrame_class = {
"Frame", JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGFRAME_COUNT),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, DebuggerFrame_finalize
};
@ -5333,8 +5333,7 @@ DebuggerFrame_getOlder(JSContext *cx, unsigned argc, Value *vp)
}
const Class DebuggerArguments_class = {
"Arguments", JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGARGUMENTS_COUNT),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
"Arguments", JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGARGUMENTS_COUNT)
};
/* The getter used for each element of frame.arguments. See DebuggerFrame_getArguments. */
@ -5846,7 +5845,7 @@ const Class DebuggerObject_class = {
"Object",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGOBJECT_COUNT),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, /* call */
nullptr, /* hasInstance */
@ -6754,7 +6753,7 @@ const Class DebuggerEnv_class = {
"Environment",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_DEBUGENV_COUNT),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, /* call */
nullptr, /* hasInstance */

View File

@ -70,12 +70,7 @@ DebuggerMemory::construct(JSContext *cx, unsigned argc, Value *vp)
/* static */ const Class DebuggerMemory::class_ = {
"Memory",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_COUNT),
nullptr, // addProperty
nullptr, // delProperty
JS_PropertyStub, // getProperty
JS_StrictPropertyStub // setProperty
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_COUNT)
};
/* static */ DebuggerMemory *

View File

@ -202,20 +202,12 @@ LegacyGeneratorObject::close(JSContext *cx, HandleObject obj)
const Class LegacyGeneratorObject::class_ = {
"Generator",
JSCLASS_HAS_RESERVED_SLOTS(GeneratorObject::RESERVED_SLOTS),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_RESERVED_SLOTS(GeneratorObject::RESERVED_SLOTS)
};
const Class StarGeneratorObject::class_ = {
"Generator",
JSCLASS_HAS_RESERVED_SLOTS(GeneratorObject::RESERVED_SLOTS),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_RESERVED_SLOTS(GeneratorObject::RESERVED_SLOTS)
};
static const JSFunctionSpec star_generator_methods[] = {

View File

@ -460,7 +460,7 @@ GlobalDebuggees_finalize(FreeOp *fop, JSObject *obj)
static const Class
GlobalDebuggees_class = {
"GlobalDebuggee", JSCLASS_HAS_PRIVATE,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, GlobalDebuggees_finalize
};

View File

@ -176,8 +176,7 @@ js::CancelOffThreadIonCompile(JSCompartment *compartment, JSScript *script)
static const JSClass parseTaskGlobalClass = {
"internal-parse-task-global", JSCLASS_GLOBAL_FLAGS,
nullptr, nullptr,
JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook

View File

@ -558,8 +558,8 @@ static MOZ_ALWAYS_INLINE bool
InitElemOperation(JSContext *cx, HandleObject obj, HandleValue idval, HandleValue val)
{
MOZ_ASSERT(!val.isMagic(JS_ELEMENTS_HOLE));
MOZ_ASSERT(obj->getClass()->getProperty == JS_PropertyStub);
MOZ_ASSERT(obj->getClass()->setProperty == JS_StrictPropertyStub);
MOZ_ASSERT(!obj->getClass()->getProperty);
MOZ_ASSERT(!obj->getClass()->setProperty);
RootedId id(cx);
if (!ValueToId<CanGC>(cx, idval, &id))

View File

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

View File

@ -1828,12 +1828,14 @@ GetPropertyHelperInline(JSContext *cx,
vp.setUndefined();
if (!CallJSPropertyOp(cx, obj->getClass()->getProperty,
MaybeRooted<JSObject*, allowGC>::toHandle(obj),
MaybeRooted<jsid, allowGC>::toHandle(id),
MaybeRooted<Value, allowGC>::toMutableHandle(vp)))
{
return false;
if (JSPropertyOp getProperty = obj->getClass()->getProperty) {
if (!CallJSPropertyOp(cx, getProperty,
MaybeRooted<JSObject*, allowGC>::toHandle(obj),
MaybeRooted<jsid, allowGC>::toHandle(id),
MaybeRooted<Value, allowGC>::toMutableHandle(vp)))
{
return false;
}
}
/*
@ -2016,7 +2018,7 @@ SetPropertyByDefining(typename ExecutionModeTraits<mode>::ContextType cxArg,
if (receiver->isDelegate())
return false;
if (clasp->getProperty != JS_PropertyStub || !types::HasTypePropertyId(receiver, id, v))
if (clasp->getProperty || !types::HasTypePropertyId(receiver, id, v))
return false;
} else {
// Purge the property cache of now-shadowed id in receiver's scope chain.
@ -2026,11 +2028,9 @@ SetPropertyByDefining(typename ExecutionModeTraits<mode>::ContextType cxArg,
// Define the new data property.
JSPropertyOp getter = clasp->getProperty;
if (getter == JS_PropertyStub)
getter = nullptr;
JSStrictPropertyOp setter = clasp->setProperty;
if (setter == JS_StrictPropertyStub)
setter = nullptr;
MOZ_ASSERT(getter != JS_PropertyStub);
MOZ_ASSERT(setter != JS_StrictPropertyStub);
if (!receiver->is<NativeObject>()) {
if (mode == ParallelExecution)
return false;

View File

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

View File

@ -264,17 +264,17 @@ const Class RegExpObject::class_ = {
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(RegExpObject::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_RegExp),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
RegExpObject::trace
};

View File

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

View File

@ -140,15 +140,14 @@ SavedFrame::HashPolicy::rekey(Key &key, const Key &newKey)
"SavedFrame",
JSCLASS_HAS_PRIVATE | JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(SavedFrame::JSSLOT_COUNT),
nullptr, // addProperty
nullptr, // delProperty
JS_PropertyStub, // getProperty
JS_StrictPropertyStub, // setProperty
nullptr, // enumerate
nullptr, // resolve
nullptr, // convert
SavedFrame::finalize // finalize
nullptr, // addProperty
nullptr, // delProperty
nullptr, // getProperty
nullptr, // setProperty
nullptr, // enumerate
nullptr, // resolve
nullptr, // convert
SavedFrame::finalize
};
/* static */ void

View File

@ -291,21 +291,13 @@ CallObject::createForStrictEval(JSContext *cx, AbstractFramePtr frame)
const Class CallObject::class_ = {
"Call",
JSCLASS_IS_ANONYMOUS | JSCLASS_HAS_RESERVED_SLOTS(CallObject::RESERVED_SLOTS),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_IS_ANONYMOUS | JSCLASS_HAS_RESERVED_SLOTS(CallObject::RESERVED_SLOTS)
};
const Class DeclEnvObject::class_ = {
js_Object_str,
JSCLASS_HAS_RESERVED_SLOTS(DeclEnvObject::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_Object),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_CACHED_PROTO(JSProto_Object)
};
/*
@ -340,11 +332,9 @@ DeclEnvObject::createTemplateObject(JSContext *cx, HandleFunction fun, gc::Initi
unsigned attrs = JSPROP_ENUMERATE | JSPROP_PERMANENT | JSPROP_READONLY;
JSPropertyOp getter = clasp->getProperty;
if (getter == JS_PropertyStub)
getter = nullptr;
JSStrictPropertyOp setter = clasp->setProperty;
if (setter == JS_StrictPropertyStub)
setter = nullptr;
MOZ_ASSERT(getter != JS_PropertyStub);
MOZ_ASSERT(setter != JS_StrictPropertyStub);
if (!NativeObject::putProperty<SequentialExecution>(cx, obj, id, getter, setter, lambdaSlot(),
attrs, 0)) {
@ -589,29 +579,25 @@ const Class StaticWithObject::class_ = {
"WithTemplate",
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(StaticWithObject::RESERVED_SLOTS) |
JSCLASS_IS_ANONYMOUS,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_IS_ANONYMOUS
};
const Class DynamicWithObject::class_ = {
"With",
JSCLASS_HAS_RESERVED_SLOTS(DynamicWithObject::RESERVED_SLOTS) |
JSCLASS_IS_ANONYMOUS,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
JS_NULL_CLASS_SPEC,
JS_NULL_CLASS_EXT,
{
@ -743,11 +729,7 @@ const Class BlockObject::class_ = {
"Block",
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(BlockObject::RESERVED_SLOTS) |
JSCLASS_IS_ANONYMOUS,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_IS_ANONYMOUS
};
template<XDRMode mode>
@ -1037,18 +1019,18 @@ const Class UninitializedLexicalObject::class_ = {
"UninitializedLexical",
JSCLASS_HAS_RESERVED_SLOTS(UninitializedLexicalObject::RESERVED_SLOTS) |
JSCLASS_IS_ANONYMOUS,
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
JS_NULL_CLASS_SPEC,
JS_NULL_CLASS_EXT,
{

View File

@ -51,8 +51,7 @@ selfHosting_ErrorReporter(JSContext *cx, const char *message, JSErrorReport *rep
static const JSClass self_hosting_global_class = {
"self-hosting-global", JSCLASS_GLOBAL_FLAGS,
nullptr, nullptr,
JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook

View File

@ -96,6 +96,9 @@ Shape::set(JSContext* cx, HandleObject obj, HandleObject receiver, bool strict,
if (attrs & JSPROP_GETTER)
return js_ReportGetterOnlyAssignment(cx, strict);
if (!setterOp())
return true;
RootedId id(cx, propid());
/*

View File

@ -299,11 +299,7 @@ SharedArrayBufferObject::addSizeOfExcludingThis(JSObject *obj, mozilla::MallocSi
const Class SharedArrayBufferObject::protoClass = {
"SharedArrayBufferPrototype",
JSCLASS_HAS_CACHED_PROTO(JSProto_SharedArrayBuffer),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_CACHED_PROTO(JSProto_SharedArrayBuffer)
};
const Class SharedArrayBufferObject::class_ = {
@ -311,18 +307,18 @@ const Class SharedArrayBufferObject::class_ = {
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(SharedArrayBufferObject::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_SharedArrayBuffer),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
SharedArrayBufferObject::Finalize,
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
JS_NULL_CLASS_SPEC,
JS_NULL_CLASS_EXT
};

View File

@ -706,8 +706,8 @@ IMPL_SHARED_TYPED_ARRAY_COMBINED_UNWRAPPERS(Float64, double, double)
JSCLASS_HAS_CACHED_PROTO(JSProto_Shared##_typedArray), \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, /* getProperty */ \
JS_StrictPropertyStub, /* setProperty */ \
nullptr, /* getProperty */ \
nullptr, /* setProperty */ \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \
@ -727,8 +727,8 @@ IMPL_SHARED_TYPED_ARRAY_COMBINED_UNWRAPPERS(Float64, double, double)
JSCLASS_HAS_CACHED_PROTO(JSProto_Shared##_typedArray), \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, /* getProperty */ \
JS_StrictPropertyStub, /* setProperty */ \
nullptr, /* getProperty */ \
nullptr, /* setProperty */ \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \

View File

@ -804,8 +804,8 @@ TypedArrayObject::sharedTypedArrayPrototypeClass = {
JSCLASS_HAS_CACHED_PROTO(JSProto_TypedArray),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
@ -1763,8 +1763,8 @@ IMPL_TYPED_ARRAY_COMBINED_UNWRAPPERS(Float64, double, double)
JSCLASS_HAS_CACHED_PROTO(JSProto_##_typedArray), \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, /* getProperty */ \
JS_StrictPropertyStub, /* setProperty */ \
nullptr, /* getProperty */ \
nullptr, /* setProperty */ \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \
@ -1806,18 +1806,18 @@ const Class TypedArrayObject::classes[Scalar::MaxTypedArrayViewType] = {
*/ \
#typedArray "Prototype", \
JSCLASS_HAS_CACHED_PROTO(JSProto_##typedArray), \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
JS_PropertyStub, /* getProperty */ \
JS_StrictPropertyStub, /* setProperty */ \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \
nullptr, /* finalize */ \
nullptr, /* call */ \
nullptr, /* hasInstance */ \
nullptr, /* construct */ \
nullptr, /* trace */ \
nullptr, /* addProperty */ \
nullptr, /* delProperty */ \
nullptr, /* getProperty */ \
nullptr, /* setProperty */ \
nullptr, /* enumerate */ \
nullptr, /* resolve */ \
nullptr, /* convert */ \
nullptr, /* finalize */ \
nullptr, /* call */ \
nullptr, /* hasInstance */ \
nullptr, /* construct */ \
nullptr, /* trace */ \
{ \
typedArray::createConstructor, \
typedArray::createPrototype, \
@ -1851,11 +1851,7 @@ const Class DataViewObject::protoClass = {
"DataViewPrototype",
JSCLASS_HAS_PRIVATE |
JSCLASS_HAS_RESERVED_SLOTS(TypedArrayLayout::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_DataView),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub /* setProperty */
JSCLASS_HAS_CACHED_PROTO(JSProto_DataView)
};
const Class DataViewObject::class_ = {
@ -1864,17 +1860,17 @@ const Class DataViewObject::class_ = {
JSCLASS_IMPLEMENTS_BARRIERS |
JSCLASS_HAS_RESERVED_SLOTS(TypedArrayLayout::RESERVED_SLOTS) |
JSCLASS_HAS_CACHED_PROTO(JSProto_DataView),
nullptr, /* addProperty */
nullptr, /* delProperty */
JS_PropertyStub, /* getProperty */
JS_StrictPropertyStub, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
ArrayBufferViewObject::trace
};

View File

@ -53,15 +53,7 @@ using namespace JS;
// This JSClass exists to trick silly code that expects toString()ing the
// global in a component scope to return something with "BackstagePass" in it
// to continue working.
static const JSClass kFakeBackstagePassJSClass =
{
"FakeBackstagePass",
0,
nullptr,
nullptr,
JS_PropertyStub,
JS_StrictPropertyStub
};
static const JSClass kFakeBackstagePassJSClass = { "FakeBackstagePass" };
static const char kXPConnectServiceContractID[] = "@mozilla.org/js/xpc/XPConnect;1";
static const char kObserverServiceContractID[] = "@mozilla.org/observer-service;1";

View File

@ -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),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
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, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
sandbox_addProperty, nullptr, nullptr, nullptr,
sandbox_enumerate, sandbox_resolve, sandbox_convert, sandbox_finalize,
nullptr, nullptr, nullptr, JS_GlobalObjectTraceHook,
JS_NULL_CLASS_SPEC,

View File

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

View File

@ -1444,10 +1444,10 @@ FinalizeStub(JSFreeOp *fop, JSObject *obj)
static const JSClass XPCOutParamClass = {
"XPCOutParam",
0,
nullptr,
nullptr,
JS_PropertyStub,
JS_StrictPropertyStub,
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* convert */

View File

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

View File

@ -655,7 +655,7 @@ const XPCWrappedNativeJSClass XPC_WN_NoHelper_JSClass = {
/* Mandatory non-null function pointer members. */
XPC_WN_OnlyIWrite_AddPropertyStub, // addProperty
XPC_WN_CantDeletePropertyStub, // delProperty
JS_PropertyStub, // getProperty
nullptr, // getProperty
XPC_WN_OnlyIWrite_SetPropertyStub, // setProperty
XPC_WN_Shared_Enumerate, // enumerate
@ -1122,13 +1122,13 @@ XPCNativeScriptableShared::PopulateJSClass()
if (mFlags.WantGetProperty())
mJSClass.base.getProperty = XPC_WN_Helper_GetProperty;
else
mJSClass.base.getProperty = JS_PropertyStub;
mJSClass.base.getProperty = nullptr;
JSStrictPropertyOp setProperty;
if (mFlags.WantSetProperty())
setProperty = XPC_WN_Helper_SetProperty;
else if (mFlags.UseJSStubForSetProperty())
setProperty = JS_StrictPropertyStub;
setProperty = nullptr;
else if (mFlags.AllowPropModsDuringResolve())
setProperty = XPC_WN_MaybeResolvingStrictPropertyStub;
else
@ -1395,8 +1395,8 @@ const js::Class XPC_WN_ModsAllowed_WithCall_Proto_JSClass = {
/* Function pointer members. */
nullptr, // addProperty;
nullptr, // delProperty;
JS_PropertyStub, // getProperty;
JS_StrictPropertyStub, // setProperty;
nullptr, // getProperty;
nullptr, // setProperty;
XPC_WN_Shared_Proto_Enumerate, // enumerate;
XPC_WN_ModsAllowed_Proto_Resolve, // resolve;
nullptr, // convert;
@ -1420,8 +1420,8 @@ const js::Class XPC_WN_ModsAllowed_NoCall_Proto_JSClass = {
/* Function pointer members. */
nullptr, // addProperty;
nullptr, // delProperty;
JS_PropertyStub, // getProperty;
JS_StrictPropertyStub, // setProperty;
nullptr, // getProperty;
nullptr, // setProperty;
XPC_WN_Shared_Proto_Enumerate, // enumerate;
XPC_WN_ModsAllowed_Proto_Resolve, // resolve;
nullptr, // convert;
@ -1507,7 +1507,7 @@ const js::Class XPC_WN_NoMods_WithCall_Proto_JSClass = {
/* Mandatory non-null function pointer members. */
XPC_WN_OnlyIWrite_Proto_AddPropertyStub, // addProperty;
XPC_WN_CantDeletePropertyStub, // delProperty;
JS_PropertyStub, // getProperty;
nullptr, // getProperty;
XPC_WN_OnlyIWrite_Proto_SetPropertyStub, // setProperty;
XPC_WN_Shared_Proto_Enumerate, // enumerate;
XPC_WN_NoMods_Proto_Resolve, // resolve;
@ -1532,7 +1532,7 @@ const js::Class XPC_WN_NoMods_NoCall_Proto_JSClass = {
/* Mandatory non-null function pointer members. */
XPC_WN_OnlyIWrite_Proto_AddPropertyStub, // addProperty;
XPC_WN_CantDeletePropertyStub, // delProperty;
JS_PropertyStub, // getProperty;
nullptr, // getProperty;
XPC_WN_OnlyIWrite_Proto_SetPropertyStub, // setProperty;
XPC_WN_Shared_Proto_Enumerate, // enumerate;
XPC_WN_NoMods_Proto_Resolve, // resolve;
@ -1621,7 +1621,7 @@ const js::Class XPC_WN_Tearoff_JSClass = {
XPC_WN_OnlyIWrite_AddPropertyStub, // addProperty;
XPC_WN_CantDeletePropertyStub, // delProperty;
JS_PropertyStub, // getProperty;
nullptr, // getProperty;
XPC_WN_OnlyIWrite_SetPropertyStub, // setProperty;
XPC_WN_TearOff_Enumerate, // enumerate;
XPC_WN_TearOff_Resolve, // resolve;

View File

@ -144,14 +144,12 @@ XPCWrappedNativeXrayTraits::getWN(JSObject *wrapper)
}
const JSClass XPCWrappedNativeXrayTraits::HolderClass = {
"NativePropertyHolder", JSCLASS_HAS_RESERVED_SLOTS(2),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
"NativePropertyHolder", JSCLASS_HAS_RESERVED_SLOTS(2)
};
const JSClass JSXrayTraits::HolderClass = {
"JSXrayHolder", JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub
"JSXrayHolder", JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT)
};
bool
@ -847,7 +845,7 @@ ExpandoObjectFinalize(JSFreeOp *fop, JSObject *obj)
const JSClass ExpandoObjectClass = {
"XrayExpandoObject",
JSCLASS_HAS_RESERVED_SLOTS(JSSLOT_EXPANDO_COUNT),
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, ExpandoObjectFinalize
};
@ -1230,10 +1228,10 @@ XPCWrappedNativeXrayTraits::resolveNativeProperty(JSContext *cx, HandleObject wr
// Without a wrapper the function would live on the prototype. Since we
// don't have one, we have to avoid calling the scriptable helper's
// GetProperty method for this property, so stub out the getter and
// GetProperty method for this property, so null out the getter and
// setter here explicitly.
desc.setGetter(JS_PropertyStub);
desc.setSetter(JS_StrictPropertyStub);
desc.setGetter(nullptr);
desc.setSetter(nullptr);
}
if (!JS_WrapValue(cx, desc.value()) || !JS_WrapValue(cx, &fval))

View File

@ -603,7 +603,7 @@ private:
const JSClass JSRuntimeWrapper::sGlobalClass = {
"PACResolutionThreadGlobal",
JSCLASS_GLOBAL_FLAGS,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook

View File

@ -117,8 +117,8 @@ static const JSClass sWitnessClass = {
JSCLASS_HAS_RESERVED_SLOTS(WITNESS_INSTANCES_SLOTS),
nullptr /* addProperty */,
nullptr /* delProperty */,
JS_PropertyStub /* getProperty */,
JS_StrictPropertyStub /* setProperty */,
nullptr /* getProperty */,
nullptr /* setProperty */,
nullptr /* enumerate */,
nullptr /* resolve */,
nullptr /* convert */,

View File

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

View File

@ -86,7 +86,7 @@ CreateGlobalAndRunTest(JSRuntime* rt, JSContext* cx)
{
static const JSClass GlobalClass = {
"global", JSCLASS_GLOBAL_FLAGS,
nullptr, nullptr, JS_PropertyStub, JS_StrictPropertyStub,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook