diff options
author | Timothy Gu <timothygu99@gmail.com> | 2017-04-03 17:35:17 -0700 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2017-04-12 10:02:59 -0700 |
commit | faa447b256f61d46b4b4963d6bf3e77ccf229e97 (patch) | |
tree | 11b72c2f99d7f071cc342b80bb59eeaef0c34316 /src/util.h | |
parent | ec53921d2e96b4fd7672f69187f6b45b0ab96310 (diff) | |
download | node-new-faa447b256f61d46b4b4963d6bf3e77ccf229e97.tar.gz |
src: allow ArrayBufferView as instance of Buffer
PR-URL: https://github.com/nodejs/node/pull/12223
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.h b/src/util.h index f43ccef8b8..c924209a3c 100644 --- a/src/util.h +++ b/src/util.h @@ -439,8 +439,8 @@ class BufferValue : public MaybeStackBuffer<char> { } while (0) #define SPREAD_BUFFER_ARG(val, name) \ - CHECK((val)->IsUint8Array()); \ - v8::Local<v8::Uint8Array> name = (val).As<v8::Uint8Array>(); \ + CHECK((val)->IsArrayBufferView()); \ + v8::Local<v8::ArrayBufferView> name = (val).As<v8::ArrayBufferView>(); \ v8::ArrayBuffer::Contents name##_c = name->Buffer()->GetContents(); \ const size_t name##_offset = name->ByteOffset(); \ const size_t name##_length = name->ByteLength(); \ |