@@ -126,7 +126,7 @@ NPObjWrapper_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMut
126126
127127static JSBool
128128NPObjWrapper_newEnumerate (JSContext *cx, JSHandleObject obj, JSIterateOp enum_op,
129- jsval *statep, jsid *idp);
129+ JS ::Value *statep, jsid *idp);
130130
131131static JSBool
132132NPObjWrapper_NewResolve (JSContext *cx, JSHandleObject obj, JSHandleId id, unsigned flags,
@@ -139,14 +139,14 @@ static void
139139NPObjWrapper_Finalize (JSFreeOp *fop, JSObject *obj);
140140
141141static JSBool
142- NPObjWrapper_Call (JSContext *cx, unsigned argc, jsval *vp);
142+ NPObjWrapper_Call (JSContext *cx, unsigned argc, JS ::Value *vp);
143143
144144static JSBool
145- NPObjWrapper_Construct (JSContext *cx, unsigned argc, jsval *vp);
145+ NPObjWrapper_Construct (JSContext *cx, unsigned argc, JS ::Value *vp);
146146
147147static JSBool
148148CreateNPObjectMember (NPP npp, JSContext *cx, JSObject *obj, NPObject *npobj,
149- jsid id, NPVariant* getPropertyResult, jsval *vp);
149+ jsid id, NPVariant* getPropertyResult, JS ::Value *vp);
150150
151151JSClass sNPObjectJSWrapperClass =
152152 {
@@ -168,7 +168,7 @@ JSClass sNPObjectJSWrapperClass =
168168
169169typedef struct NPObjectMemberPrivate {
170170 JSObject *npobjWrapper;
171- jsval fieldValue;
171+ JS ::Value fieldValue;
172172 NPIdentifier methodName;
173173 NPP npp;
174174} NPObjectMemberPrivate;
@@ -180,7 +180,7 @@ static void
180180NPObjectMember_Finalize (JSFreeOp *fop, JSObject *obj);
181181
182182static JSBool
183- NPObjectMember_Call (JSContext *cx, unsigned argc, jsval *vp);
183+ NPObjectMember_Call (JSContext *cx, unsigned argc, JS ::Value *vp);
184184
185185static void
186186NPObjectMember_Trace (JSTracer *trc, JSObject *obj);
@@ -348,7 +348,7 @@ static NPP
348348LookupNPP (NPObject *npobj);
349349
350350
351- static jsval
351+ static JS ::Value
352352NPVariantToJSVal (NPP npp, JSContext *cx, const NPVariant *variant)
353353{
354354 switch (variant->type ) {
@@ -361,7 +361,7 @@ NPVariantToJSVal(NPP npp, JSContext *cx, const NPVariant *variant)
361361 case NPVariantType_Int32 :
362362 {
363363 // Don't use INT_TO_JSVAL directly to prevent bugs when dealing
364- // with ints larger than what fits in a integer jsval .
364+ // with ints larger than what fits in a integer JS::Value .
365365 return ::JS_NumberValue (NPVARIANT_TO_INT32 (*variant));
366366 }
367367 case NPVariantType_Double :
@@ -409,7 +409,7 @@ NPVariantToJSVal(NPP npp, JSContext *cx, const NPVariant *variant)
409409}
410410
411411bool
412- JSValToNPVariant (NPP npp, JSContext *cx, jsval val, NPVariant *variant)
412+ JSValToNPVariant (NPP npp, JSContext *cx, JS ::Value val, NPVariant *variant)
413413{
414414 NS_ASSERTION (npp, " Must have an NPP to wrap a jsval!" );
415415
@@ -587,7 +587,7 @@ nsJSObjWrapper::NP_Invalidate(NPObject *npobj)
587587}
588588
589589static JSBool
590- GetProperty (JSContext *cx, JSObject *obj, NPIdentifier id, jsval *rval)
590+ GetProperty (JSContext *cx, JSObject *obj, NPIdentifier id, JS ::Value *rval)
591591{
592592 NS_ASSERTION (NPIdentifierIsInt(id) || NPIdentifierIsString(id),
593593 "id must be either string or int!\n");
@@ -620,7 +620,7 @@ nsJSObjWrapper::NP_HasMethod(NPObject *npobj, NPIdentifier id)
620620
621621 AutoJSExceptionReporter reporter (cx);
622622
623- jsval v;
623+ JS ::Value v;
624624 JSBool ok = GetProperty (cx, npjsobj->mJSObj , id, &v);
625625
626626 return ok && !JSVAL_IS_PRIMITIVE (v) &&
@@ -648,7 +648,7 @@ doInvoke(NPObject *npobj, NPIdentifier method, const NPVariant *args,
648648 VOID_TO_NPVARIANT (*result);
649649
650650 nsJSObjWrapper *npjsobj = (nsJSObjWrapper *)npobj;
651- jsval fv;
651+ JS ::Value fv;
652652
653653 AutoCXPusher pusher (cx);
654654 JSAutoRequest ar (cx);
@@ -665,21 +665,21 @@ doInvoke(NPObject *npobj, NPIdentifier method, const NPVariant *args,
665665 fv = OBJECT_TO_JSVAL (npjsobj->mJSObj );
666666 }
667667
668- jsval jsargs_buf[8 ];
669- jsval *jsargs = jsargs_buf;
668+ JS ::Value jsargs_buf[8 ];
669+ JS ::Value *jsargs = jsargs_buf;
670670
671- if (argCount > (sizeof (jsargs_buf) / sizeof (jsval ))) {
671+ if (argCount > (sizeof (jsargs_buf) / sizeof (JS ::Value ))) {
672672 // Our stack buffer isn't large enough to hold all arguments,
673673 // malloc a buffer.
674- jsargs = (jsval *)PR_Malloc (argCount * sizeof (jsval ));
674+ jsargs = (JS ::Value *)PR_Malloc (argCount * sizeof (JS ::Value ));
675675 if (!jsargs) {
676676 ::JS_ReportOutOfMemory (cx);
677677
678678 return false ;
679679 }
680680 }
681681
682- jsval v;
682+ JS ::Value v;
683683 JSBool ok;
684684
685685 {
@@ -798,7 +798,7 @@ nsJSObjWrapper::NP_GetProperty(NPObject *npobj, NPIdentifier id,
798798 AutoJSExceptionReporter reporter (cx);
799799 JSAutoCompartment ac (cx, npjsobj->mJSObj );
800800
801- jsval v;
801+ JS ::Value v;
802802 return (GetProperty (cx, npjsobj->mJSObj , id, &v) &&
803803 JSValToNPVariant (npp, cx, v, result));
804804}
@@ -830,7 +830,7 @@ nsJSObjWrapper::NP_SetProperty(NPObject *npobj, NPIdentifier id,
830830 AutoJSExceptionReporter reporter (cx);
831831 JSAutoCompartment ac (cx, npjsobj->mJSObj );
832832
833- jsval v = NPVariantToJSVal (npp, cx, value);
833+ JS ::Value v = NPVariantToJSVal (npp, cx, value);
834834 JS ::AutoValueRooter tvr (cx, v);
835835
836836 NS_ASSERTION (NPIdentifierIsInt(id) || NPIdentifierIsString(id),
@@ -866,7 +866,7 @@ nsJSObjWrapper::NP_RemoveProperty(NPObject *npobj, NPIdentifier id)
866866 AutoCXPusher pusher (cx);
867867 JSAutoRequest ar (cx);
868868 AutoJSExceptionReporter reporter (cx);
869- jsval deleted = JSVAL_FALSE ;
869+ JS ::Value deleted = JSVAL_FALSE ;
870870 JSAutoCompartment ac (cx, npjsobj->mJSObj );
871871
872872 NS_ASSERTION (NPIdentifierIsInt(id) || NPIdentifierIsString(id),
@@ -934,7 +934,7 @@ nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray,
934934 }
935935
936936 for (uint32_t i = 0 ; i < *count; i++) {
937- jsval v;
937+ JS ::Value v;
938938 if (!JS_IdToValue (cx, ida[i], &v)) {
939939 PR_Free (*idarray);
940940 return false ;
@@ -1375,8 +1375,8 @@ NPObjWrapper_GetProperty(JSContext *cx, JSHandleObject obj, JSHandleId id, JSMut
13751375}
13761376
13771377static JSBool
1378- CallNPMethodInternal (JSContext *cx, JSObject *obj, unsigned argc, jsval *argv,
1379- jsval *rval, bool ctorCall)
1378+ CallNPMethodInternal (JSContext *cx, JSObject *obj, unsigned argc,
1379+ JS ::Value *argv, JS ::Value *rval, bool ctorCall)
13801380{
13811381 NPObject *npobj = GetNPObject (cx, obj);
13821382
@@ -1502,7 +1502,7 @@ CallNPMethodInternal(JSContext *cx, JSObject *obj, unsigned argc, jsval *argv,
15021502}
15031503
15041504static JSBool
1505- CallNPMethod (JSContext *cx, unsigned argc, jsval *vp)
1505+ CallNPMethod (JSContext *cx, unsigned argc, JS ::Value *vp)
15061506{
15071507 JSObject *obj = JS_THIS_OBJECT (cx, vp);
15081508 if (!obj)
@@ -1519,7 +1519,7 @@ struct NPObjectEnumerateState {
15191519
15201520static JSBool
15211521NPObjWrapper_newEnumerate (JSContext *cx, JSHandleObject obj, JSIterateOp enum_op,
1522- jsval *statep, jsid *idp)
1522+ JS ::Value *statep, jsid *idp)
15231523{
15241524 NPObject *npobj = GetNPObject (cx, obj);
15251525 NPIdentifier *enum_value;
@@ -1667,7 +1667,7 @@ NPObjWrapper_Convert(JSContext *cx, JSHandleObject obj, JSType hint, JSMutableHa
16671667 // poorly when called with no arguments. We work around this problem by
16681668 // giving plugins a [[DefaultValue]] which uses only toString and not valueOf.
16691669
1670- jsval v = JSVAL_VOID ;
1670+ JS ::Value v = JSVAL_VOID ;
16711671 if (!JS_GetProperty (cx, obj, " toString" , &v))
16721672 return false ;
16731673 if (!JSVAL_IS_PRIMITIVE (v) && JS_ObjectIsCallable (cx, JSVAL_TO_OBJECT (v))) {
@@ -1703,14 +1703,14 @@ NPObjWrapper_Finalize(JSFreeOp *fop, JSObject *obj)
17031703}
17041704
17051705static JSBool
1706- NPObjWrapper_Call (JSContext *cx, unsigned argc, jsval *vp)
1706+ NPObjWrapper_Call (JSContext *cx, unsigned argc, JS ::Value *vp)
17071707{
17081708 return CallNPMethodInternal (cx, JSVAL_TO_OBJECT (JS_CALLEE (cx, vp)), argc,
17091709 JS_ARGV (cx, vp), vp, false );
17101710}
17111711
17121712static JSBool
1713- NPObjWrapper_Construct (JSContext *cx, unsigned argc, jsval *vp)
1713+ NPObjWrapper_Construct (JSContext *cx, unsigned argc, JS ::Value *vp)
17141714{
17151715 return CallNPMethodInternal (cx, JSVAL_TO_OBJECT (JS_CALLEE (cx, vp)), argc,
17161716 JS_ARGV (cx, vp), vp, true );
@@ -2014,7 +2014,7 @@ LookupNPP(NPObject *npobj)
20142014
20152015JSBool
20162016CreateNPObjectMember (NPP npp, JSContext *cx, JSObject *obj, NPObject* npobj,
2017- jsid id, NPVariant* getPropertyResult, jsval *vp)
2017+ jsid id, NPVariant* getPropertyResult, JS ::Value *vp)
20182018{
20192019 NS_ENSURE_TRUE (vp, JS_FALSE );
20202020
@@ -2047,7 +2047,7 @@ CreateNPObjectMember(NPP npp, JSContext *cx, JSObject *obj, NPObject* npobj,
20472047
20482048 NPIdentifier identifier = JSIdToNPIdentifier (id);
20492049
2050- jsval fieldValue;
2050+ JS ::Value fieldValue;
20512051 NPVariant npv;
20522052
20532053 if (getPropertyResult) {
@@ -2135,7 +2135,7 @@ NPObjectMember_Finalize(JSFreeOp *fop, JSObject *obj)
21352135}
21362136
21372137static JSBool
2138- NPObjectMember_Call (JSContext *cx, unsigned argc, jsval *vp)
2138+ NPObjectMember_Call (JSContext *cx, unsigned argc, JS ::Value *vp)
21392139{
21402140 JSObject *memobj = JSVAL_TO_OBJECT (JS_CALLEE (cx, vp));
21412141 NS_ENSURE_TRUE (memobj, JS_FALSE );
@@ -2171,7 +2171,7 @@ NPObjectMember_Call(JSContext *cx, unsigned argc, jsval *vp)
21712171
21722172 // Convert arguments
21732173 uint32_t i;
2174- jsval *argv = JS_ARGV (cx, vp);
2174+ JS ::Value *argv = JS_ARGV (cx, vp);
21752175 for (i = 0 ; i < argc; ++i) {
21762176 if (!JSValToNPVariant (memberPrivate->npp , cx, argv[i], npargs + i)) {
21772177 ThrowJSException (cx, " Error converting jsvals to NPVariants!" );
0 commit comments