summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-res-write-end-dont-take-array.js
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2016-01-25 15:00:06 -0800
committerJames M Snell <jasnell@gmail.com>2016-03-16 08:34:02 -0700
commit85ab4a5f1281c4e1dd06450ac7bd3250326267fa (patch)
tree7a51edfc5d6efc231cf821d575c9ca4a26d0545f /test/parallel/test-http-res-write-end-dont-take-array.js
parent90a5fc20be22b4278a01bc58acba0cb732da0140 (diff)
downloadnode-new-85ab4a5f1281c4e1dd06450ac7bd3250326267fa.tar.gz
buffer: add .from(), .alloc() and .allocUnsafe()
Several changes: * Soft-Deprecate Buffer() constructors * Add `Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()` * Add `--zero-fill-buffers` command line option * Add byteOffset and length to `new Buffer(arrayBuffer)` constructor * buffer.fill('') previously had no effect, now zero-fills * Update the docs PR-URL: https://github.com/nodejs/node/pull/4682 Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Diffstat (limited to 'test/parallel/test-http-res-write-end-dont-take-array.js')
-rw-r--r--test/parallel/test-http-res-write-end-dont-take-array.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-http-res-write-end-dont-take-array.js b/test/parallel/test-http-res-write-end-dont-take-array.js
index 0befd951f0..6aff0661df 100644
--- a/test/parallel/test-http-res-write-end-dont-take-array.js
+++ b/test/parallel/test-http-res-write-end-dont-take-array.js
@@ -11,7 +11,7 @@ var server = http.createServer(function(req, res) {
// write should accept string
res.write('string');
// write should accept buffer
- res.write(new Buffer('asdf'));
+ res.write(Buffer.from('asdf'));
// write should not accept an Array
assert.throws(function() {
@@ -27,7 +27,7 @@ var server = http.createServer(function(req, res) {
res.end('string');
} else if (test === 2) {
// end should accept Buffer
- res.end(new Buffer('asdf'));
+ res.end(Buffer.from('asdf'));
}
});