Closed
Bug 324142
Opened 19 years ago
Closed 18 years ago
[FIX]Chrome javascript syntax errors not shown in javascript console
Categories
(Core :: DOM: Core & HTML, defect, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha3
People
(Reporter: mossop, Assigned: bzbarsky)
References
Details
(Keywords: regression)
Attachments
(3 files)
3.09 KB,
application/x-xpinstall
|
Details | |
4.62 KB,
patch
|
Details | Diff | Splinter Review | |
3.45 KB,
patch
|
jst
:
review+
jst
:
superreview+
|
Details | Diff | Splinter Review |
Certain errors in chrome JavaScript files are no longer shown in the JavaScript console. These errors are the kind that basically makes the whole JavaScript file unusable because of syntax errors.
An example of an error that causes this is:
function badfunction(var badargument)
{
}
I will attach a testcase that demonstrates the problem.
Reporter | ||
Comment 1•19 years ago
|
||
Web pages work as expected, this error only exists for chrome scripts (making extension development quite a challenge).
This extensions simply adds an overlay to the main browser that loads a bad script. Firefox 1.5 shows the following error in the JavaScript console:
Error: missing formal parameter
Source File: chrome://test/content/browser.js
Line: 45, Column: 25
Source Code:
function broken_function(var badargument)
Current trunk builds show no error in the console. The regression occured between the nightly of 28th Nov and 29th Nov, which is the following checkins:
http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2005-11-28+05%3A00&maxdate=2005-11-29+05%3A30&cvsroot=%2Fcvsroot
Reporter | ||
Comment 2•19 years ago
|
||
Blake, bug 317476 and bug 317533 are the only JavaScript checkins I can see in this range, can you shed any light here?
Comment 3•19 years ago
|
||
Neither of those should have affected reporting of errors (except those reported through JS_ReportError, and then only for the better). I think I blame another checkin, though I haven't verified this at all.
Maybe this should be in a Core component... This is also happening in other apps (Thunderbird, Sunbird), so it is not specific to Firefox. It's pretty frustrating.
The only clue may be an error that just says "xxx is not defined" for some function xxx, such as onLoad --- a syntax error anywhere in a javascript file prevented the whole file from being evaluated.
(Has anyone found workarounds for diagnosing the syntax error once you guess that one exists? My current diagnosis technique is to paste the whole file into Javascript Shell, which tells me if there is a syntax error but not where it is, so I have to do binary search pasting parts of the file to localize it.)
Reporter | ||
Comment 5•19 years ago
|
||
My current workaround involves opening the same extension in Firefox 1.5 and looking in the javascript console. Hardly efficient
Assignee: nobody → js-console
Product: Firefox → Core
QA Contact: javascript.console → jrgmorrison
Reporter | ||
Updated•19 years ago
|
Assignee: js-console → general
Component: JavaScript Console → JavaScript Engine
QA Contact: jrgmorrison → general
Comment 6•19 years ago
|
||
I can confirm this bug in the XULRunner nightly of 2006/05/15. Very annoying when trying to develop a XULRunner app as well (especially as it's no extension and the code is less easy to try in Firefox).
Comment 7•19 years ago
|
||
Related to bug 344335?
Updated•19 years ago
|
Flags: blocking1.9a1?
Comment 8•18 years ago
|
||
This is the probably the same as bug 344335 - the only difference is that this bug says it's being chrome that causes the problem while that one says it's being XUL that causes the problem (and includes a content XUL testcase to prove it).
Comment 9•18 years ago
|
||
*** Bug 344335 has been marked as a duplicate of this bug. ***
Comment 10•18 years ago
|
||
Is this trunk only, or is the 1.8 branch regressed too?
/be
Reporter | ||
Comment 11•18 years ago
|
||
(In reply to comment #10)
> Is this trunk only, or is the 1.8 branch regressed too?
Appears to be trunk only. The testcase from this and bug 344335 correctly show errors in a current Firefox 2b2 build.
Updated•18 years ago
|
Flags: blocking1.9a1? → blocking1.9-
Whiteboard: [wanted-1.9]
Comment 12•18 years ago
|
||
I think the interesting change in this regression range is in nsJSEnvironment.cpp which now tries to use a win, instead of the global object. Is it possible we should fall back on using the global object if no win is available (or fallback on printf or SOMETHING)?
Adding jst to cc:
Assignee: general → crowder
Updated•18 years ago
|
Status: NEW → ASSIGNED
OS: Windows XP → All
Hardware: PC → All
Comment 13•18 years ago
|
||
FWIW, I don't see them on the (shell) console in opt either, but in debug builds.
![]() |
Assignee | |
Comment 14•18 years ago
|
||
![]() |
Assignee | |
Comment 16•18 years ago
|
||
Basically, in this case the global is a XUL proto global. So it's not at all a window, but it's a perfectly fine global object we can use for everything except the onerror event.
Attachment #256959 -
Flags: superreview?(jst)
Attachment #256959 -
Flags: review?(jst)
![]() |
Assignee | |
Updated•18 years ago
|
Assignee: crowder → bzbarsky
Status: ASSIGNED → NEW
Component: JavaScript Engine → DOM
Priority: -- → P2
Summary: Chrome javascript syntax errors not shown in javascript console → [FIX]Chrome javascript syntax errors not shown in javascript console
Target Milestone: --- → mozilla1.9alpha3
Comment 17•18 years ago
|
||
This fixes it for me. Thanks!
before patch:
debug:
shell console: yes
JS console: no
opt:
shell console: no
JS console: no (!)
after patch:
opt:
shell console: no
JS console: yes (!)
debug:
shell console: yes
JS console: yes
Nice would be to also output it on shell console in opt when dump is enabled - I'd assume it would be there: if I get all my own debug crap, I surely want to know about JS syntax errors there, and I don't have the JS console open always. But that may be controversial, I don't know.
Component: DOM → JavaScript Engine
Priority: P2 → --
Summary: [FIX]Chrome javascript syntax errors not shown in javascript console → Chrome javascript syntax errors not shown in javascript console
Target Milestone: mozilla1.9alpha3 → ---
Updated•18 years ago
|
Status: NEW → ASSIGNED
Component: JavaScript Engine → DOM
Priority: -- → P2
Summary: Chrome javascript syntax errors not shown in javascript console → [FIX]Chrome javascript syntax errors not shown in javascript console
Target Milestone: --- → mozilla1.9alpha3
Comment 18•18 years ago
|
||
Handing off to bz, since he coded the patch. Feel free to toss it back if you'd like me to land it or handle nits, etc.
Status: ASSIGNED → NEW
Updated•18 years ago
|
Attachment #256959 -
Flags: superreview?(jst)
Attachment #256959 -
Flags: superreview+
Attachment #256959 -
Flags: review?(jst)
Attachment #256959 -
Flags: review+
![]() |
Assignee | |
Comment 19•18 years ago
|
||
Fixed.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Updated•18 years ago
|
Flags: in-testsuite?
Updated•17 years ago
|
Flags: wanted1.9+
Whiteboard: [wanted-1.9]
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•