Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

Commit 4e18e69

Browse files
committed
Updated directives to support io.js
1 parent 4c3028b commit 4e18e69

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ArrayBuffer.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* static ArrayBuffer* New(const std::string &data)
2828
* static ArrayBuffer* New(const v8::Local<v8::Object> &arrayBuffer)
2929
* static ArrayBuffer* New(const v8::Local<v8::Value> &arg)
30-
*
30+
*
3131
* v8::Local<v8::Object> ToArrayBuffer() const
3232
* v8::Local<v8::String> ToString() const
3333
*
@@ -75,26 +75,26 @@ namespace node {
7575
class ArrayBuffer {
7676
public:
7777
inline static ArrayBuffer* New(const char *str = 0) {
78-
#if NODE_MINOR_VERSION > 11
78+
#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION
7979
return ArrayBuffer::New(v8::Isolate::GetCurrent(), std::string(str));
80-
#else
80+
#else
8181
return ArrayBuffer::New(std::string(str));
8282
#endif
8383
}
8484

8585
inline static ArrayBuffer* New(const std::string &data) {
86-
#if NODE_MINOR_VERSION > 11
86+
#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION
8787
return ArrayBuffer::New(v8::Isolate::GetCurrent(), data.data(), data.size());
8888
#else
8989
return ArrayBuffer::New(data.data(), data.size());
9090
#endif
9191
}
9292

93-
#if NODE_MINOR_VERSION > 11
93+
#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION
9494
inline static ArrayBuffer* New(const char *str, size_t length) {
9595
return ArrayBuffer::New(v8::Isolate::GetCurrent(), str, length);
9696
}
97-
97+
9898
inline static ArrayBuffer* New(const v8::Local<v8::ArrayBuffer> &arrayBuffer) {
9999
return ArrayBuffer::New(v8::Isolate::GetCurrent(), arrayBuffer);
100100
}
@@ -325,7 +325,7 @@ namespace node {
325325
return _len;
326326
}
327327

328-
#if NODE_MINOR_VERSION > 11
328+
#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION
329329
static inline void onDispose(const v8::WeakCallbackData<v8::ArrayBuffer, ArrayBuffer> &info) {
330330
v8::Isolate *isolate = info.GetIsolate();
331331
v8::HandleScope scope(isolate);
@@ -362,22 +362,22 @@ namespace node {
362362

363363
private:
364364
virtual ~ArrayBuffer() {
365-
#if NODE_MINOR_VERSION > 11
365+
#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION
366366
if (_len) {
367367
delete [] _data;
368368
}
369369
#else
370370
_arrayBuffer.ClearWeak();
371371
_arrayBuffer.Dispose();
372-
_arrayBuffer.Clear();
372+
_arrayBuffer.Clear();
373373
#endif
374374
}
375375

376376
protected:
377377
char* _data;
378378
size_t _len;
379379

380-
#if NODE_MINOR_VERSION > 11
380+
#if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION
381381
v8::Persistent<v8::ArrayBuffer> _arrayBuffer;
382382
#else
383383
v8::Persistent<v8::Object> _arrayBuffer;

0 commit comments

Comments
 (0)