tmpvar/jsdom — Issue #417: About TypeError: needs a 'context' argument
Author: fairy0815
Created: 2012-03-09 02:05:58+00:00
State: open

I'm working on WIndows, and when I try to use jsdom like the following code, I got an error

jsdom.env({
html: body,
scripts: ['http://code.jquery.com/jquery-1.6.min.js']
}, function(err, window){
var $ = window.jQuery;
console.log($('title').text());
res.end($('title').text());
});

Error Return
C:\my_coding_space\fund\node_modules\jsdom\lib\jsdom\browser\index.js:26
global = vm.runInContext('this', sandbox);
^
TypeError: needs a 'context' argument.
at Object.getGlobal (C:\my_coding_space\fund\node_modules\jsdom\lib\jsdom\b
owser\index.js:26:21)
at Object.createWindow (C:\my_coding_space\fund\node_modules\jsdom\lib\jsdo
\browser\index.js:308:23)
at Object.windowAugmentation (C:\my_coding_space\fund\node_modules\jsdom\li
\jsdom\browser\index.js:63:24)
at Object.parentWindow (C:\my_coding_space\fund\node_modules\jsdom\lib\jsdo
\browser\index.js:605:28)
at Object. (C:\my_coding_space\fund\node_modules\jsdom\lib\jsdom
js:81:15)
at C:\my_coding_space\fund\node_modules\jsdom\lib\jsdom.js:170:52
at Object.env (C:\my_coding_space\fund\node_modules\jsdom\lib\jsdom.js:262:
)
at Request._callback (C:\my_coding_space\fund\routes\index.js:27:13)
at Request.callback (C:\my_coding_space\fund\node_modules\request\main.js:1
9:22)
at Request. (C:\my_coding_space\fund\node_modules\request\main.j
:525:16)