Skip Menu |

This queue is for tickets about the JavaScript-SpiderMonkey CPAN distribution.

Report information
The Basics
Id: 57617
Status: open
Priority: 0/
Queue: JavaScript-SpiderMonkey

People
Owner: Nobody in particular
Requestors: bkb [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.19
Fixed in: (no value)



Subject: Error messages
In the routine ErrorReporter: /* --------------------------------------------------------------------- */ static void ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report) { /* --------------------------------------------------------------------- */ char msg[400]; snprintf(msg, sizeof(msg), "Error: %s at line %d: %s", message, report->lineno, report->linebuf); sv_setpv(get_sv("@", TRUE), msg); } report->linebuf is only set for compilation errors. See http://groups.google.com/group/netscape.public.mozilla.jseng/tree/browse _frm/month/2000-07? _done=/group/netscape.public.mozilla.jseng/browse_frm/month/2000-07%3F& (scroll down to the bottom of the page for comment by Brendan Eich.) At runtime, report->linebuf is a null pointer, so a runtime error like this: function Donkey () { this.value = random (); } creates an error message like this: Error: ReferenceError: random is not defined at line 2: (null) Also, at the compilation stage, report->linebuf actually contains a newline, so a compile time error adds an extra newline to the end of the error message. It would be nice if the newline could be stripped out of the error message. The above post by Brendan Eich mentions that the documentation on the Mozilla Developer Network/Centre should be fixed, but unfortunately the incorrect documentation is still there, ten years later: https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JSErrorRep ort (scroll down to bottom of the page) If you want a patch for this, please let me know. As per my email (to Thomas Busch) I'm continuing to patch a "personal fork" of this module with this and many other bug fixes and improvements & would be happy to share it.
Hi Ben, could you submit your personal patch ? That would be very helpful. I will test it on my side and if everything is ok, make a new release. Thanks in advance. Thomas Busch
Subject: Re: [rt.cpan.org #57617] Error messages
Date: Mon, 24 May 2010 10:35:50 +0900
To: bug-JavaScript-SpiderMonkey [...] rt.cpan.org
From: Ben Bullock <benkasminbullock [...] gmail.com>
Hi Thomas, I made a new directory like JavaScript-SpiderMonkey-0.19-BKB/ and edited the files. The attached text file is the output from: diff --recursive --context --new-file JavaScript-SpiderMonkey-0.19 JavaScript-SpiderMonkey-0.19-BKB/ > javascript-spidermonkey-patch-2010-05-24.txt I've fixed the following reported bugs: 1. JS_Init -> JS_NewRuntime 2. line number bug in error messages. 3. Newline bug in error messages. 4. Null pointer bug in error messages. I've also added a new test file, t/error.t which tests for the bugs. I have also added two new command line options to Makefile.PL to specify the location of the SpiderMonkey libraries. I have written documentation for them in INSTALL. I also moved the Getopt line in Makefile.PL to before the autodetection of the libraries. I also removed some dud comments from Makefile.PL. I have also corrected some spelling mistakes and grammatical errors in SpiderMonkey.pm. If any of these changes do cause problems, please let me know and I will try to resolve it. Please also let me know when the new version is released. Best wishes, Ben Bullock On 19 May 2010 17:45, Thomas Busch via RT <bug-JavaScript-SpiderMonkey@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=57617 > > > Hi Ben, > > could you submit your personal patch ? That would be very helpful. I > will test it on my side and if everything is ok, make a new release. > > Thanks in advance. > > Thomas Busch > >

Message body is not shown because sender requested not to inline it.

From: benkasminbullock [...] gmail.com
Sorry there is an error in that patch, could you alter the bit where it comments out the Log::Log4perl dependency in Makefile.PL? That dependency is needed.