bug 736978 - remove JS_FinalizeStub. r=:billm

Currently the GC finalizes on the background thread only objects with null
JSClass::finalize. However, this implies that any object that uses
JS_FinalizeStub for the finalizer would be prevented from the background
finalization.

To fix this the patch removes JS_FinalizeStub replacing it with NULL in all
cases when the class has no custom finalizer. For style consistency the patch
also removed the usage of JSCLASS_NO_OPTIONAL_MEMBERS in the static
declarations as the compiler fills the missing fields with null in any cases.
This commit is contained in:
Igor Bukanov 2012-03-19 15:27:58 +01:00
parent c4c35f6884
commit 877dee50e1
32 changed files with 67 additions and 120 deletions

View File

@ -516,8 +516,7 @@ JSClass gDummyPropClass = {
JS_PropertyStub, JS_PropertyStub,
JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub,
JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_ConvertStub
};
} // anonymous namespace
@ -2476,7 +2475,7 @@ JSClass ThreadLocalJSRuntime::sGlobalClass = {
"IndexedDBTransactionThreadGlobal",
JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
};
CreateIndexHelper::CreateIndexHelper(IDBTransaction* aTransaction,

View File

@ -59,8 +59,7 @@ namespace {
JSClass _varname = { \
_name, 0, \
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, \
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub, \
JSCLASS_NO_OPTIONAL_MEMBERS \
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub \
};
DECL_EVENTTARGET_CLASS(gClass, "EventTarget")

View File

@ -365,8 +365,7 @@ private:
_name, \
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT), \
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, \
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize, \
JSCLASS_NO_OPTIONAL_MEMBERS \
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize \
};
DECL_EVENT_CLASS(Event::sClass, "Event")
@ -618,8 +617,7 @@ private:
_name, \
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT), \
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, \
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize, \
JSCLASS_NO_OPTIONAL_MEMBERS \
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize \
};
DECL_MESSAGEEVENT_CLASS(MessageEvent::sClass, "MessageEvent")
@ -804,8 +802,7 @@ private:
_name, \
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT), \
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub, \
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize, \
JSCLASS_NO_OPTIONAL_MEMBERS \
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize \
};
DECL_ERROREVENT_CLASS(ErrorEvent::sClass, "ErrorEvent")
@ -984,8 +981,7 @@ JSClass ProgressEvent::sClass = {
"ProgressEvent",
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT),
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize
};
JSPropertySpec ProgressEvent::sProperties[] = {

View File

@ -186,8 +186,7 @@ JSClass DOMException::sClass = {
"DOMException",
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT),
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize
};
JSPropertySpec DOMException::sProperties[] = {
@ -358,8 +357,7 @@ JSClass FileException::sClass = {
"FileException",
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT),
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize
};
JSPropertySpec FileException::sProperties[] = {

View File

@ -219,8 +219,7 @@ JSClass Blob::sClass = {
"Blob",
JSCLASS_HAS_PRIVATE,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize
};
JSPropertySpec Blob::sProperties[] = {
@ -370,8 +369,7 @@ JSClass File::sClass = {
"File",
JSCLASS_HAS_PRIVATE,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize
};
JSPropertySpec File::sProperties[] = {

View File

@ -343,8 +343,7 @@ JSClass FileReaderSync::sClass = {
"FileReaderSync",
JSCLASS_HAS_PRIVATE,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize
};
JSFunctionSpec FileReaderSync::sFunctions[] = {

View File

@ -183,8 +183,7 @@ JSClass Location::sClass = {
"WorkerLocation",
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT),
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize
};
JSPropertySpec Location::sProperties[] = {

View File

@ -172,8 +172,7 @@ JSClass Navigator::sClass = {
"WorkerNavigator",
JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(SLOT_COUNT),
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Finalize
};
JSPropertySpec Navigator::sProperties[] = {

View File

@ -592,8 +592,7 @@ JSClass WorkerGlobalScope::sClass = {
"WorkerGlobalScope",
0,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
};
JSPropertySpec WorkerGlobalScope::sProperties[] = {

View File

@ -155,7 +155,7 @@ JSClass global_class = {
JS_PropertyStub, JS_PropertyStub,
JS_PropertyStub, JS_PropertyStub,
global_enumerate, (JSResolveOp) global_resolve,
JS_ConvertStub, JS_FinalizeStub
JS_ConvertStub
};
SkJS::SkJS(void* hwnd) : SkOSWindow(hwnd) {

View File

@ -430,8 +430,7 @@ static const JSClass sCPOW_NewEnumerateState_JSClass = {
JS_PropertyStub, JS_PropertyStub,
JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub,
JS_ConvertStub, CPOW_NewEnumerateState_Finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_ConvertStub, CPOW_NewEnumerateState_Finalize
};
bool

View File

@ -72,8 +72,7 @@ void JSD_ASSERT_VALID_CONTEXT(JSDContext* jsdc)
static JSClass global_class = {
"JSDGlobal", JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
};
static JSBool

View File

@ -220,16 +220,14 @@ static JSClass sCTypesGlobalClass = {
"ctypes",
JSCLASS_HAS_RESERVED_SLOTS(CTYPESGLOBAL_SLOTS),
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
};
static JSClass sCABIClass = {
"CABI",
JSCLASS_HAS_RESERVED_SLOTS(CABI_SLOTS),
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
};
// Class representing ctypes.{C,Pointer,Array,Struct,Function}Type.prototype.
@ -249,8 +247,7 @@ static JSClass sCDataProtoClass = {
"CData",
0,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
};
static JSClass sCTypeClass = {
@ -393,32 +390,28 @@ static JSClass sInt64ProtoClass = {
"Int64",
0,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
};
static JSClass sUInt64ProtoClass = {
"UInt64",
0,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
};
static JSClass sInt64Class = {
"Int64",
JSCLASS_HAS_RESERVED_SLOTS(INT64_SLOTS),
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Int64Base::Finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Int64Base::Finalize
};
static JSClass sUInt64Class = {
"UInt64",
JSCLASS_HAS_RESERVED_SLOTS(INT64_SLOTS),
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Int64Base::Finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, Int64Base::Finalize
};
static JSFunctionSpec sInt64StaticFunctions[] = {

View File

@ -67,8 +67,7 @@ static JSClass sLibraryClass = {
"Library",
JSCLASS_HAS_RESERVED_SLOTS(LIBRARY_SLOTS),
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub,JS_ResolveStub, JS_ConvertStub, Library::Finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub,JS_ResolveStub, JS_ConvertStub, Library::Finalize
};
#define CTYPESFN_FLAGS \

View File

@ -13,9 +13,7 @@ JSClass global_class = {
JS_StrictPropertyStub,
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_ConvertStub
};
JS::Anchor<JSObject *> trusted_glob, trusted_fun;

View File

@ -35,9 +35,7 @@ static JSClass ptestClass = {
JS_StrictPropertyStub, // set
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_ConvertStub
};
static JSBool test_fn(JSContext *cx, unsigned argc, jsval *vp)

View File

@ -59,8 +59,7 @@ document_resolve(JSContext *cx, JSObject *obj, jsid id, unsigned flags, JSObject
static JSClass document_class = {
"document", JSCLASS_NEW_RESOLVE,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, (JSResolveOp) document_resolve, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, (JSResolveOp) document_resolve, JS_ConvertStub
};
BEGIN_TEST(testLookup_bug570195)

View File

@ -18,8 +18,7 @@ static JSClass myClass = {
"MyClass",
0,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, my_convert, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, my_convert
};
static JSBool

View File

@ -17,8 +17,7 @@ static JSClass CounterClass = {
"Counter", /* name */
0, /* flags */
CounterAdd, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
};
BEGIN_TEST(testPropCache_bug505798)

View File

@ -21,9 +21,7 @@ BEGIN_TEST(testResolveRecursion)
JS_StrictPropertyStub, // set
JS_EnumerateStub,
(JSResolveOp) my_resolve,
JS_ConvertStub,
JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_ConvertStub
};
obj1 = JS_NewObject(cx, &my_resolve_class, NULL, NULL);

View File

@ -305,8 +305,7 @@ class JSAPITest
static JSClass c = {
"global", JSCLASS_GLOBAL_FLAGS,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
};
return &c;
}

View File

@ -3087,10 +3087,6 @@ JS_ConvertStub(JSContext *cx, JSObject *obj, JSType type, jsval *vp)
return DefaultValue(cx, obj, type, vp);
}
JS_PUBLIC_API(void)
JS_FinalizeStub(JSContext *cx, JSObject *obj)
{}
JS_PUBLIC_API(JSObject *)
JS_InitClass(JSContext *cx, JSObject *obj, JSObject *parent_proto,
JSClass *clasp, JSNative constructor, unsigned nargs,

View File

@ -3609,9 +3609,6 @@ JS_ResolveStub(JSContext *cx, JSObject *obj, jsid id);
extern JS_PUBLIC_API(JSBool)
JS_ConvertStub(JSContext *cx, JSObject *obj, JSType type, jsval *vp);
extern JS_PUBLIC_API(void)
JS_FinalizeStub(JSContext *cx, JSObject *obj);
struct JSConstDoubleSpec {
double dval;
const char *name;

View File

@ -274,7 +274,11 @@ ArrayBuffer::create(JSContext *cx, int32_t nbytes, uint8_t *contents)
JSObject *obj = NewBuiltinClassInstance(cx, &ArrayBuffer::slowClass);
if (!obj)
return NULL;
#ifdef JS_THREADSAFE
JS_ASSERT(obj->getAllocKind() == gc::FINALIZE_OBJECT16_BACKGROUND);
#else
JS_ASSERT(obj->getAllocKind() == gc::FINALIZE_OBJECT16);
#endif
if (nbytes < 0) {
/*
@ -1439,7 +1443,11 @@ class TypedArrayTemplate
JSObject *obj = NewBuiltinClassInstance(cx, slowClass());
if (!obj)
return NULL;
#ifdef JS_THREADSAFE
JS_ASSERT(obj->getAllocKind() == gc::FINALIZE_OBJECT8_BACKGROUND);
#else
JS_ASSERT(obj->getAllocKind() == gc::FINALIZE_OBJECT8);
#endif
/*
* Specialize the type of the object on the current scripted location,
@ -2176,8 +2184,7 @@ Class ArrayBuffer::slowClass = {
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
JS_FinalizeStub
JS_ConvertStub
};
Class js::ArrayBufferClass = {
@ -2292,8 +2299,7 @@ JSFunctionSpec _typedArray::jsfuncs[] = { \
JS_StrictPropertyStub, /* setProperty */ \
JS_EnumerateStub, \
JS_ResolveStub, \
JS_ConvertStub, \
JS_FinalizeStub \
JS_ConvertStub \
}
#define IMPL_TYPED_ARRAY_FAST_CLASS(_typedArray) \

View File

@ -232,12 +232,12 @@ JS_FRIEND_DATA(Class) js::NamespaceClass = {
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
JS_FinalizeStub,
NULL, /* finalize */
NULL, /* checkAccess */
NULL, /* call */
NULL, /* construct */
NULL, /* hasInstance */
NULL, /* mark */
NULL, /* trace */
{
namespace_equality,
NULL, /* outerObject */
@ -346,12 +346,12 @@ JS_FRIEND_DATA(Class) js::QNameClass = {
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
JS_FinalizeStub,
NULL, /* finalize */
NULL, /* checkAccess */
NULL, /* call */
NULL, /* construct */
NULL, /* hasInstance */
NULL, /* mark */
NULL, /* trace */
{
qname_equality,
NULL, /* outerObject */
@ -377,8 +377,7 @@ JS_FRIEND_DATA(Class) js::AttributeNameClass = {
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
JS_FinalizeStub
JS_ConvertStub
};
JS_FRIEND_DATA(Class) js::AnyNameClass = {
@ -391,8 +390,7 @@ JS_FRIEND_DATA(Class) js::AnyNameClass = {
JS_StrictPropertyStub, /* setProperty */
JS_EnumerateStub,
JS_ResolveStub,
JS_ConvertStub,
JS_FinalizeStub
JS_ConvertStub
};
#define QNAME_ATTRS (JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED)
@ -4721,11 +4719,6 @@ HasProperty(JSContext *cx, JSObject *obj, jsval id, JSBool *found)
return JS_TRUE;
}
static void
xml_finalize(JSContext *cx, JSObject *obj)
{
}
/*
* XML objects are native. Thus xml_lookupGeneric must return a valid
* Shape pointer parameter via *propp to signify "property found". Since the
@ -5376,7 +5369,7 @@ JS_FRIEND_DATA(Class) js::XMLClass = {
JS_EnumerateStub,
JS_ResolveStub,
xml_convert,
xml_finalize,
NULL, /* finalize */
NULL, /* checkAccess */
NULL, /* call */
NULL, /* construct */

View File

@ -219,8 +219,7 @@ static const struct pm_const {
static JSClass pm_class = {
"PerfMeasurement", JSCLASS_HAS_PRIVATE,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, pm_finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, pm_finalize
};
// Helpers (declared above)

View File

@ -2594,8 +2594,7 @@ static JSClass sandbox_class = {
JS_PropertyStub, JS_PropertyStub,
JS_PropertyStub, JS_StrictPropertyStub,
sandbox_enumerate, (JSResolveOp)sandbox_resolve,
JS_ConvertStub, NULL,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_ConvertStub
};
static JSObject *
@ -2855,8 +2854,7 @@ static JSClass resolver_class = {
JS_PropertyStub, JS_PropertyStub,
JS_PropertyStub, JS_StrictPropertyStub,
resolver_enumerate, (JSResolveOp)resolver_resolve,
JS_ConvertStub, NULL,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_ConvertStub
};
@ -3280,8 +3278,7 @@ Compile(JSContext *cx, unsigned argc, jsval *vp)
JS_PropertyStub, JS_PropertyStub,
JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub,
JS_ConvertStub, NULL,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_ConvertStub
};
JSObject *fakeGlobal = JS_NewGlobalObject(cx, &dummy_class);
@ -4112,8 +4109,7 @@ static JSClass its_class = {
"It", JSCLASS_NEW_RESOLVE | JSCLASS_NEW_ENUMERATE | JSCLASS_HAS_PRIVATE,
its_addProperty, its_delProperty, its_getProperty, its_setProperty,
(JSEnumerateOp)its_enumerate, (JSResolveOp)its_resolve,
its_convert, its_finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
its_convert, its_finalize
};
static JSBool
@ -4406,8 +4402,7 @@ JSClass global_class = {
JS_PropertyStub, JS_PropertyStub,
JS_PropertyStub, JS_StrictPropertyStub,
global_enumerate, (JSResolveOp) global_resolve,
JS_ConvertStub, its_finalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_ConvertStub, its_finalize
};
static JSBool
@ -4520,8 +4515,7 @@ static JSClass env_class = {
JS_PropertyStub, JS_PropertyStub,
JS_PropertyStub, env_setProperty,
env_enumerate, (JSResolveOp) env_resolve,
JS_ConvertStub, NULL,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_ConvertStub
};
/*

View File

@ -175,8 +175,7 @@ static JSClass
PointerHolderClass = {
"Pointer", JSCLASS_HAS_PRIVATE,
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, PointerFinalize,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, PointerFinalize
};
template<typename Op>

View File

@ -452,7 +452,7 @@ listTemplate = (
" JS_EnumerateStub,\n"
" JS_ResolveStub,\n"
" JS_ConvertStub,\n"
" JS_FinalizeStub,\n"
" NULL, /* finalize */\n"
" NULL, /* checkAccess */\n"
" NULL, /* call */\n"
" NULL, /* construct */\n"

View File

@ -109,8 +109,7 @@ JSClass HolderClass = {
"NativePropertyHolder",
JSCLASS_HAS_RESERVED_SLOTS(3),
JS_PropertyStub, JS_PropertyStub, holder_get, holder_set,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
};
}

View File

@ -418,8 +418,7 @@ int main(int argc, char** argv)
JS_PropertyStub, JS_PropertyStub,
JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub,
JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_ConvertStub
};
JSObject *glob = nsnull;
if (use_js)

View File

@ -454,8 +454,7 @@ WrapAndReturnHistogram(Histogram *h, JSContext *cx, jsval *ret)
"JSHistogram", /* name */
JSCLASS_HAS_PRIVATE, /* flags */
JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
JSCLASS_NO_OPTIONAL_MEMBERS
JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub
};
JSObject *obj = JS_NewObject(cx, &JSHistogram_class, NULL, NULL);