adamfowleruk / mljs

MarkLogic REST API JavaScript wrapper for NodeJS and Browser Apps
http://adamfowleruk.github.io/mljs/apidocs/core/tutorial-all.html
Other
33 stars 19 forks source link

Window does not exist in nodejs environment #34

Closed spig closed 11 years ago

spig commented 11 years ago

I am not sure about how everything should work, but I've noticed that the function textToXML uses the window object without checking if it's defined. Other places in the file the window object is checked before use so I attempted to do the same in my fork.

If the window object is undefined then the parsing is unable to occur. I have added jsdom to allow parsing when window is not defined.

Is there another fix that would be better?

adamfowleruk commented 11 years ago

Good catch. I'll look for a NodeJS equivalent and add a check for window.

spig commented 11 years ago

Hopefully you can just pull the changes in through my pull request.

Steve

On Sun, May 12, 2013 at 7:16 AM, adamfowleruk notifications@github.comwrote:

Good catch. I'll look for a NodeJS equivalent and add a check for window.

— Reply to this email directly or view it on GitHubhttps://github.com/adamfowleruk/mldb/issues/34#issuecomment-17777782 .

adamfowleruk commented 11 years ago

Unfortunately I had already done a bunch of core changes to MLDB. I've manually merged in your fixes though. Thanks very much for your efforts.