Beginning on October 25th, 2016, Persona will no longer be an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 737022 - Re-enable strict warnings while parsing XUL
: Re-enable strict warnings while parsing XUL
: regression
Product: Core
Classification: Components
Component: General (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla14
Assigned To:
Depends on:
Blocks: 371174 385872
  Show dependency treegraph
Reported: 2012-03-19 07:43 PDT by
Modified: 2012-04-01 16:09 PDT (History)
13 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Proposed patch (1.83 KB, patch)
2012-03-19 10:55 PDT,
jst: review+
Details | Diff | Splinter Review
More fixes (2.94 KB, patch)
2012-03-27 08:36 PDT,
jst: review+
Details | Diff | Splinter Review

Description 2012-03-19 07:43:35 PDT
+++ This bug was initially created as a clone of Bug #385872 +++

Bug 383365 enabled strict warnings in debug builds by default, for both chrome and content.

Bug 385872, while trying to turn off strict warnings in content in debug builds, managed to completely disable strict warnings while parsing XUL, because the call to JSOptionChangedCallback was moved from nsJSContext::nsJSContext (where everyone gets it) to nsJSContext::InitClasses (where only HTML gets it).
Comment 1 2012-03-19 10:55:11 PDT
Created attachment 607215 [details] [diff] [review]
Proposed patch
Comment 2 :aceman 2012-03-19 14:33:36 PDT
What types of warnings does this enable? I see many warnings in debug builds that aren't seen in normal builds.
Like 'reference to undefined property' or 'variable redeclaration'.
Comment 3 :aceman 2012-03-19 14:42:31 PDT
I mean in the Error console.
Is this bug about something else?
Comment 4 2012-03-19 14:43:31 PDT
(In reply to :aceman from comment #2)
> What types of warnings does this enable? I see many warnings in debug builds
> that aren't seen in normal builds.
> Like 'reference to undefined property' or 'variable redeclaration'.
This enables warnings generated while parsing XUL scripts. You may already be able to trigger those warnings in JS components or modules though; I don't know how their loaders work. Some of the warnings that may be involved: function does not always return a value; redeclaration of variable; test for equality mistyped as assignment? variable redeclares argument; mistyped ; after conditional?
Comment 5 Mozilla RelEng Bot 2012-03-22 01:32:02 PDT
Try run for 438f35edbb51 is complete.
Detailed breakdown of the results available here:
Results (out of 219 total builds):
    exception: 2
    success: 175
    warnings: 28
    failure: 14
Builds (or logs if builds failed) available at:
Comment 6 2012-03-22 02:20:24 PDT
Pushed changeset 5c13fce74f83 to mozilla-central.
Comment 7 2012-03-27 08:31:35 PDT
Mano moved the setting of the context options from InitContext to InitClasses so that it would have a chance to affect global windows after the context had been given a script global object; InitContext is too early for that...
Comment 8 2012-03-27 08:36:42 PDT
Created attachment 609721 [details] [diff] [review]
More fixes

* Now sets the context options in InitClasses too where we have a window that we can check for chromeness.
* Tweaks checks for content windows so that they don't include XBL/XUL script prototype objects, which will use the chrome window preferences. (XUL actually gives us the script prototype object before it calls InitContext so in theory I could check for chrome XUL, but I hear nobody supports content XUL these days.)
Comment 9 Philip Chee 2012-03-27 10:52:32 PDT
You can still whitelist content XUL via the permissions manager.
Comment 10 2012-03-28 04:12:34 PDT
Pushed changeset fb23c30e3d60 to mozilla-central.

Note You need to log in before you can comment on or make changes to this bug.