Re: [v8-users] ArrayBuffer size is 0

2019-09-02 Thread Jonathan Doster
Simon, Thank you so much for your answer! That makes perfect sense On Sun, Sep 1, 2019 at 10:31 PM 'Simon Zünd' via v8-users < v8-users@googlegroups.com> wrote: > Hey, > > You are not accessing the "size" property, but treat "args[0]" as if it > were a number (which it is not, it's a ArrayBuffer

Re: [v8-users] ArrayBuffer size is 0

2019-09-01 Thread 'Simon Zünd' via v8-users
Hey, You are not accessing the "size" property, but treat "args[0]" as if it were a number (which it is not, it's a ArrayBuffer). Since you have established that args[0] is an ArrayBuffer, you can use cast, which would look roughly like this: Local array_buffer = Local::cast(args[0]); size_t size

[v8-users] ArrayBuffer size is 0

2019-09-01 Thread Jonathan Doster
Hey everyone! I am trying to pass an ArrayBuffer from JS to C++, and when I debug the "size" variable is 0. I do not understand what I am doing wrong, ultimately my goal is to be able to read and write the buffer, copy, etc. Thank you!! var api = require('../src/public/api') api.Method(new Arr