RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Per Øyvind Karlsen Root: /v/rpm/cvs Email: [email protected] Module: rpm Date: 02-Apr-2011 04:04:24 Branch: rpm-5_4 Handle: 2011040202042201 Modified files: (Branch: rpm-5_4) rpm CHANGES configure.ac rpm/js Makefile.am rpmaug-js.c rpmjs-debug.h Log: rpmjs: port to SpiderMonkey 1.8.5 API. Summary: Revision Changes Path 1.3501.2.92 +1 -0 rpm/CHANGES 2.472.2.12 +4 -4 rpm/configure.ac 1.44.2.1 +1 -1 rpm/js/Makefile.am 1.11.4.1 +22 -16 rpm/js/rpmaug-js.c 1.7.4.1 +4 -4 rpm/js/rpmjs-debug.h ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.3501.2.91 -r1.3501.2.92 CHANGES --- rpm/CHANGES 1 Apr 2011 09:52:56 -0000 1.3501.2.91 +++ rpm/CHANGES 2 Apr 2011 02:04:22 -0000 1.3501.2.92 @@ -1,4 +1,5 @@ 5.4.0 -> 5.4.1: + - proyvind: rpmjs: port to SpiderMonkey 1.8.5 API. - proyvind: mandriva: filter overlapping depencies. - proyvind: rubygems.rb: add/provide ruby(abi) dependencies for non-gems. - proyvind: rpmfc: add classifiers for gstreamer plugins & dep generator. @@ . patch -p0 <<'@@ .' Index: rpm/configure.ac ============================================================================ $ cvs diff -u -r2.472.2.11 -r2.472.2.12 configure.ac --- rpm/configure.ac 1 Apr 2011 05:16:19 -0000 2.472.2.11 +++ rpm/configure.ac 2 Apr 2011 02:04:23 -0000 2.472.2.12 @@ -1619,12 +1619,12 @@ WITH_JS_SUBDIR="" WITH_SPIDERMONKEY_SUBDIR="" RPM_CHECK_LIB( - [JavaScript], [js], - [js], [JS_NewContext], [jsapi.h], - [no,internal:external:none], [js:src:src], + [JavaScript], [mozjs185], + [mozjs185], [JS_NewContext], [jsapi.h], + [no,internal:external:none], [mozjs185:src:src], [ if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then WITH_SPIDERMONKEY_SUBDIR="$WITH_JS_SUBDIR/src" - AC_DEFINE(HAVE_LIBJS, 1, [Define to 1 if you have the 'js' library (-ljs).]) + AC_DEFINE(HAVE_LIBJS, 1, [Define to 1 if you have the 'mozjs185' library (-lmozjs185).]) else WITH_JS_SUBDIR=js fi @@ . patch -p0 <<'@@ .' Index: rpm/js/Makefile.am ============================================================================ $ cvs diff -u -r1.44 -r1.44.2.1 Makefile.am --- rpm/js/Makefile.am 18 Sep 2010 14:12:57 -0000 1.44 +++ rpm/js/Makefile.am 2 Apr 2011 02:04:23 -0000 1.44.2.1 @@ -22,7 +22,7 @@ -I$(top_srcdir)/misc \ @WITH_DB_CPPFLAGS@ \ @WITH_FILE_CPPFLAGS@ \ - @WITH_JS_CPPFLAGS@ \ + @WITH_MOZJS185_CPPFLAGS@ \ @WITH_LUA_CPPFLAGS@ \ @WITH_GPSEE_CPPFLAGS@ \ @WITH_SYCK_CPPFLAGS@ \ @@ . patch -p0 <<'@@ .' Index: rpm/js/rpmaug-js.c ============================================================================ $ cvs diff -u -r1.11 -r1.11.4.1 rpmaug-js.c --- rpm/js/rpmaug-js.c 10 Jan 2010 18:29:12 -0000 1.11 +++ rpm/js/rpmaug-js.c 2 Apr 2011 02:04:23 -0000 1.11.4.1 @@ -303,18 +303,18 @@ } static JSFunctionSpec rpmaug_funcs[] = { - JS_FS("defvar", rpmaug_defvar, 0,0,0), - JS_FS("get", rpmaug_get, 0,0,0), - JS_FS("set", rpmaug_set, 0,0,0), - JS_FS("insert", rpmaug_insert, 0,0,0), - JS_FS("rm", rpmaug_rm, 0,0,0), - JS_FS("remove", rpmaug_rm, 0,0,0), - JS_FS("mv", rpmaug_mv, 0,0,0), - JS_FS("move", rpmaug_mv, 0,0,0), - JS_FS("match", rpmaug_match, 0,0,0), - JS_FS("save", rpmaug_save, 0,0,0), - JS_FS("load", rpmaug_load, 0,0,0), - JS_FS("print", rpmaug_print, 0,0,0), + JS_FS("defvar", rpmaug_defvar, 0,0), + JS_FS("get", rpmaug_get, 0,0), + JS_FS("set", rpmaug_set, 0,0), + JS_FS("insert", rpmaug_insert, 0,0), + JS_FS("rm", rpmaug_rm, 0,0), + JS_FS("remove", rpmaug_rm, 0,0), + JS_FS("mv", rpmaug_mv, 0,0), + JS_FS("move", rpmaug_mv, 0,0), + JS_FS("match", rpmaug_match, 0,0), + JS_FS("save", rpmaug_save, 0,0), + JS_FS("load", rpmaug_load, 0,0), + JS_FS("print", rpmaug_print, 0,0), JS_FS_END }; @@ -515,25 +515,31 @@ } static JSBool -rpmaug_ctor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +rpmaug_ctor( JSContext* cx, uintN argc, jsval* vp ) { + jsval *argv = JS_ARGV( cx , vp ); + JSObject *obj = JS_NewObjectForConstructor( cx , vp ); + if( ! obj ) { + JS_ReportError( cx , "Failed to create 'this' object" ); + return JS_FALSE; + } JSBool ok = JS_FALSE; const char * _root = _rpmaugRoot; const char * _loadpath = _rpmaugLoadpath; unsigned int _flags = _rpmaugFlags; -_CTOR_DEBUG_ENTRY(_debug); +_CTOR_DEBUG_ENTRY(_debug, vp); if (!(ok = JS_ConvertArguments(cx, argc, argv, "/ssu", &_root, &_loadpath, &_flags))) goto exit; - if (JS_IsConstructing(cx)) { + if (JS_IsConstructing(cx, vp)) { if (rpmaug_init(cx, obj, _root, _loadpath, _flags) == NULL) goto exit; } else { if ((obj = JS_NewObject(cx, &rpmaugClass, NULL, NULL)) == NULL) goto exit; - *rval = OBJECT_TO_JSVAL(obj); + JS_SET_RVAL( cx , vp , OBJECT_TO_JSVAL( obj ) ); } ok = JS_TRUE; @@ . patch -p0 <<'@@ .' Index: rpm/js/rpmjs-debug.h ============================================================================ $ cvs diff -u -r1.7 -r1.7.4.1 rpmjs-debug.h --- rpm/js/rpmjs-debug.h 12 Jan 2010 21:41:49 -0000 1.7 +++ rpm/js/rpmjs-debug.h 2 Apr 2011 02:04:23 -0000 1.7.4.1 @@ -72,11 +72,11 @@ if (_test) \ fprintf(stderr, "==> %s(%p,%p) ptr %p\n", __FUNCTION__, cx, obj, ptr) -#define _CTOR_DEBUG_ENTRY(_test) \ +#define _CTOR_DEBUG_ENTRY(_test, vp) \ if (_test) \ - fprintf(stderr, "==> %s(%p,%p,%p[%u],%p)%s\n", \ - __FUNCTION__, cx, obj, argv, (unsigned)argc, rval, \ - (JS_IsConstructing(cx) ? " constructing" : "")) + fprintf(stderr, "==> %s(%p,%p,%p[%u],%p)\n", \ + __FUNCTION__, cx, obj, argv, (unsigned)argc, \ + (JS_IsConstructing(cx, vp) ? " constructing" : "")) /*@unchecked@*/ extern int _rpmjs_debug; @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository [email protected]
