Skip to content

Commit

Permalink
added or case for older versions of node
Browse files Browse the repository at this point in the history
  • Loading branch information
gtanner committed May 2, 2011
1 parent 7af65a9 commit 4cf155a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jsdom/level2/languages/javascript.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var Context = process.binding('evals').Context,
Script = process.binding('evals').NodeScript;
Script = process.binding('evals').NodeScript || process.binding('evals').Script;

exports.javascript = function(element, code, filename) {
var document = element.ownerDocument,
Expand Down

6 comments on commit 4cf155a

@gtanner
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look the npm package was updated for this yet:

npm update jsdom still contains the old code.

@jstsch
Copy link

@jstsch jstsch commented on 4cf155a Jun 3, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to update the package asap, since the examples on the homepages don't work when you're using npm at this time (with node 0.4.8). (TypeError: Cannot call method 'runInContext' of undefined)

@lancefisher
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the best approach to using this until it's in npm? I just manually edited my file in /Users/lancefisher/node_modules/jsdom/lib/jsdom/level2/languages/javascript.js to change that line, and it seems to work, but I'm just hacking my way through things. Thanks.

@gtanner
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is what I have been doing.

@tmpvar
Copy link
Member

@tmpvar tmpvar commented on 4cf155a Jul 11, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm install https://github.com/tmpvar/jsdom/tarball/4cf155a1624b3fb54b2eec536a0c060ec1bab4ab

this also works in package.json

"dependencies" : {
  "jsdom" : "https://github.com/tmpvar/jsdom/tarball/4cf155a1624b3fb54b2eec536a0c060ec1bab4ab"
}

jsdom 0.3.0 should hit npm at the end of this week (just need to fix more bugs and get some of the half-baked functionality finished). If you have some spare cycles, let me know, I'd love the help!

@lancefisher
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks tmpvar! I didn't know you could do that with npm.

Please sign in to comment.