Closed
Bug 1206491
Opened 10 years ago
Closed 10 years ago
Fix a JavaScript error while about:cache opened and no incoming parameters
Categories
(Core :: Networking: Cache, defect)
Tracking
()
RESOLVED
FIXED
mozilla44
People
(Reporter: yfdyh000, Assigned: yfdyh000)
References
()
Details
Attachments
(1 file)
|
1.31 KB,
patch
|
mayhemer
:
review+
|
Details | Diff | Splinter Review |
STR:
Open about:cache and see Web Console.
TypeError: context is null aboutCache.js:13:5
No other abnormalities. Just eliminate an error.
Attachment #8663391 -
Flags: review?(mcmanus)
Updated•10 years ago
|
Attachment #8663391 -
Flags: review?(mcmanus) → review?(michal.novotny)
Comment 1•10 years ago
|
||
Comment on attachment 8663391 [details] [diff] [review]
patch v1
Review of attachment 8663391 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/aboutcache/content/aboutCache.js
@@ +10,5 @@
> var context = searchParams.get('context');
>
> // The context is in a format as used by the HTTP cache v2 back end
> +if (context)
> + var [context, isAnon, isInBrowser, appId, isPrivate] = context.match(/(a,)?(b,)?(i\d+,)?(p,)?/);
better is:
var [context, isAnon, isInBrowser, appId, isPrivate] = (context ? context.match(/(a,)?(b,)?(i\d+,)?(p,)?/) : [null, false, false, null, false];
Attachment #8663391 -
Flags: review?(michal.novotny) → review-
Comment 2•10 years ago
|
||
* false]);
(In reply to Honza Bambas (not reviewing) (:mayhemer) from comment #1)
> Comment on attachment 8663391 [details] [diff] [review]
> patch v1
>
> Review of attachment 8663391 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: toolkit/components/aboutcache/content/aboutCache.js
> @@ +10,5 @@
> > var context = searchParams.get('context');
> >
> > // The context is in a format as used by the HTTP cache v2 back end
> > +if (context)
> > + var [context, isAnon, isInBrowser, appId, isPrivate] = context.match(/(a,)?(b,)?(i\d+,)?(p,)?/);
>
> better is:
>
> var [context, isAnon, isInBrowser, appId, isPrivate] = (context ?
> context.match(/(a,)?(b,)?(i\d+,)?(p,)?/) : [null, false, false, null, false];
var [context, isAnon, isInBrowser, appId, isPrivate] = (context ?
context.match(/(a,)?(b,)?(i\d+,)?(p,)?/) : [null, false, false, null, false]);
Like this?
I don't see the necessity, and this increases the complexity, why we need it?
Flags: needinfo?(honzab.moz)
Comment 4•10 years ago
|
||
Comment on attachment 8663391 [details] [diff] [review]
patch v1
Hmm.. we are probably ok with the variables at the default 'undefined' value. OK then.
Flags: needinfo?(honzab.moz)
Attachment #8663391 -
Flags: review- → review+
Keywords: checkin-needed
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•