|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59038 Print error message with not only line number but also specified text
Submitted: 2010-01-20 01:06 UTC Modified: 2010-02-21 17:48 UTC
From: hoshino at labs dot cybozu dot co dot jp Assigned:
Status: Closed Package: spidermonkey (PECL)
PHP Version: 5_3.1RC2 OS: Linux/Windows
Private report: No CVE-ID: None
 [2010-01-20 01:06 UTC] hoshino at labs dot cybozu dot co dot jp
This prints not only line number but also specified string text when an error occurs in interpreting javascript code. Specify a prefer string to the second argument of evaluateScript() function call. It will help your debug javascript code in PHP. Of course it can be omitted.

The patch is spidermonkey-line-number.patch on

Reproduce code:
$js = new JSContext();
$script = <<< END
    try {
        throw new Error('test message');
    } catch (e) {

$js->evaluateScript($script, 'test call');

Expected result:
object(stdClass)#2 (4) {
  string(12) "test message"
  string(9) "test call"
  string(38) "Error("test message")@:0
@test call:1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-21 17:48 UTC] c dot robin at smartphp dot org
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Jul 04 19:01:16 2020 UTC