Skip to content

Commit 8750bc4

Browse files
committed
Handle jsdom update in either node4 or node5 directory layout
1 parent 93ae1a8 commit 8750bc4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/patch/jsdom.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
//
2+
// We need to load cssstyle's parsers.js, but its location differs
3+
// between node 4 and node 5, so check which one we have.
4+
//
5+
6+
var fs = require('fs');
7+
8+
var PARSERS = 'jsdom/node_modules/cssstyle/lib/parsers.js'; // node 4 hierarchy
9+
try {fs.accessSync(PARSERS, fs.F_OK)} catch (e) {
10+
PARSERS = 'cssstyle/lib/parsers.js'; // node 5 heirarchy
11+
}
12+
113
//
214
// Patch for CSSStyleDeclaration padding property so that it sets/clears
315
// the Top, Right, Bottom, and Left properties (and also validates the

0 commit comments

Comments
 (0)