#259 JS_ConstructObject is obsoleted and int switch_up



1. According to this page, https://developer.mozilla.org/en-US/docs/SpiderMonkey/JSAPI_Reference/JS_ConstructObject

The JS_ConstructObject method you use in src/scenegraph/vrml_smjs.c and some other places are obsoleted.

Mozilla suggests to use "JS_New" to replace them.

Even if you don't replace it, current code can't be built either, because new JS_ConstructObject has four parameters, but our code only give the first three of them, thus will cause a "too few arguments" error.

2. the "int switch_up" in applications/osmozilla/nsIOsmozilla.idl is werid...because Mozilla doesn't have this type, actually it suggests to use "long"

You can see it here: https://developer.mozilla.org/en-US/docs/XPIDL

Those two bugs make gpac-0.5.0 and svn4178 both can't be compiled against libmozjs185 and xulrunner-15.

That's the version openSUSE 12.2, Ubuntu 12.10, ArchLinux uses unluckily....




  • marguerite

    marguerite - 2012-10-05

    And by the way, the uuid used in nsIOsmozilla.idl is weird too...it will make the build can't process.

    there's a gpac-idl_uuid.patch which changes it to ce32e3ff-36f8-425f-94be-d85b26e634ee and it works.

  • Jean Le Feuvre

    Jean Le Feuvre - 2012-10-14
    • status: open --> open-fixed
  • Jean Le Feuvre

    Jean Le Feuvre - 2012-10-14

    This should now be fixed on SVN, could you please check on your machines ?

  • marguerite

    marguerite - 2012-10-16

    Hi, jeanIf,

    I was so stupid. you use internal includes to solve the problem but I didn't change the specfile which exports -I%{_includedir}/js!

    After removing that line, gpac generated a lot of warnings for vrml_smjs.c but it passed build. now the error is:

    scenegraph/dom_smjs.c:3136:2: error: incompatible type for argument 2 of 'JS_PropertyStub'

    and line 3136 is:

    return SMJS_CALL_PROP_STUB();

    what should I do?

  • marguerite

    marguerite - 2012-10-16



    Index: gpac-0.5.0.svn4192/include/gpac/internal/smjs_api.h

    --- gpac-0.5.0.svn4192.orig/include/gpac/internal/smjs_api.h
    +++ gpac-0.5.0.svn4192/include/gpac/internal/smjs_api.h
    @@ -91,7 +91,7 @@ typedef double jsdouble;
    #define SMJS_FUNC_PROP_SET(func_name) SMJS_DECL_FUNC_PROP_SET(func_name) { JSObject *obj = *(__hobj._); jsid id = *(__hid._);
    #define SMJS_DECL_FUNC_PROP_GET(func_name) JSBool func_name(JSContext *c, JSHandleObject __hobj, JSHandleId __hid, jsval *vp)
    #define SMJS_FUNC_PROP_GET(func_name) SMJS_DECL_FUNC_PROP_GET( func_name ) { JSObject *obj = *(__hobj._); jsid id = *(__hid._);
    -#define SMJS_CALL_PROP_STUB() JS_PropertyStub(c, __hobj, __hid, vp)
    +#define SMJS_CALL_PROP_STUB() JS_PropertyStub(c, obj, id, vp)
    #define DECL_FINALIZE(func_name) void func_name(JSFreeOp *fop, JSObject *obj) { void *c = NULL;


  • marguerite

    marguerite - 2012-10-16
    • status: open-fixed --> closed-fixed
  • marguerite

    marguerite - 2012-10-17

    sorry...I'm over optimistic...

    my last patch just fix openSUSE tumbleweed builds. but 12.1, 12.2 and Factory who has the same version as tumbleweed( js 1.8.5) can pass build.

    so I got my hands dirty and gain nothing. I think I'd better let professions do their jobs instead pointing here or there.


  • Jean Le Feuvre

    Jean Le Feuvre - 2012-10-17

    Thanks for the patch, I'll try to look at this issue


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks