~yolanda.robla/ubuntu/trusty/nodejs/add_distribution

« back to all changes in this revision

Viewing changes to src/node_object_wrap.h

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2013-08-14 00:16:46 UTC
  • mfrom: (7.1.40 sid)
  • Revision ID: package-import@ubuntu.com-20130814001646-bzlysfh8sd6mukbo
Tags: 0.10.15~dfsg1-4
* Update 2005 patch, adding a handful of tests that can fail on
  slow platforms.
* Add 1004 patch to fix test failures when writing NaN to buffer
  on mipsel.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#ifndef object_wrap_h
23
23
#define object_wrap_h
24
24
 
25
 
#include <node.h>
26
 
#include <v8.h>
 
25
#include "node.h"
 
26
#include "v8.h"
27
27
#include <assert.h>
28
28
 
 
29
// Explicitly instantiate some template classes, so we're sure they will be
 
30
// present in the binary / shared object. There isn't much doubt that they will
 
31
// be, but MSVC tends to complain about these things.
 
32
#ifdef _MSC_VER
 
33
  template class NODE_EXTERN v8::Persistent<v8::Object>;
 
34
  template class NODE_EXTERN v8::Persistent<v8::FunctionTemplate>;
 
35
#endif
 
36
 
 
37
 
29
38
namespace node {
30
39
 
31
40
class NODE_EXTERN ObjectWrap {
39
48
    if (!handle_.IsEmpty()) {
40
49
      assert(handle_.IsNearDeath());
41
50
      handle_.ClearWeak();
42
 
      handle_->SetInternalField(0, v8::Undefined());
 
51
      handle_->SetPointerInInternalField(0, 0);
43
52
      handle_.Dispose();
44
53
      handle_.Clear();
45
54
    }
103
112
 
104
113
 private:
105
114
  static void WeakCallback (v8::Persistent<v8::Value> value, void *data) {
 
115
    v8::HandleScope scope;
 
116
 
106
117
    ObjectWrap *obj = static_cast<ObjectWrap*>(data);
107
118
    assert(value == obj->handle_);
108
119
    assert(!obj->refs_);