add "this"

Sorry for my English first.
In the closure,  the both "typeof" of "document" & "window"  are return "undefined" without "this" prefix. But they are under the variable  "this". 
So ...
This commit is contained in:
Jason 2017-12-22 01:50:28 +08:00 committed by GitHub
parent 9825fd2bd0
commit 1a74af445c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@
*/ */
// load dependencies // load dependencies
if (typeof document === 'undefined' && typeof window === 'undefined') { if (typeof this.document === 'undefined' && typeof this.window === 'undefined') {
var jsdom = require('jsdom').jsdom, var jsdom = require('jsdom').jsdom,
jsdomObj = jsdom('', {}), jsdomObj = jsdom('', {}),
window = jsdomObj.defaultView, // jshint ignore:line window = jsdomObj.defaultView, // jshint ignore:line