Skip to content

Commit 4009189

Browse files
committed
[feature] fs now throw when required
1 parent f155fe1 commit 4009189

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

builtin/fs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
// nothing to see here... no file methods for the browser
1+
2+
throw new Error('fs is not implemented');

test/browser/fs-simple.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
var test = require('tape');
3+
4+
test('require fs should throw', function (t) {
5+
try {
6+
require('fs');
7+
t.ok(false, 'fs did not throw');
8+
} catch (e) {
9+
t.ok(true, 'fs did throw');
10+
}
11+
t.end();
12+
});

0 commit comments

Comments
 (0)