It might be a worker context, not a JSDOMWindow. Patch forthcoming.
Created attachment 24592 [details] proposed fix
Comment on attachment 24592 [details] proposed fix r=me
Created attachment 24593 [details] A better fix As proposed by Maciej on IRC, do not change JavaScriptCore, as the need is WebCore-specific.
Comment on attachment 24593 [details] A better fix r=me assuming it builds and passes tests
Committed revision 37806.