Skip to content

Use v8::Signature, and other problems with Object example #8

Closed as not planned
@paulharris

Description

@paulharris

Problem 1)
You call ObjectWrap::Unwrap, which grabs the original pointer from This().
Shouldn't it be using Holder() and not This() ?

Problem 2)
Your 06_objects example is missing a critical part of the example - v8::Signature for type safety.
see line 489 here:
https://github.com/laverdet/node-fibers/blob/master/src/fibers.cc

Problem 3)
You create a Persistent global handle for constructor, and then do nothing with it.
This example also won't work for other v8 embedders who might be using v8 in multiple Isolates and threads.

Instead, it should be a plain Local handle (no global constructor handle), and use the Signature technique to ensure type safety.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions