Closed
Bug 60662
Opened 24 years ago
Closed 15 years ago
javascript strict warnings in overrideHandler.js
Categories
(SeaMonkey :: Preferences, defect, P3)
SeaMonkey
Preferences
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: bugzilla, Unassigned)
References
Details
Attachments
(3 files)
1.25 KB,
patch
|
Details | Diff | Splinter Review | |
1.41 KB,
patch
|
Details | Diff | Splinter Review | |
1.34 KB,
patch
|
Details | Diff | Splinter Review |
JavaScript strict warning:
chrome://communicator/content/pref/overrideHandler.js line 250: trailing comma
is not legal in ECMA-262 object initializers
JavaScript strict warning:
chrome://communicator/content/pref/overrideHandler.js line 292: function
getLiteral does not always return a value
JavaScript strict warning:
chrome://communicator/content/pref/overrideHandler.js line 305: function
getHandlerInfoForType does not always return a value
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
Ok, this patch makes getLiteral and getHandlerInfoForType return null when no
matching value is found in the RDF. Removed an extraneous tab while i was in there.
Comment 3•24 years ago
|
||
Nit (since you're touching that):
6 var gRDF =
Components.classes["@mozilla.org/rdf/rdf-service;1"].getService();
7 if (gRDF)
8 gRDF = gRDF.QueryInterface(Components.interfaces.nsIRDFService);
There's no need for that if (gRDF)
But I'm wondering if returning null is the right thing to do. If those two
methods should never reach those points (and that's kinda what the current code
suggests, since then no value is returned), I'd rather throw an exception to
silence strict js warnings without accidentily hiding any problems.
Comment 4•24 years ago
|
||
Comment 5•24 years ago
|
||
+var gRDF = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService();
+gRDF = gRDF.QueryInterface(Components.interfaces.nsIRDFService);
D'oh... That's what you get for not being clear...
+var gRDF = Components.classes["@mozilla.org/rdf/rdf-service;1"]
+ .getService(Components.interfaces.nsIRDFService);
r=jag if you make that change.
I don't think we could ever hit the throw in a valid case, but cc'ing Ben for
input on that. If it does need to be |return null;| after all, then just make
that change (and the above) and you'll have r=jag on that.
Comment 7•24 years ago
|
||
timeless: ??
mao: oops... you forgot the ; after NS_ERROR_FAILURE...
Comment 8•24 years ago
|
||
Copy paste error on my part, my dist dir has the correct change. Correct patch
momentarily.
Comment 9•24 years ago
|
||
Comment 10•24 years ago
|
||
Turns out throwing an exception wasn't really what we need here. Since these
codepaths are hit in situations where we don't have a handler or extension,
returning an empty string makes the most sense. (Otherwise, |null| shows up as
the handler or extension).
Comment 11•24 years ago
|
||
r=jag
Comment 12•24 years ago
|
||
cc'ing alecf for sr
Comment 13•24 years ago
|
||
sr=alecf
Comment 15•24 years ago
|
||
fix checked in, thanks
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 16•23 years ago
|
||
Warning: reference to undefined property urns[i][2]
Source File: chrome://communicator/content/pref/overrideHandler.js
Line: 399
Comment 17•23 years ago
|
||
Ok, the line number hasn't changed on
http://lxr.mozilla.org/seamonkey/source/xpfe/components/prefwindow/resources/content/overrideHandler.js
.
I look at the code from lines 373-377, especially 377, and I notice there isn't
a third sub element to the APP_URI line, which would cause this strict warning.
Due to a glitch in today's build (2002010508), I can't test this bug to see the
strict warning.
Anyone care to advise on this one about correct behavior?
Updated•20 years ago
|
Assignee: maolson → prefs
Status: REOPENED → NEW
QA Contact: bugzilla
Updated•20 years ago
|
Product: Browser → Seamonkey
Comment 18•16 years ago
|
||
(Filter "spam" on 'prefs-nobody-20080612'.)
Assignee: prefs → nobody
QA Contact: prefs
Comment 19•15 years ago
|
||
> Warning: reference to undefined property urns[i][2]
> Source File: chrome://communicator/content/pref/overrideHandler.js
> Line: 399
Fixed in Bug 86640
Status: NEW → RESOLVED
Closed: 24 years ago → 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•