0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/parallel/test-fs-write-no-fd.js
Myles Borins c5a18e748d Revert "fs: validate args of truncate functions in js"
This reverts commit c86c1eeab5.

original commit message:

    This patch

     1. moves the basic validation of arguments to `truncate` family
        of functions to the JavaScript layer from the C++ layer.

     2. makes sure that the File Descriptors are validated strictly.

    PR-URL: #2498
    Reviewed-By: Trevor Norris <trev.norris@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/7950
Reviewed-By: Julien Gilli <jgilli@nodejs.org>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-04 09:37:17 -07:00

13 lines
262 B
JavaScript

'use strict';
require('../common');
const fs = require('fs');
const assert = require('assert');
assert.throws(function() {
fs.write(null, Buffer.allocUnsafe(1), 0, 1);
}, /TypeError/);
assert.throws(function() {
fs.write(null, '1', 0, 1);
}, /TypeError/);