Closed
Description
In these initialization lines:
var _window = typeof window !== 'undefined' ? window : undefined;
var _document = _window && _window.document;
the second line appears to be defensive against the possibility that window
is undefined
(note also that unless I'm mistaken, the first line is semantically equivalent to var _window = window;
).
Later lines, however, are not similarly defensive, with
this._originalConsole = _window.console || {};
...
this._location = _window.location;
in the Raven
constructor and
var RavenConfig = _window.RavenConfig;
in afterLoad
. We also do
var _Raven = window.Raven;
in singleton.js
.
I know we care about working if document
doesn't exist, but do we care about being defensive against window
not existing? If so, we should also be defensive in these other spots; if not, we shouldn't bother pretending in the _document
declaration. Either way, we can simplify the _window
declaration.
/cc @benvinegar
Metadata
Metadata
Assignees
Labels
No labels