Skip to content

Commit

Permalink
Merge pull request #21 from andrewblond/iojs
Browse files Browse the repository at this point in the history
Added support for io.js.
  • Loading branch information
tschaub committed Feb 9, 2015
2 parents 6406c5f + 3fc185f commit d648fd7
Show file tree
Hide file tree
Showing 3 changed files with 1,870 additions and 2 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_js:
- "0.12"
- "0.10"
- "0.8"
- iojs

before_install:
- '[ "${TRAVIS_NODE_VERSION}" != "0.8" ] || npm install -g npm@1.4.28'
Expand Down
9 changes: 7 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ var versions = {
'0.9.x': 'fs-0.9.12.js',
'0.10.x': 'fs-0.10.28.js',
'0.11 - 0.11.14': 'fs-0.11.13.js',
'>= 0.11.15': 'fs-0.12.0.js'
'0.11.15 - 0.12.x': 'fs-0.12.0.js',
'1.x.x': 'fs-1.1.0.js'
};
var nodeVersion = process.versions.node;
var fsName;
Expand All @@ -40,7 +41,11 @@ var mockFs = rewire(path.join(__dirname, '..', 'node', fsName));
var originalBinding = mockFs.__get__('binding');
var originalStats = mockFs.Stats;
for (var name in mockFs) {
realFs[name] = mockFs[name];
var descriptor = Object.getOwnPropertyDescriptor(realFs, name);

if (!descriptor || descriptor && descriptor.writable) {
realFs[name] = mockFs[name];
}
}

function setBinding(binding, Stats) {
Expand Down
Loading

0 comments on commit d648fd7

Please sign in to comment.