Skip to content
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

Merged
merged 3 commits into from
Sep 15, 2016
Merged

Added jsdom env #79

merged 3 commits into from
Sep 15, 2016

Conversation

maZahaca
Copy link
Member

@maZahaca maZahaca commented Aug 27, 2016

Added JSDom env

if (!this._url) {
throw new Error('You must pass `url` to JsDOMEnvironment');
}
this._window = this._document = null;
Copy link
Contributor

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'],
Copy link
Contributor

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);
Copy link
Contributor

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

Copy link
Contributor

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.. ))

Copy link
Member Author

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

@jifeon
Copy link
Contributor

jifeon commented Aug 31, 2016

much cleaner now! good job!

@maZahaca maZahaca merged commit 1f504c9 into feature-goose-babe Sep 15, 2016
@maZahaca maZahaca deleted the feature-env-jsdom branch September 15, 2016 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants