@contrast/agent 4.4.1 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/bin/VERSION +1 -1
  2. package/bin/linux/contrast-service +0 -0
  3. package/bin/mac/contrast-service +0 -0
  4. package/bin/windows/contrast-service.exe +0 -0
  5. package/lib/assess/hapi/route-coverage.js +3 -3
  6. package/lib/assess/membrane/index.js +2 -8
  7. package/lib/assess/membrane/source-membrane.js +3 -4
  8. package/lib/assess/models/base-event.js +2 -2
  9. package/lib/assess/models/call-context.js +0 -3
  10. package/lib/assess/policy/propagators.json +20 -0
  11. package/lib/assess/policy/signatures.json +103 -0
  12. package/lib/assess/propagators/path/common.js +165 -36
  13. package/lib/assess/propagators/path/join.js +5 -1
  14. package/lib/assess/propagators/path/normalize.js +5 -1
  15. package/lib/assess/propagators/path/resolve.js +11 -2
  16. package/lib/assess/response-scanning/autocomplete-missing.js +0 -2
  17. package/lib/assess/response-scanning/parameter-pollution.js +0 -2
  18. package/lib/core/arch-components/dynamodb.js +1 -2
  19. package/lib/core/arch-components/dynamodbv3.js +44 -0
  20. package/lib/core/arch-components/index.js +1 -0
  21. package/lib/core/async-storage/hooks/bluebird.js +20 -0
  22. package/lib/core/config/options.js +3 -2
  23. package/lib/core/express/utils.js +1 -1
  24. package/lib/core/logger/debug-logger.js +15 -17
  25. package/lib/core/stacktrace.js +3 -4
  26. package/lib/feature-set.js +2 -1
  27. package/lib/hooks/encoding.js +1 -1
  28. package/lib/hooks/frameworks/base.js +8 -2
  29. package/lib/hooks/frameworks/http.js +23 -16
  30. package/lib/hooks/frameworks/http2.js +73 -0
  31. package/lib/hooks/frameworks/index.js +8 -3
  32. package/lib/hooks/http.js +112 -128
  33. package/lib/hooks/patcher.js +10 -12
  34. package/lib/hooks/require.js +16 -22
  35. package/lib/instrumentation.js +0 -3
  36. package/lib/protect/analysis/aho-corasick.js +13 -30
  37. package/lib/protect/rules/cmd-injection-command-backdoors/backdoor-detector.js +3 -3
  38. package/lib/protect/rules/signatures/reflected-xss/helpers/function-call.js +1 -1
  39. package/lib/protect/rules/xss/helpers/function-call.js +1 -1
  40. package/lib/util/clean-stack.js +1 -1
  41. package/lib/util/clean-string/brackets.js +3 -3
  42. package/lib/util/clean-string/concatenations.js +1 -1
  43. package/lib/util/clean-string/util.js +1 -2
  44. package/lib/util/ip-analyzer.js +1 -1
  45. package/lib/util/some.js +27 -0
  46. package/lib/util/xml-analyzer/external-entity-finder.js +1 -1
  47. package/package.json +14 -15
  48. package/lib/hooks/frameworks/https.js +0 -42
  49. package/node_modules/bindings/LICENSE.md +0 -22
  50. package/node_modules/bindings/README.md +0 -98
  51. package/node_modules/bindings/bindings.js +0 -221
  52. package/node_modules/bindings/package.json +0 -32
  53. package/node_modules/file-uri-to-path/.npmignore +0 -1
  54. package/node_modules/file-uri-to-path/.travis.yml +0 -30
  55. package/node_modules/file-uri-to-path/History.md +0 -21
  56. package/node_modules/file-uri-to-path/LICENSE +0 -20
  57. package/node_modules/file-uri-to-path/README.md +0 -74
  58. package/node_modules/file-uri-to-path/index.d.ts +0 -2
  59. package/node_modules/file-uri-to-path/index.js +0 -66
  60. package/node_modules/file-uri-to-path/package.json +0 -36
  61. package/node_modules/file-uri-to-path/test/test.js +0 -24
  62. package/node_modules/file-uri-to-path/test/tests.json +0 -13
  63. package/node_modules/glossy/LICENSE +0 -19
  64. package/node_modules/glossy/README.md +0 -129
  65. package/node_modules/glossy/index.js +0 -12
  66. package/node_modules/glossy/lib/glossy/parse.js +0 -520
  67. package/node_modules/glossy/lib/glossy/produce.js +0 -459
  68. package/node_modules/glossy/package.json +0 -47
  69. package/node_modules/glossy/test/decide.js +0 -7
  70. package/node_modules/glossy/test/decode_pri.js +0 -24
  71. package/node_modules/glossy/test/parse_3164.js +0 -104
  72. package/node_modules/glossy/test/parse_5424.js +0 -106
  73. package/node_modules/glossy/test/parse_5848.js +0 -40
  74. package/node_modules/glossy/test/parse_8601.js +0 -14
  75. package/node_modules/glossy/test/parse_rfc3339.js +0 -9
  76. package/node_modules/glossy/test/produce.js +0 -162
  77. package/node_modules/glossy/test/runner.js +0 -40
  78. package/node_modules/glossy/test/structure_data.js +0 -24
  79. package/node_modules/nan/CHANGELOG.md +0 -537
  80. package/node_modules/nan/LICENSE.md +0 -13
  81. package/node_modules/nan/README.md +0 -455
  82. package/node_modules/nan/doc/asyncworker.md +0 -146
  83. package/node_modules/nan/doc/buffers.md +0 -54
  84. package/node_modules/nan/doc/callback.md +0 -76
  85. package/node_modules/nan/doc/converters.md +0 -41
  86. package/node_modules/nan/doc/errors.md +0 -226
  87. package/node_modules/nan/doc/json.md +0 -62
  88. package/node_modules/nan/doc/maybe_types.md +0 -583
  89. package/node_modules/nan/doc/methods.md +0 -664
  90. package/node_modules/nan/doc/new.md +0 -147
  91. package/node_modules/nan/doc/node_misc.md +0 -123
  92. package/node_modules/nan/doc/object_wrappers.md +0 -263
  93. package/node_modules/nan/doc/persistent.md +0 -296
  94. package/node_modules/nan/doc/scopes.md +0 -73
  95. package/node_modules/nan/doc/script.md +0 -38
  96. package/node_modules/nan/doc/string_bytes.md +0 -62
  97. package/node_modules/nan/doc/v8_internals.md +0 -199
  98. package/node_modules/nan/doc/v8_misc.md +0 -85
  99. package/node_modules/nan/include_dirs.js +0 -1
  100. package/node_modules/nan/nan.h +0 -2898
  101. package/node_modules/nan/nan_callbacks.h +0 -88
  102. package/node_modules/nan/nan_callbacks_12_inl.h +0 -514
  103. package/node_modules/nan/nan_callbacks_pre_12_inl.h +0 -520
  104. package/node_modules/nan/nan_converters.h +0 -72
  105. package/node_modules/nan/nan_converters_43_inl.h +0 -68
  106. package/node_modules/nan/nan_converters_pre_43_inl.h +0 -42
  107. package/node_modules/nan/nan_define_own_property_helper.h +0 -29
  108. package/node_modules/nan/nan_implementation_12_inl.h +0 -430
  109. package/node_modules/nan/nan_implementation_pre_12_inl.h +0 -263
  110. package/node_modules/nan/nan_json.h +0 -166
  111. package/node_modules/nan/nan_maybe_43_inl.h +0 -356
  112. package/node_modules/nan/nan_maybe_pre_43_inl.h +0 -268
  113. package/node_modules/nan/nan_new.h +0 -340
  114. package/node_modules/nan/nan_object_wrap.h +0 -156
  115. package/node_modules/nan/nan_persistent_12_inl.h +0 -132
  116. package/node_modules/nan/nan_persistent_pre_12_inl.h +0 -242
  117. package/node_modules/nan/nan_private.h +0 -73
  118. package/node_modules/nan/nan_string_bytes.h +0 -305
  119. package/node_modules/nan/nan_typedarray_contents.h +0 -96
  120. package/node_modules/nan/nan_weak.h +0 -437
  121. package/node_modules/nan/package.json +0 -41
  122. package/node_modules/nan/tools/1to2.js +0 -412
  123. package/node_modules/nan/tools/README.md +0 -14
  124. package/node_modules/nan/tools/package.json +0 -19
  125. package/node_modules/unix-dgram/LICENSE +0 -13
  126. package/node_modules/unix-dgram/README.md +0 -107
  127. package/node_modules/unix-dgram/binding.gyp +0 -20
  128. package/node_modules/unix-dgram/build/Makefile +0 -324
  129. package/node_modules/unix-dgram/build/Release/.deps/Release/obj.target/unix_dgram/src/unix_dgram.o.d +0 -58
  130. package/node_modules/unix-dgram/build/Release/.deps/Release/obj.target/unix_dgram.node.d +0 -1
  131. package/node_modules/unix-dgram/build/Release/.deps/Release/unix_dgram.node.d +0 -1
  132. package/node_modules/unix-dgram/build/Release/obj.target/unix_dgram/src/unix_dgram.o +0 -0
  133. package/node_modules/unix-dgram/build/Release/obj.target/unix_dgram.node +0 -0
  134. package/node_modules/unix-dgram/build/Release/unix_dgram.node +0 -0
  135. package/node_modules/unix-dgram/build/binding.Makefile +0 -6
  136. package/node_modules/unix-dgram/build/config.gypi +0 -213
  137. package/node_modules/unix-dgram/build/unix_dgram.target.mk +0 -159
  138. package/node_modules/unix-dgram/lib/unix_dgram.js +0 -168
  139. package/node_modules/unix-dgram/package.json +0 -36
  140. package/node_modules/unix-dgram/src/unix_dgram.cc +0 -404
  141. package/node_modules/unix-dgram/src/win_dummy.cc +0 -7
  142. package/node_modules/unix-dgram/test/test-connect-callback.js +0 -68
  143. package/node_modules/unix-dgram/test/test-connect.js +0 -53
  144. package/node_modules/unix-dgram/test/test-dgram-unix.js +0 -58
  145. package/node_modules/unix-dgram/test/test-send-error.js +0 -26
  146. package/node_modules/winston-syslog/.eslintrc +0 -7
  147. package/node_modules/winston-syslog/.travis.yml +0 -14
  148. package/node_modules/winston-syslog/CHANGELOG.md +0 -9
  149. package/node_modules/winston-syslog/LICENSE +0 -20
  150. package/node_modules/winston-syslog/README.md +0 -135
  151. package/node_modules/winston-syslog/lib/utils.js +0 -26
  152. package/node_modules/winston-syslog/lib/winston-syslog.js +0 -385
  153. package/node_modules/winston-syslog/package.json +0 -56
  154. package/node_modules/winston-syslog/test/format-test.js +0 -122
  155. package/node_modules/winston-syslog/test/syslog-test.js +0 -95
  156. package/node_modules/winston-syslog/test/unix-connect-test.js +0 -133
@@ -1,88 +0,0 @@
1
- /*********************************************************************
2
- * NAN - Native Abstractions for Node.js
3
- *
4
- * Copyright (c) 2018 NAN contributors
5
- *
6
- * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
7
- ********************************************************************/
8
-
9
- #ifndef NAN_CALLBACKS_H_
10
- #define NAN_CALLBACKS_H_
11
-
12
- template<typename T> class FunctionCallbackInfo;
13
- template<typename T> class PropertyCallbackInfo;
14
- template<typename T> class Global;
15
-
16
- typedef void(*FunctionCallback)(const FunctionCallbackInfo<v8::Value>&);
17
- typedef void(*GetterCallback)
18
- (v8::Local<v8::String>, const PropertyCallbackInfo<v8::Value>&);
19
- typedef void(*SetterCallback)(
20
- v8::Local<v8::String>,
21
- v8::Local<v8::Value>,
22
- const PropertyCallbackInfo<void>&);
23
- typedef void(*PropertyGetterCallback)(
24
- v8::Local<v8::String>,
25
- const PropertyCallbackInfo<v8::Value>&);
26
- typedef void(*PropertySetterCallback)(
27
- v8::Local<v8::String>,
28
- v8::Local<v8::Value>,
29
- const PropertyCallbackInfo<v8::Value>&);
30
- typedef void(*PropertyEnumeratorCallback)
31
- (const PropertyCallbackInfo<v8::Array>&);
32
- typedef void(*PropertyDeleterCallback)(
33
- v8::Local<v8::String>,
34
- const PropertyCallbackInfo<v8::Boolean>&);
35
- typedef void(*PropertyQueryCallback)(
36
- v8::Local<v8::String>,
37
- const PropertyCallbackInfo<v8::Integer>&);
38
- typedef void(*IndexGetterCallback)(
39
- uint32_t,
40
- const PropertyCallbackInfo<v8::Value>&);
41
- typedef void(*IndexSetterCallback)(
42
- uint32_t,
43
- v8::Local<v8::Value>,
44
- const PropertyCallbackInfo<v8::Value>&);
45
- typedef void(*IndexEnumeratorCallback)
46
- (const PropertyCallbackInfo<v8::Array>&);
47
- typedef void(*IndexDeleterCallback)(
48
- uint32_t,
49
- const PropertyCallbackInfo<v8::Boolean>&);
50
- typedef void(*IndexQueryCallback)(
51
- uint32_t,
52
- const PropertyCallbackInfo<v8::Integer>&);
53
-
54
- namespace imp {
55
- typedef v8::Local<v8::AccessorSignature> Sig;
56
-
57
- static const int kDataIndex = 0;
58
-
59
- static const int kFunctionIndex = 1;
60
- static const int kFunctionFieldCount = 2;
61
-
62
- static const int kGetterIndex = 1;
63
- static const int kSetterIndex = 2;
64
- static const int kAccessorFieldCount = 3;
65
-
66
- static const int kPropertyGetterIndex = 1;
67
- static const int kPropertySetterIndex = 2;
68
- static const int kPropertyEnumeratorIndex = 3;
69
- static const int kPropertyDeleterIndex = 4;
70
- static const int kPropertyQueryIndex = 5;
71
- static const int kPropertyFieldCount = 6;
72
-
73
- static const int kIndexPropertyGetterIndex = 1;
74
- static const int kIndexPropertySetterIndex = 2;
75
- static const int kIndexPropertyEnumeratorIndex = 3;
76
- static const int kIndexPropertyDeleterIndex = 4;
77
- static const int kIndexPropertyQueryIndex = 5;
78
- static const int kIndexPropertyFieldCount = 6;
79
-
80
- } // end of namespace imp
81
-
82
- #if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
83
- # include "nan_callbacks_12_inl.h" // NOLINT(build/include)
84
- #else
85
- # include "nan_callbacks_pre_12_inl.h" // NOLINT(build/include)
86
- #endif
87
-
88
- #endif // NAN_CALLBACKS_H_
@@ -1,514 +0,0 @@
1
- /*********************************************************************
2
- * NAN - Native Abstractions for Node.js
3
- *
4
- * Copyright (c) 2018 NAN contributors
5
- *
6
- * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
7
- ********************************************************************/
8
-
9
- #ifndef NAN_CALLBACKS_12_INL_H_
10
- #define NAN_CALLBACKS_12_INL_H_
11
-
12
- template<typename T>
13
- class ReturnValue {
14
- v8::ReturnValue<T> value_;
15
-
16
- public:
17
- template <class S>
18
- explicit inline ReturnValue(const v8::ReturnValue<S> &value) :
19
- value_(value) {}
20
- template <class S>
21
- explicit inline ReturnValue(const ReturnValue<S>& that)
22
- : value_(that.value_) {
23
- TYPE_CHECK(T, S);
24
- }
25
-
26
- // Handle setters
27
- template <typename S> inline void Set(const v8::Local<S> &handle) {
28
- TYPE_CHECK(T, S);
29
- value_.Set(handle);
30
- }
31
-
32
- template <typename S> inline void Set(const Global<S> &handle) {
33
- TYPE_CHECK(T, S);
34
- #if defined(V8_MAJOR_VERSION) && (V8_MAJOR_VERSION > 4 || \
35
- (V8_MAJOR_VERSION == 4 && defined(V8_MINOR_VERSION) && \
36
- (V8_MINOR_VERSION > 5 || (V8_MINOR_VERSION == 5 && \
37
- defined(V8_BUILD_NUMBER) && V8_BUILD_NUMBER >= 8))))
38
- value_.Set(handle);
39
- #else
40
- value_.Set(*reinterpret_cast<const v8::Persistent<S>*>(&handle));
41
- const_cast<Global<S> &>(handle).Reset();
42
- #endif
43
- }
44
-
45
- // Fast primitive setters
46
- inline void Set(bool value) {
47
- TYPE_CHECK(T, v8::Boolean);
48
- value_.Set(value);
49
- }
50
-
51
- inline void Set(double i) {
52
- TYPE_CHECK(T, v8::Number);
53
- value_.Set(i);
54
- }
55
-
56
- inline void Set(int32_t i) {
57
- TYPE_CHECK(T, v8::Integer);
58
- value_.Set(i);
59
- }
60
-
61
- inline void Set(uint32_t i) {
62
- TYPE_CHECK(T, v8::Integer);
63
- value_.Set(i);
64
- }
65
-
66
- // Fast JS primitive setters
67
- inline void SetNull() {
68
- TYPE_CHECK(T, v8::Primitive);
69
- value_.SetNull();
70
- }
71
-
72
- inline void SetUndefined() {
73
- TYPE_CHECK(T, v8::Primitive);
74
- value_.SetUndefined();
75
- }
76
-
77
- inline void SetEmptyString() {
78
- TYPE_CHECK(T, v8::String);
79
- value_.SetEmptyString();
80
- }
81
-
82
- // Convenience getter for isolate
83
- inline v8::Isolate *GetIsolate() const {
84
- return value_.GetIsolate();
85
- }
86
-
87
- // Pointer setter: Uncompilable to prevent inadvertent misuse.
88
- template<typename S>
89
- inline void Set(S *whatever) { TYPE_CHECK(S*, v8::Primitive); }
90
- };
91
-
92
- template<typename T>
93
- class FunctionCallbackInfo {
94
- const v8::FunctionCallbackInfo<T> &info_;
95
- const v8::Local<v8::Value> data_;
96
-
97
- public:
98
- explicit inline FunctionCallbackInfo(
99
- const v8::FunctionCallbackInfo<T> &info
100
- , v8::Local<v8::Value> data) :
101
- info_(info)
102
- , data_(data) {}
103
-
104
- inline ReturnValue<T> GetReturnValue() const {
105
- return ReturnValue<T>(info_.GetReturnValue());
106
- }
107
-
108
- #if NODE_MAJOR_VERSION < 10
109
- inline v8::Local<v8::Function> Callee() const { return info_.Callee(); }
110
- #endif
111
- inline v8::Local<v8::Value> Data() const { return data_; }
112
- inline v8::Local<v8::Object> Holder() const { return info_.Holder(); }
113
- inline bool IsConstructCall() const { return info_.IsConstructCall(); }
114
- inline int Length() const { return info_.Length(); }
115
- inline v8::Local<v8::Value> operator[](int i) const { return info_[i]; }
116
- inline v8::Local<v8::Object> This() const { return info_.This(); }
117
- inline v8::Isolate *GetIsolate() const { return info_.GetIsolate(); }
118
-
119
-
120
- protected:
121
- static const int kHolderIndex = 0;
122
- static const int kIsolateIndex = 1;
123
- static const int kReturnValueDefaultValueIndex = 2;
124
- static const int kReturnValueIndex = 3;
125
- static const int kDataIndex = 4;
126
- static const int kCalleeIndex = 5;
127
- static const int kContextSaveIndex = 6;
128
- static const int kArgsLength = 7;
129
-
130
- private:
131
- NAN_DISALLOW_ASSIGN_COPY_MOVE(FunctionCallbackInfo)
132
- };
133
-
134
- template<typename T>
135
- class PropertyCallbackInfo {
136
- const v8::PropertyCallbackInfo<T> &info_;
137
- const v8::Local<v8::Value> data_;
138
-
139
- public:
140
- explicit inline PropertyCallbackInfo(
141
- const v8::PropertyCallbackInfo<T> &info
142
- , const v8::Local<v8::Value> data) :
143
- info_(info)
144
- , data_(data) {}
145
-
146
- inline v8::Isolate* GetIsolate() const { return info_.GetIsolate(); }
147
- inline v8::Local<v8::Value> Data() const { return data_; }
148
- inline v8::Local<v8::Object> This() const { return info_.This(); }
149
- inline v8::Local<v8::Object> Holder() const { return info_.Holder(); }
150
- inline ReturnValue<T> GetReturnValue() const {
151
- return ReturnValue<T>(info_.GetReturnValue());
152
- }
153
-
154
- protected:
155
- static const int kHolderIndex = 0;
156
- static const int kIsolateIndex = 1;
157
- static const int kReturnValueDefaultValueIndex = 2;
158
- static const int kReturnValueIndex = 3;
159
- static const int kDataIndex = 4;
160
- static const int kThisIndex = 5;
161
- static const int kArgsLength = 6;
162
-
163
- private:
164
- NAN_DISALLOW_ASSIGN_COPY_MOVE(PropertyCallbackInfo)
165
- };
166
-
167
- namespace imp {
168
- static
169
- void FunctionCallbackWrapper(const v8::FunctionCallbackInfo<v8::Value> &info) {
170
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
171
- FunctionCallback callback = reinterpret_cast<FunctionCallback>(
172
- reinterpret_cast<intptr_t>(
173
- obj->GetInternalField(kFunctionIndex).As<v8::External>()->Value()));
174
- FunctionCallbackInfo<v8::Value>
175
- cbinfo(info, obj->GetInternalField(kDataIndex));
176
- callback(cbinfo);
177
- }
178
-
179
- typedef void (*NativeFunction)(const v8::FunctionCallbackInfo<v8::Value> &);
180
-
181
- #if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
182
- static
183
- void GetterCallbackWrapper(
184
- v8::Local<v8::Name> property
185
- , const v8::PropertyCallbackInfo<v8::Value> &info) {
186
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
187
- PropertyCallbackInfo<v8::Value>
188
- cbinfo(info, obj->GetInternalField(kDataIndex));
189
- GetterCallback callback = reinterpret_cast<GetterCallback>(
190
- reinterpret_cast<intptr_t>(
191
- obj->GetInternalField(kGetterIndex).As<v8::External>()->Value()));
192
- callback(property.As<v8::String>(), cbinfo);
193
- }
194
-
195
- typedef void (*NativeGetter)
196
- (v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &);
197
-
198
- static
199
- void SetterCallbackWrapper(
200
- v8::Local<v8::Name> property
201
- , v8::Local<v8::Value> value
202
- , const v8::PropertyCallbackInfo<void> &info) {
203
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
204
- PropertyCallbackInfo<void>
205
- cbinfo(info, obj->GetInternalField(kDataIndex));
206
- SetterCallback callback = reinterpret_cast<SetterCallback>(
207
- reinterpret_cast<intptr_t>(
208
- obj->GetInternalField(kSetterIndex).As<v8::External>()->Value()));
209
- callback(property.As<v8::String>(), value, cbinfo);
210
- }
211
-
212
- typedef void (*NativeSetter)(
213
- v8::Local<v8::Name>
214
- , v8::Local<v8::Value>
215
- , const v8::PropertyCallbackInfo<void> &);
216
- #else
217
- static
218
- void GetterCallbackWrapper(
219
- v8::Local<v8::String> property
220
- , const v8::PropertyCallbackInfo<v8::Value> &info) {
221
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
222
- PropertyCallbackInfo<v8::Value>
223
- cbinfo(info, obj->GetInternalField(kDataIndex));
224
- GetterCallback callback = reinterpret_cast<GetterCallback>(
225
- reinterpret_cast<intptr_t>(
226
- obj->GetInternalField(kGetterIndex).As<v8::External>()->Value()));
227
- callback(property, cbinfo);
228
- }
229
-
230
- typedef void (*NativeGetter)
231
- (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &);
232
-
233
- static
234
- void SetterCallbackWrapper(
235
- v8::Local<v8::String> property
236
- , v8::Local<v8::Value> value
237
- , const v8::PropertyCallbackInfo<void> &info) {
238
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
239
- PropertyCallbackInfo<void>
240
- cbinfo(info, obj->GetInternalField(kDataIndex));
241
- SetterCallback callback = reinterpret_cast<SetterCallback>(
242
- reinterpret_cast<intptr_t>(
243
- obj->GetInternalField(kSetterIndex).As<v8::External>()->Value()));
244
- callback(property, value, cbinfo);
245
- }
246
-
247
- typedef void (*NativeSetter)(
248
- v8::Local<v8::String>
249
- , v8::Local<v8::Value>
250
- , const v8::PropertyCallbackInfo<void> &);
251
- #endif
252
-
253
- #if NODE_MODULE_VERSION > NODE_0_12_MODULE_VERSION
254
- static
255
- void PropertyGetterCallbackWrapper(
256
- v8::Local<v8::Name> property
257
- , const v8::PropertyCallbackInfo<v8::Value> &info) {
258
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
259
- PropertyCallbackInfo<v8::Value>
260
- cbinfo(info, obj->GetInternalField(kDataIndex));
261
- PropertyGetterCallback callback = reinterpret_cast<PropertyGetterCallback>(
262
- reinterpret_cast<intptr_t>(
263
- obj->GetInternalField(kPropertyGetterIndex)
264
- .As<v8::External>()->Value()));
265
- callback(property.As<v8::String>(), cbinfo);
266
- }
267
-
268
- typedef void (*NativePropertyGetter)
269
- (v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &);
270
-
271
- static
272
- void PropertySetterCallbackWrapper(
273
- v8::Local<v8::Name> property
274
- , v8::Local<v8::Value> value
275
- , const v8::PropertyCallbackInfo<v8::Value> &info) {
276
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
277
- PropertyCallbackInfo<v8::Value>
278
- cbinfo(info, obj->GetInternalField(kDataIndex));
279
- PropertySetterCallback callback = reinterpret_cast<PropertySetterCallback>(
280
- reinterpret_cast<intptr_t>(
281
- obj->GetInternalField(kPropertySetterIndex)
282
- .As<v8::External>()->Value()));
283
- callback(property.As<v8::String>(), value, cbinfo);
284
- }
285
-
286
- typedef void (*NativePropertySetter)(
287
- v8::Local<v8::Name>
288
- , v8::Local<v8::Value>
289
- , const v8::PropertyCallbackInfo<v8::Value> &);
290
-
291
- static
292
- void PropertyEnumeratorCallbackWrapper(
293
- const v8::PropertyCallbackInfo<v8::Array> &info) {
294
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
295
- PropertyCallbackInfo<v8::Array>
296
- cbinfo(info, obj->GetInternalField(kDataIndex));
297
- PropertyEnumeratorCallback callback =
298
- reinterpret_cast<PropertyEnumeratorCallback>(reinterpret_cast<intptr_t>(
299
- obj->GetInternalField(kPropertyEnumeratorIndex)
300
- .As<v8::External>()->Value()));
301
- callback(cbinfo);
302
- }
303
-
304
- typedef void (*NativePropertyEnumerator)
305
- (const v8::PropertyCallbackInfo<v8::Array> &);
306
-
307
- static
308
- void PropertyDeleterCallbackWrapper(
309
- v8::Local<v8::Name> property
310
- , const v8::PropertyCallbackInfo<v8::Boolean> &info) {
311
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
312
- PropertyCallbackInfo<v8::Boolean>
313
- cbinfo(info, obj->GetInternalField(kDataIndex));
314
- PropertyDeleterCallback callback = reinterpret_cast<PropertyDeleterCallback>(
315
- reinterpret_cast<intptr_t>(
316
- obj->GetInternalField(kPropertyDeleterIndex)
317
- .As<v8::External>()->Value()));
318
- callback(property.As<v8::String>(), cbinfo);
319
- }
320
-
321
- typedef void (NativePropertyDeleter)
322
- (v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Boolean> &);
323
-
324
- static
325
- void PropertyQueryCallbackWrapper(
326
- v8::Local<v8::Name> property
327
- , const v8::PropertyCallbackInfo<v8::Integer> &info) {
328
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
329
- PropertyCallbackInfo<v8::Integer>
330
- cbinfo(info, obj->GetInternalField(kDataIndex));
331
- PropertyQueryCallback callback = reinterpret_cast<PropertyQueryCallback>(
332
- reinterpret_cast<intptr_t>(
333
- obj->GetInternalField(kPropertyQueryIndex)
334
- .As<v8::External>()->Value()));
335
- callback(property.As<v8::String>(), cbinfo);
336
- }
337
-
338
- typedef void (*NativePropertyQuery)
339
- (v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Integer> &);
340
- #else
341
- static
342
- void PropertyGetterCallbackWrapper(
343
- v8::Local<v8::String> property
344
- , const v8::PropertyCallbackInfo<v8::Value> &info) {
345
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
346
- PropertyCallbackInfo<v8::Value>
347
- cbinfo(info, obj->GetInternalField(kDataIndex));
348
- PropertyGetterCallback callback = reinterpret_cast<PropertyGetterCallback>(
349
- reinterpret_cast<intptr_t>(
350
- obj->GetInternalField(kPropertyGetterIndex)
351
- .As<v8::External>()->Value()));
352
- callback(property, cbinfo);
353
- }
354
-
355
- typedef void (*NativePropertyGetter)
356
- (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value> &);
357
-
358
- static
359
- void PropertySetterCallbackWrapper(
360
- v8::Local<v8::String> property
361
- , v8::Local<v8::Value> value
362
- , const v8::PropertyCallbackInfo<v8::Value> &info) {
363
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
364
- PropertyCallbackInfo<v8::Value>
365
- cbinfo(info, obj->GetInternalField(kDataIndex));
366
- PropertySetterCallback callback = reinterpret_cast<PropertySetterCallback>(
367
- reinterpret_cast<intptr_t>(
368
- obj->GetInternalField(kPropertySetterIndex)
369
- .As<v8::External>()->Value()));
370
- callback(property, value, cbinfo);
371
- }
372
-
373
- typedef void (*NativePropertySetter)(
374
- v8::Local<v8::String>
375
- , v8::Local<v8::Value>
376
- , const v8::PropertyCallbackInfo<v8::Value> &);
377
-
378
- static
379
- void PropertyEnumeratorCallbackWrapper(
380
- const v8::PropertyCallbackInfo<v8::Array> &info) {
381
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
382
- PropertyCallbackInfo<v8::Array>
383
- cbinfo(info, obj->GetInternalField(kDataIndex));
384
- PropertyEnumeratorCallback callback =
385
- reinterpret_cast<PropertyEnumeratorCallback>(reinterpret_cast<intptr_t>(
386
- obj->GetInternalField(kPropertyEnumeratorIndex)
387
- .As<v8::External>()->Value()));
388
- callback(cbinfo);
389
- }
390
-
391
- typedef void (*NativePropertyEnumerator)
392
- (const v8::PropertyCallbackInfo<v8::Array> &);
393
-
394
- static
395
- void PropertyDeleterCallbackWrapper(
396
- v8::Local<v8::String> property
397
- , const v8::PropertyCallbackInfo<v8::Boolean> &info) {
398
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
399
- PropertyCallbackInfo<v8::Boolean>
400
- cbinfo(info, obj->GetInternalField(kDataIndex));
401
- PropertyDeleterCallback callback = reinterpret_cast<PropertyDeleterCallback>(
402
- reinterpret_cast<intptr_t>(
403
- obj->GetInternalField(kPropertyDeleterIndex)
404
- .As<v8::External>()->Value()));
405
- callback(property, cbinfo);
406
- }
407
-
408
- typedef void (NativePropertyDeleter)
409
- (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Boolean> &);
410
-
411
- static
412
- void PropertyQueryCallbackWrapper(
413
- v8::Local<v8::String> property
414
- , const v8::PropertyCallbackInfo<v8::Integer> &info) {
415
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
416
- PropertyCallbackInfo<v8::Integer>
417
- cbinfo(info, obj->GetInternalField(kDataIndex));
418
- PropertyQueryCallback callback = reinterpret_cast<PropertyQueryCallback>(
419
- reinterpret_cast<intptr_t>(
420
- obj->GetInternalField(kPropertyQueryIndex)
421
- .As<v8::External>()->Value()));
422
- callback(property, cbinfo);
423
- }
424
-
425
- typedef void (*NativePropertyQuery)
426
- (v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Integer> &);
427
- #endif
428
-
429
- static
430
- void IndexGetterCallbackWrapper(
431
- uint32_t index, const v8::PropertyCallbackInfo<v8::Value> &info) {
432
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
433
- PropertyCallbackInfo<v8::Value>
434
- cbinfo(info, obj->GetInternalField(kDataIndex));
435
- IndexGetterCallback callback = reinterpret_cast<IndexGetterCallback>(
436
- reinterpret_cast<intptr_t>(
437
- obj->GetInternalField(kIndexPropertyGetterIndex)
438
- .As<v8::External>()->Value()));
439
- callback(index, cbinfo);
440
- }
441
-
442
- typedef void (*NativeIndexGetter)
443
- (uint32_t, const v8::PropertyCallbackInfo<v8::Value> &);
444
-
445
- static
446
- void IndexSetterCallbackWrapper(
447
- uint32_t index
448
- , v8::Local<v8::Value> value
449
- , const v8::PropertyCallbackInfo<v8::Value> &info) {
450
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
451
- PropertyCallbackInfo<v8::Value>
452
- cbinfo(info, obj->GetInternalField(kDataIndex));
453
- IndexSetterCallback callback = reinterpret_cast<IndexSetterCallback>(
454
- reinterpret_cast<intptr_t>(
455
- obj->GetInternalField(kIndexPropertySetterIndex)
456
- .As<v8::External>()->Value()));
457
- callback(index, value, cbinfo);
458
- }
459
-
460
- typedef void (*NativeIndexSetter)(
461
- uint32_t
462
- , v8::Local<v8::Value>
463
- , const v8::PropertyCallbackInfo<v8::Value> &);
464
-
465
- static
466
- void IndexEnumeratorCallbackWrapper(
467
- const v8::PropertyCallbackInfo<v8::Array> &info) {
468
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
469
- PropertyCallbackInfo<v8::Array>
470
- cbinfo(info, obj->GetInternalField(kDataIndex));
471
- IndexEnumeratorCallback callback = reinterpret_cast<IndexEnumeratorCallback>(
472
- reinterpret_cast<intptr_t>(
473
- obj->GetInternalField(
474
- kIndexPropertyEnumeratorIndex).As<v8::External>()->Value()));
475
- callback(cbinfo);
476
- }
477
-
478
- typedef void (*NativeIndexEnumerator)
479
- (const v8::PropertyCallbackInfo<v8::Array> &);
480
-
481
- static
482
- void IndexDeleterCallbackWrapper(
483
- uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean> &info) {
484
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
485
- PropertyCallbackInfo<v8::Boolean>
486
- cbinfo(info, obj->GetInternalField(kDataIndex));
487
- IndexDeleterCallback callback = reinterpret_cast<IndexDeleterCallback>(
488
- reinterpret_cast<intptr_t>(
489
- obj->GetInternalField(kIndexPropertyDeleterIndex)
490
- .As<v8::External>()->Value()));
491
- callback(index, cbinfo);
492
- }
493
-
494
- typedef void (*NativeIndexDeleter)
495
- (uint32_t, const v8::PropertyCallbackInfo<v8::Boolean> &);
496
-
497
- static
498
- void IndexQueryCallbackWrapper(
499
- uint32_t index, const v8::PropertyCallbackInfo<v8::Integer> &info) {
500
- v8::Local<v8::Object> obj = info.Data().As<v8::Object>();
501
- PropertyCallbackInfo<v8::Integer>
502
- cbinfo(info, obj->GetInternalField(kDataIndex));
503
- IndexQueryCallback callback = reinterpret_cast<IndexQueryCallback>(
504
- reinterpret_cast<intptr_t>(
505
- obj->GetInternalField(kIndexPropertyQueryIndex)
506
- .As<v8::External>()->Value()));
507
- callback(index, cbinfo);
508
- }
509
-
510
- typedef void (*NativeIndexQuery)
511
- (uint32_t, const v8::PropertyCallbackInfo<v8::Integer> &);
512
- } // end of namespace imp
513
-
514
- #endif // NAN_CALLBACKS_12_INL_H_