RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/js/ rpmaug-js.c rpmbc-js.c rpmbf-js.c rpmcudf-js.c rpmd...

From: Jeff Johnson <n3npq@mac.com>
Date: Fri 03 Jun 2011 - 18:48:24 CEST
Message-id: <DB73E943-C454-4894-8D23-17FC49B6408C@mac.com>

>> 
>> patch -p0 <<'@@ .'
>> Index: rpm/js/rpmaug-js.c
>> ============================================================================
>> $ cvs diff -u -r1.12 -r1.13 rpmaug-js.c
>> --- rpm/js/rpmaug-js.c	2 Apr 2011 02:01:53 -0000	1.12
>> +++ rpm/js/rpmaug-js.c	3 Jun 2011 16:32:15 -0000	1.13
>> @@ -29,8 +29,14 @@
>>  /* XXX does aug_defnode() need binding? */
>>  /* XXX unclear whether aug.defvar("foo", "bar") or aug.foo = "bar" is better */
>>  static JSBool
>> -rpmaug_defvar(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
>> +rpmaug_defvar(JSContext *cx, uintN argc, jsval *vp)

There are instant "portability" issues here.

>>  {
>> +    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;
>> +    }

This needs to be a macro.

>>      void * ptr = JS_GetInstancePrivate(cx, obj, &rpmaugClass, NULL);
>>      rpmaug aug = ptr;
>>      JSBool ok = JS_FALSE;
>> @@ -49,7 +55,7 @@
>>      case 1:	/* success */
>>  	/* XXX return NAME or EXPR on success?  or bool for success/failure? */
>>  	/* XXX hmmm, bool and string mixed returns. */
>> -	*rval = STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _name));
>> +	JS_SET_RVAL(cx, vp, STRING_TO_JSVAL(JS_NewStringCopyZ(cx, _name)));
>>  	break;

And the style was chosen for "portability" reasons. There are _SERIOUS_
issues targeting any single -ljs (even if JS 1.8.5 is the current known "best").

And the rest is mostly ditto ditto ditto afaict (not looked).

The real problem that needs to be solved _FIRST_ isn't in the code,
but rather with the modularization, and until you attempt GPSEE
and its module loading you plain and simply will _NOT_ see the
real issues in need of solving.

And even before attempting the FIRST issue, I ask
	Do you have any idea -- except from de facto "Compiles: ship it!" --
	that any of your changes actually function?
If you haven't run any of the fairly complete test scripts, well, all you've
done is just make a whopping big mess by voiding out any ability to diff sources.

73 de Jeff



  • application/pkcs7-signature attachment: smime.p7s
Received on Fri Jun 3 18:48:32 2011
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.