-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added jsdom env #79
Added jsdom env #79
Conversation
if (!this._url) { | ||
throw new Error('You must pass `url` to JsDOMEnvironment'); | ||
} | ||
this._window = this._document = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we need it?
|
||
const params = { | ||
url: this._url, | ||
// scripts: ['https://cdnjs.cloudflare.com/ajax/libs/sizzle/2.3.3/sizzle.min.js'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove comments
}; | ||
vm.createContext(sandbox); | ||
evalFunc = String(evalFunc); | ||
vm.runInContext(`const fn = ${evalFunc}; result = fn(...args);`, sandbox); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just ${evalFunc.toString()}
, it's not cool to change type of variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, ok, ignore my comments, of course.. of course.. ))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
damn it. will fix it now
much cleaner now! good job! |
Added JSDom env