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 support for io.js #21

Merged
merged 2 commits into from
Feb 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 [email protected]'
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