Ben, you're wrong.

  /**
   * Clone this object with a fast but shallow copy.  Values will point
   * to the same values as the original object.
   */
  V8EXPORT Local<Object> Clone();


Cheers,
Fedor.



On Thu, Nov 22, 2012 at 4:08 PM, Ben Noordhuis <[email protected]> wrote:

> On Thu, Nov 22, 2012 at 12:05 PM, Alexey Kupershtokh
> <[email protected]> wrote:
> > I see that almost every framework (underscore, lodash, moo, etc) creates
> its
> > own clone function.
> > But v8 engine already has it.
> > So I've created a module that exposes v8's clone function. Just as a
> proof
> > of concept. It needs assertions and currently fails with a segmentation
> > fault on inputs like null values.
> >
> > https://github.com/AlexeyKupershtokh/node-v8-clone
> >
> > According to the benchmarks it's:
> > 8x faster (50x on 1000-key obj) than this approach:
> > var result = {}; for (i in obj) result[i] = obj[i];
> > 12x faster (450x on 1000-key object) than this approach:
> > var result = {}; for (i in obj) if (obj.hasOwnProperty(i)) result[i] =
> > obj[i];
> >
> > So I wonder if the community needs this module.
> > Also node's core developers are welcome to criticize. Is it ok to expose
> > this function? What are possible drawbacks? Or maybe it's worth to
> include
> > this into the node.js core?
>
> Alexy, I took a quick peek at your module.  Unless I'm missing
> something, it doesn't actually clone any objects, it just casts them
> from one type to another.
>
> --
> 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