mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
c5a18e748d
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>
13 lines
262 B
JavaScript
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/);
|