Closed Bug 1218499 Opened 4 years ago Closed 4 years ago
Event constructor will happily set m Request to null if not passed
But the IDL says it can't be null, so I expect this: (new FetchEvent("foo")).request to crash with a null-deref in binding code. Looks to me like the spec at https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#fetch-event-section has the same bug (except it just doesn't say what to do if request is not set, as opposed to requiring a crash). Chances are "request" should just be required in FetchEventInit.
Oh, and looks like I mentioned this once before in bug 1065216 comment 3 and got ignored...
I guess https://github.com/slightlyoff/ServiceWorker/issues/680 is the spec issue. But we shouldn't wait for the spec to be fixed to stop crashing. Probably need to just mark this member as nullable.
Yeah we definitely crash here.
Assignee: nobody → ehsan
Comment on attachment 8679059 [details] [diff] [review] Make FetchEvent.request nullable r=me
Attachment #8679059 - Flags: review?(bzbarsky) → review+
You need to log in before you can comment on or make changes to this bug.