diff options
author | Trevor Norris <trev.norris@gmail.com> | 2015-06-02 12:53:30 -0600 |
---|---|---|
committer | Rod Vagg <rod@vagg.org> | 2015-08-04 11:56:11 -0700 |
commit | 866408416612399ba96db87c638b473bb56ceb64 (patch) | |
tree | fd468bbe193453bbe67932c565b8de3a60d8839a /src/string_bytes.cc | |
parent | 36f78f4c1cbe0c0dd2a83f6b1dba534a9d722a49 (diff) | |
download | android-node-v8-866408416612399ba96db87c638b473bb56ceb64.tar.gz android-node-v8-866408416612399ba96db87c638b473bb56ceb64.tar.bz2 android-node-v8-866408416612399ba96db87c638b473bb56ceb64.zip |
buffer: make additional changes to native API
Address comments and deprecations left in source files. These changes
include:
* Remove the deprecated API.
* Change Buffer::New() that did a copy of the data to Buffer::Copy()
* Change Buffer::Use() to Buffer::New()
PR-URL: https://github.com/nodejs/io.js/pull/1825
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/string_bytes.cc')
-rw-r--r-- | src/string_bytes.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/string_bytes.cc b/src/string_bytes.cc index 36525a73ac..0abdbf85bb 100644 --- a/src/string_bytes.cc +++ b/src/string_bytes.cc @@ -704,7 +704,8 @@ Local<Value> StringBytes::Encode(Isolate* isolate, switch (encoding) { case BUFFER: { - Local<Object> vbuf = Buffer::New(isolate, buf, buflen).ToLocalChecked(); + Local<Object> vbuf = + Buffer::Copy(isolate, buf, buflen).ToLocalChecked(); return scope.Escape(vbuf); } |