Obtain a Local<Object> from the Arguments& (first element--it's still just
an argument) and then pull out what you need from there.

Handle<Value> SomethingAmazing (const Arguments& args) {
  HandleScope scope;
  Local<Object> obj = Local<Object>::Cast(args[0]);
...


On Sat, Jul 14, 2012 at 12:39 AM, jas <[email protected]> wrote:

> I have been working on creating a custom module and would like to
> implement argument passing as an object vs. the standard comma separated
> list of args and referencing them as arg[0], arg[1] etc.
>
> Upon looking for modules which have used this type of argument passing (IE
> module.setOpts({key: 'value', key: 'value'})) I have found that the use of
> the following constructor/function is necessary
>
>
> v8::Handle<Value> setOpts(v8::Local<Object> opts)
>>
>
> Anyone have any references to module building and how I can obtain this
> functionality? Thanks in advance.
>
>  --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to