diff options
author | Julian Duque <julianduquej@gmail.com> | 2015-04-28 15:15:41 -0500 |
---|---|---|
committer | Julian Duque <julianduquej@gmail.com> | 2015-04-28 17:44:37 -0500 |
commit | f9c681cf627caf89b5c7eaacf154fdefb747c7e0 (patch) | |
tree | 24c8bd21b7e5acdb109bcf93aa3da205e9247daa /test | |
parent | 509b59ea7c815a27c623773cee6480667f68293c (diff) | |
download | android-node-v8-f9c681cf627caf89b5c7eaacf154fdefb747c7e0.tar.gz android-node-v8-f9c681cf627caf89b5c7eaacf154fdefb747c7e0.tar.bz2 android-node-v8-f9c681cf627caf89b5c7eaacf154fdefb747c7e0.zip |
fs: validate fd on fs.write
PR-URL: #1553
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-fs-write-no-fd.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/parallel/test-fs-write-no-fd.js b/test/parallel/test-fs-write-no-fd.js new file mode 100644 index 0000000000..143928e783 --- /dev/null +++ b/test/parallel/test-fs-write-no-fd.js @@ -0,0 +1,11 @@ +const common = require('../common'); +const fs = require('fs'); +const assert = require('assert'); + +assert.throws(function() { + fs.write(null, new Buffer(1), 0, 1); +}, /TypeError/); + +assert.throws(function() { + fs.write(null, '1', 0, 1); +}, /TypeError/); |