@contrast/agent 4.5.1 → 4.7.1
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.
- package/bin/VERSION +1 -1
- package/bin/linux/contrast-service +0 -0
- package/bin/mac/contrast-service +0 -0
- package/bin/windows/contrast-service.exe +0 -0
- package/lib/assess/membrane/deserialization-membrane.js +4 -5
- package/lib/assess/membrane/source-membrane.js +16 -33
- package/lib/assess/models/call-context.js +1 -1
- package/lib/assess/policy/propagators.json +19 -21
- package/lib/assess/policy/rules.json +7 -2
- package/lib/assess/policy/signatures.json +42 -0
- package/lib/assess/policy/util.js +2 -1
- package/lib/assess/propagators/JSON/parse.js +1 -1
- package/lib/assess/propagators/JSON/stringify.js +3 -3
- package/lib/assess/propagators/array-prototype-join.js +7 -8
- package/lib/assess/propagators/common.js +7 -5
- package/lib/assess/propagators/dustjs/escape-html.js +22 -0
- package/lib/assess/propagators/dustjs/escape-js.js +22 -0
- package/lib/assess/propagators/encode-uri/encode-uri-component.js +22 -0
- package/lib/assess/propagators/encode-uri/encode-uri.js +22 -0
- package/lib/assess/propagators/handlebars-escape-expresssion.js +1 -1
- package/lib/assess/propagators/index.js +0 -2
- package/lib/assess/propagators/joi/boolean.js +1 -1
- package/lib/assess/propagators/joi/expression.js +1 -1
- package/lib/assess/propagators/joi/number.js +1 -1
- package/lib/assess/propagators/joi/string-base.js +1 -1
- package/lib/assess/propagators/joi/string-schema.js +12 -13
- package/lib/assess/propagators/joi/values.js +37 -22
- package/lib/assess/propagators/manager.js +12 -10
- package/lib/assess/propagators/mongoose/helpers.js +20 -0
- package/lib/assess/propagators/mongoose/index.js +18 -0
- package/lib/assess/propagators/mongoose/map.js +74 -0
- package/lib/assess/propagators/mongoose/string.js +104 -0
- package/lib/assess/propagators/mustache/escape.js +22 -0
- package/lib/assess/propagators/number.js +54 -0
- package/lib/assess/propagators/object.js +6 -7
- package/lib/assess/propagators/path/basename.js +14 -13
- package/lib/assess/propagators/path/common.js +156 -47
- package/lib/assess/propagators/path/dirname.js +14 -13
- package/lib/assess/propagators/path/extname.js +14 -13
- package/lib/assess/propagators/path/join.js +5 -1
- package/lib/assess/propagators/path/normalize.js +1 -2
- package/lib/assess/propagators/path/parse.js +1 -1
- package/lib/assess/propagators/path/relative.js +7 -5
- package/lib/assess/propagators/path/resolve.js +11 -2
- package/lib/assess/propagators/querystring/escape.js +20 -18
- package/lib/assess/propagators/querystring/parse.js +7 -5
- package/lib/assess/propagators/querystring/stringify.js +25 -24
- package/lib/assess/propagators/querystring/unescape.js +20 -18
- package/lib/assess/propagators/sequelize/sql-string-escape.js +1 -1
- package/lib/assess/propagators/sequelize/sql-string-format-named-parameters.js +1 -1
- package/lib/assess/propagators/sequelize/sql-string-format.js +3 -3
- package/lib/assess/propagators/sequelize/utils.js +2 -2
- package/lib/assess/propagators/string-prototype-replace.js +30 -28
- package/lib/assess/propagators/string-prototype-split.js +36 -36
- package/lib/assess/propagators/string-prototype-trim.js +15 -17
- package/lib/assess/propagators/string.js +12 -16
- package/lib/assess/propagators/template-escape.js +87 -0
- package/lib/assess/propagators/templates.js +10 -11
- package/lib/assess/propagators/url/url-prototype-parse.js +5 -6
- package/lib/assess/propagators/url/url-url.js +51 -43
- package/lib/assess/propagators/util/format.js +1 -1
- package/lib/assess/propagators/v8/init-hooks.js +3 -3
- package/lib/assess/propagators/validator/init-hooks.js +22 -22
- package/lib/assess/sinks/common.js +10 -5
- package/lib/assess/sinks/dustjs-linkedin-xss.js +131 -0
- package/lib/assess/sinks/libxmljs-xxe.js +1 -1
- package/lib/assess/sinks/mongodb.js +2 -1
- package/lib/assess/sinks/ssrf-url.js +1 -1
- package/lib/constants.js +4 -1
- package/lib/core/arch-components/dynamodb.js +1 -2
- package/lib/core/arch-components/dynamodbv3.js +44 -0
- package/lib/core/arch-components/index.js +1 -0
- package/lib/core/arch-components/rethinkdb.js +53 -0
- package/lib/core/config/options.js +3 -2
- package/lib/core/rewrite/injections.js +8 -0
- package/lib/core/stacktrace.js +2 -1
- package/lib/feature-set.js +1 -1
- package/lib/hooks/frameworks/base.js +8 -2
- package/lib/hooks/frameworks/http.js +23 -16
- package/lib/hooks/frameworks/http2.js +73 -0
- package/lib/hooks/frameworks/index.js +8 -3
- package/lib/hooks/http.js +112 -128
- package/lib/hooks/object-to-primitive.js +6 -7
- package/lib/hooks/patcher.js +75 -44
- package/lib/hooks/require.js +16 -22
- package/lib/instrumentation.js +0 -3
- package/lib/protect/rules/nosqli/nosql-injection-rule.js +228 -0
- package/lib/protect/rules/rule-factory.js +2 -2
- package/lib/protect/service.js +23 -11
- package/lib/protect/sinks/mongodb.js +56 -55
- package/lib/reporter/translations/to-protobuf/dtm/index.js +1 -1
- package/lib/reporter/translations/to-protobuf/dtm/ip-denylist-details.js +1 -1
- package/lib/reporter/translations/to-protobuf/dtm/rasp-rule-sample.js +1 -1
- package/lib/reporter/translations/to-protobuf/settings/defend-features.js +8 -6
- package/lib/reporter/translations/to-protobuf/settings/exclusions.js +5 -4
- package/lib/tracker.js +13 -65
- package/lib/util/some.js +27 -0
- package/lib/util/source-map.js +1 -1
- package/package.json +15 -16
- package/lib/hooks/frameworks/https.js +0 -42
- package/lib/protect/rules/nosqli/no-sql-injection-rule.js +0 -109
- package/node_modules/bindings/LICENSE.md +0 -22
- package/node_modules/bindings/README.md +0 -98
- package/node_modules/bindings/bindings.js +0 -221
- package/node_modules/bindings/package.json +0 -32
- package/node_modules/file-uri-to-path/.npmignore +0 -1
- package/node_modules/file-uri-to-path/.travis.yml +0 -30
- package/node_modules/file-uri-to-path/History.md +0 -21
- package/node_modules/file-uri-to-path/LICENSE +0 -20
- package/node_modules/file-uri-to-path/README.md +0 -74
- package/node_modules/file-uri-to-path/index.d.ts +0 -2
- package/node_modules/file-uri-to-path/index.js +0 -66
- package/node_modules/file-uri-to-path/package.json +0 -36
- package/node_modules/file-uri-to-path/test/test.js +0 -24
- package/node_modules/file-uri-to-path/test/tests.json +0 -13
- package/node_modules/glossy/LICENSE +0 -19
- package/node_modules/glossy/README.md +0 -129
- package/node_modules/glossy/index.js +0 -12
- package/node_modules/glossy/lib/glossy/parse.js +0 -520
- package/node_modules/glossy/lib/glossy/produce.js +0 -459
- package/node_modules/glossy/package.json +0 -47
- package/node_modules/glossy/test/decide.js +0 -7
- package/node_modules/glossy/test/decode_pri.js +0 -24
- package/node_modules/glossy/test/parse_3164.js +0 -104
- package/node_modules/glossy/test/parse_5424.js +0 -106
- package/node_modules/glossy/test/parse_5848.js +0 -40
- package/node_modules/glossy/test/parse_8601.js +0 -14
- package/node_modules/glossy/test/parse_rfc3339.js +0 -9
- package/node_modules/glossy/test/produce.js +0 -162
- package/node_modules/glossy/test/runner.js +0 -40
- package/node_modules/glossy/test/structure_data.js +0 -24
- package/node_modules/nan/CHANGELOG.md +0 -537
- package/node_modules/nan/LICENSE.md +0 -13
- package/node_modules/nan/README.md +0 -455
- package/node_modules/nan/doc/asyncworker.md +0 -146
- package/node_modules/nan/doc/buffers.md +0 -54
- package/node_modules/nan/doc/callback.md +0 -76
- package/node_modules/nan/doc/converters.md +0 -41
- package/node_modules/nan/doc/errors.md +0 -226
- package/node_modules/nan/doc/json.md +0 -62
- package/node_modules/nan/doc/maybe_types.md +0 -583
- package/node_modules/nan/doc/methods.md +0 -664
- package/node_modules/nan/doc/new.md +0 -147
- package/node_modules/nan/doc/node_misc.md +0 -123
- package/node_modules/nan/doc/object_wrappers.md +0 -263
- package/node_modules/nan/doc/persistent.md +0 -296
- package/node_modules/nan/doc/scopes.md +0 -73
- package/node_modules/nan/doc/script.md +0 -38
- package/node_modules/nan/doc/string_bytes.md +0 -62
- package/node_modules/nan/doc/v8_internals.md +0 -199
- package/node_modules/nan/doc/v8_misc.md +0 -85
- package/node_modules/nan/include_dirs.js +0 -1
- package/node_modules/nan/nan.h +0 -2898
- package/node_modules/nan/nan_callbacks.h +0 -88
- package/node_modules/nan/nan_callbacks_12_inl.h +0 -514
- package/node_modules/nan/nan_callbacks_pre_12_inl.h +0 -520
- package/node_modules/nan/nan_converters.h +0 -72
- package/node_modules/nan/nan_converters_43_inl.h +0 -68
- package/node_modules/nan/nan_converters_pre_43_inl.h +0 -42
- package/node_modules/nan/nan_define_own_property_helper.h +0 -29
- package/node_modules/nan/nan_implementation_12_inl.h +0 -430
- package/node_modules/nan/nan_implementation_pre_12_inl.h +0 -263
- package/node_modules/nan/nan_json.h +0 -166
- package/node_modules/nan/nan_maybe_43_inl.h +0 -356
- package/node_modules/nan/nan_maybe_pre_43_inl.h +0 -268
- package/node_modules/nan/nan_new.h +0 -340
- package/node_modules/nan/nan_object_wrap.h +0 -156
- package/node_modules/nan/nan_persistent_12_inl.h +0 -132
- package/node_modules/nan/nan_persistent_pre_12_inl.h +0 -242
- package/node_modules/nan/nan_private.h +0 -73
- package/node_modules/nan/nan_string_bytes.h +0 -305
- package/node_modules/nan/nan_typedarray_contents.h +0 -96
- package/node_modules/nan/nan_weak.h +0 -437
- package/node_modules/nan/package.json +0 -41
- package/node_modules/nan/tools/1to2.js +0 -412
- package/node_modules/nan/tools/README.md +0 -14
- package/node_modules/nan/tools/package.json +0 -19
- package/node_modules/unix-dgram/LICENSE +0 -13
- package/node_modules/unix-dgram/README.md +0 -107
- package/node_modules/unix-dgram/binding.gyp +0 -20
- package/node_modules/unix-dgram/build/Makefile +0 -324
- package/node_modules/unix-dgram/build/Release/.deps/Release/obj.target/unix_dgram/src/unix_dgram.o.d +0 -58
- package/node_modules/unix-dgram/build/Release/.deps/Release/obj.target/unix_dgram.node.d +0 -1
- package/node_modules/unix-dgram/build/Release/.deps/Release/unix_dgram.node.d +0 -1
- package/node_modules/unix-dgram/build/Release/obj.target/unix_dgram/src/unix_dgram.o +0 -0
- package/node_modules/unix-dgram/build/Release/obj.target/unix_dgram.node +0 -0
- package/node_modules/unix-dgram/build/Release/unix_dgram.node +0 -0
- package/node_modules/unix-dgram/build/binding.Makefile +0 -6
- package/node_modules/unix-dgram/build/config.gypi +0 -213
- package/node_modules/unix-dgram/build/unix_dgram.target.mk +0 -159
- package/node_modules/unix-dgram/lib/unix_dgram.js +0 -168
- package/node_modules/unix-dgram/package.json +0 -36
- package/node_modules/unix-dgram/src/unix_dgram.cc +0 -404
- package/node_modules/unix-dgram/src/win_dummy.cc +0 -7
- package/node_modules/unix-dgram/test/test-connect-callback.js +0 -68
- package/node_modules/unix-dgram/test/test-connect.js +0 -53
- package/node_modules/unix-dgram/test/test-dgram-unix.js +0 -58
- package/node_modules/unix-dgram/test/test-send-error.js +0 -26
- package/node_modules/winston-syslog/.eslintrc +0 -7
- package/node_modules/winston-syslog/.travis.yml +0 -14
- package/node_modules/winston-syslog/CHANGELOG.md +0 -9
- package/node_modules/winston-syslog/LICENSE +0 -20
- package/node_modules/winston-syslog/README.md +0 -135
- package/node_modules/winston-syslog/lib/utils.js +0 -26
- package/node_modules/winston-syslog/lib/winston-syslog.js +0 -385
- package/node_modules/winston-syslog/package.json +0 -56
- package/node_modules/winston-syslog/test/format-test.js +0 -122
- package/node_modules/winston-syslog/test/syslog-test.js +0 -95
- package/node_modules/winston-syslog/test/unix-connect-test.js +0 -133
|
@@ -1,356 +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_MAYBE_43_INL_H_
|
|
10
|
-
#define NAN_MAYBE_43_INL_H_
|
|
11
|
-
|
|
12
|
-
template<typename T>
|
|
13
|
-
using MaybeLocal = v8::MaybeLocal<T>;
|
|
14
|
-
|
|
15
|
-
inline
|
|
16
|
-
MaybeLocal<v8::String> ToDetailString(v8::Local<v8::Value> val) {
|
|
17
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
18
|
-
v8::EscapableHandleScope scope(isolate);
|
|
19
|
-
return scope.Escape(val->ToDetailString(isolate->GetCurrentContext())
|
|
20
|
-
.FromMaybe(v8::Local<v8::String>()));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
inline
|
|
24
|
-
MaybeLocal<v8::Uint32> ToArrayIndex(v8::Local<v8::Value> val) {
|
|
25
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
26
|
-
v8::EscapableHandleScope scope(isolate);
|
|
27
|
-
return scope.Escape(val->ToArrayIndex(isolate->GetCurrentContext())
|
|
28
|
-
.FromMaybe(v8::Local<v8::Uint32>()));
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
inline
|
|
32
|
-
Maybe<bool> Equals(v8::Local<v8::Value> a, v8::Local<v8::Value>(b)) {
|
|
33
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
34
|
-
v8::HandleScope scope(isolate);
|
|
35
|
-
return a->Equals(isolate->GetCurrentContext(), b);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
inline
|
|
39
|
-
MaybeLocal<v8::Object> NewInstance(v8::Local<v8::Function> h) {
|
|
40
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
41
|
-
v8::EscapableHandleScope scope(isolate);
|
|
42
|
-
return scope.Escape(h->NewInstance(isolate->GetCurrentContext())
|
|
43
|
-
.FromMaybe(v8::Local<v8::Object>()));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
inline
|
|
47
|
-
MaybeLocal<v8::Object> NewInstance(
|
|
48
|
-
v8::Local<v8::Function> h
|
|
49
|
-
, int argc
|
|
50
|
-
, v8::Local<v8::Value> argv[]) {
|
|
51
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
52
|
-
v8::EscapableHandleScope scope(isolate);
|
|
53
|
-
return scope.Escape(h->NewInstance(isolate->GetCurrentContext(), argc, argv)
|
|
54
|
-
.FromMaybe(v8::Local<v8::Object>()));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
inline
|
|
58
|
-
MaybeLocal<v8::Object> NewInstance(v8::Local<v8::ObjectTemplate> h) {
|
|
59
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
60
|
-
v8::EscapableHandleScope scope(isolate);
|
|
61
|
-
return scope.Escape(h->NewInstance(isolate->GetCurrentContext())
|
|
62
|
-
.FromMaybe(v8::Local<v8::Object>()));
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
inline MaybeLocal<v8::Function> GetFunction(
|
|
67
|
-
v8::Local<v8::FunctionTemplate> t) {
|
|
68
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
69
|
-
v8::EscapableHandleScope scope(isolate);
|
|
70
|
-
return scope.Escape(t->GetFunction(isolate->GetCurrentContext())
|
|
71
|
-
.FromMaybe(v8::Local<v8::Function>()));
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
inline Maybe<bool> Set(
|
|
75
|
-
v8::Local<v8::Object> obj
|
|
76
|
-
, v8::Local<v8::Value> key
|
|
77
|
-
, v8::Local<v8::Value> value) {
|
|
78
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
79
|
-
v8::HandleScope scope(isolate);
|
|
80
|
-
return obj->Set(isolate->GetCurrentContext(), key, value);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
inline Maybe<bool> Set(
|
|
84
|
-
v8::Local<v8::Object> obj
|
|
85
|
-
, uint32_t index
|
|
86
|
-
, v8::Local<v8::Value> value) {
|
|
87
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
88
|
-
v8::HandleScope scope(isolate);
|
|
89
|
-
return obj->Set(isolate->GetCurrentContext(), index, value);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
#if NODE_MODULE_VERSION < NODE_4_0_MODULE_VERSION
|
|
93
|
-
#include "nan_define_own_property_helper.h" // NOLINT(build/include)
|
|
94
|
-
#endif
|
|
95
|
-
|
|
96
|
-
inline Maybe<bool> DefineOwnProperty(
|
|
97
|
-
v8::Local<v8::Object> obj
|
|
98
|
-
, v8::Local<v8::String> key
|
|
99
|
-
, v8::Local<v8::Value> value
|
|
100
|
-
, v8::PropertyAttribute attribs = v8::None) {
|
|
101
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
102
|
-
v8::HandleScope scope(isolate);
|
|
103
|
-
#if NODE_MODULE_VERSION >= NODE_4_0_MODULE_VERSION
|
|
104
|
-
return obj->DefineOwnProperty(isolate->GetCurrentContext(), key, value,
|
|
105
|
-
attribs);
|
|
106
|
-
#else
|
|
107
|
-
Maybe<v8::PropertyAttribute> maybeCurrent =
|
|
108
|
-
obj->GetPropertyAttributes(isolate->GetCurrentContext(), key);
|
|
109
|
-
if (maybeCurrent.IsNothing()) {
|
|
110
|
-
return Nothing<bool>();
|
|
111
|
-
}
|
|
112
|
-
v8::PropertyAttribute current = maybeCurrent.FromJust();
|
|
113
|
-
return imp::DefineOwnPropertyHelper(current, obj, key, value, attribs);
|
|
114
|
-
#endif
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
NAN_DEPRECATED inline Maybe<bool> ForceSet(
|
|
118
|
-
v8::Local<v8::Object> obj
|
|
119
|
-
, v8::Local<v8::Value> key
|
|
120
|
-
, v8::Local<v8::Value> value
|
|
121
|
-
, v8::PropertyAttribute attribs = v8::None) {
|
|
122
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
123
|
-
v8::HandleScope scope(isolate);
|
|
124
|
-
#if NODE_MODULE_VERSION >= NODE_9_0_MODULE_VERSION
|
|
125
|
-
return key->IsName()
|
|
126
|
-
? obj->DefineOwnProperty(isolate->GetCurrentContext(),
|
|
127
|
-
key.As<v8::Name>(), value, attribs)
|
|
128
|
-
: Nothing<bool>();
|
|
129
|
-
#else
|
|
130
|
-
return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
|
|
131
|
-
#endif
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
inline MaybeLocal<v8::Value> Get(
|
|
135
|
-
v8::Local<v8::Object> obj
|
|
136
|
-
, v8::Local<v8::Value> key) {
|
|
137
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
138
|
-
v8::EscapableHandleScope scope(isolate);
|
|
139
|
-
return scope.Escape(obj->Get(isolate->GetCurrentContext(), key)
|
|
140
|
-
.FromMaybe(v8::Local<v8::Value>()));
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
inline
|
|
144
|
-
MaybeLocal<v8::Value> Get(v8::Local<v8::Object> obj, uint32_t index) {
|
|
145
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
146
|
-
v8::EscapableHandleScope scope(isolate);
|
|
147
|
-
return scope.Escape(obj->Get(isolate->GetCurrentContext(), index)
|
|
148
|
-
.FromMaybe(v8::Local<v8::Value>()));
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
inline v8::PropertyAttribute GetPropertyAttributes(
|
|
152
|
-
v8::Local<v8::Object> obj
|
|
153
|
-
, v8::Local<v8::Value> key) {
|
|
154
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
155
|
-
v8::HandleScope scope(isolate);
|
|
156
|
-
return obj->GetPropertyAttributes(isolate->GetCurrentContext(), key)
|
|
157
|
-
.FromJust();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
inline Maybe<bool> Has(
|
|
161
|
-
v8::Local<v8::Object> obj
|
|
162
|
-
, v8::Local<v8::String> key) {
|
|
163
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
164
|
-
v8::HandleScope scope(isolate);
|
|
165
|
-
return obj->Has(isolate->GetCurrentContext(), key);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
inline Maybe<bool> Has(v8::Local<v8::Object> obj, uint32_t index) {
|
|
169
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
170
|
-
v8::HandleScope scope(isolate);
|
|
171
|
-
return obj->Has(isolate->GetCurrentContext(), index);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
inline Maybe<bool> Delete(
|
|
175
|
-
v8::Local<v8::Object> obj
|
|
176
|
-
, v8::Local<v8::String> key) {
|
|
177
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
178
|
-
v8::HandleScope scope(isolate);
|
|
179
|
-
return obj->Delete(isolate->GetCurrentContext(), key);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
inline
|
|
183
|
-
Maybe<bool> Delete(v8::Local<v8::Object> obj, uint32_t index) {
|
|
184
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
185
|
-
v8::HandleScope scope(isolate);
|
|
186
|
-
return obj->Delete(isolate->GetCurrentContext(), index);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
inline
|
|
190
|
-
MaybeLocal<v8::Array> GetPropertyNames(v8::Local<v8::Object> obj) {
|
|
191
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
192
|
-
v8::EscapableHandleScope scope(isolate);
|
|
193
|
-
return scope.Escape(obj->GetPropertyNames(isolate->GetCurrentContext())
|
|
194
|
-
.FromMaybe(v8::Local<v8::Array>()));
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
inline
|
|
198
|
-
MaybeLocal<v8::Array> GetOwnPropertyNames(v8::Local<v8::Object> obj) {
|
|
199
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
200
|
-
v8::EscapableHandleScope scope(isolate);
|
|
201
|
-
return scope.Escape(obj->GetOwnPropertyNames(isolate->GetCurrentContext())
|
|
202
|
-
.FromMaybe(v8::Local<v8::Array>()));
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
inline Maybe<bool> SetPrototype(
|
|
206
|
-
v8::Local<v8::Object> obj
|
|
207
|
-
, v8::Local<v8::Value> prototype) {
|
|
208
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
209
|
-
v8::HandleScope scope(isolate);
|
|
210
|
-
return obj->SetPrototype(isolate->GetCurrentContext(), prototype);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
inline MaybeLocal<v8::String> ObjectProtoToString(
|
|
214
|
-
v8::Local<v8::Object> obj) {
|
|
215
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
216
|
-
v8::EscapableHandleScope scope(isolate);
|
|
217
|
-
return scope.Escape(obj->ObjectProtoToString(isolate->GetCurrentContext())
|
|
218
|
-
.FromMaybe(v8::Local<v8::String>()));
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
inline Maybe<bool> HasOwnProperty(
|
|
222
|
-
v8::Local<v8::Object> obj
|
|
223
|
-
, v8::Local<v8::String> key) {
|
|
224
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
225
|
-
v8::HandleScope scope(isolate);
|
|
226
|
-
return obj->HasOwnProperty(isolate->GetCurrentContext(), key);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
inline Maybe<bool> HasRealNamedProperty(
|
|
230
|
-
v8::Local<v8::Object> obj
|
|
231
|
-
, v8::Local<v8::String> key) {
|
|
232
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
233
|
-
v8::HandleScope scope(isolate);
|
|
234
|
-
return obj->HasRealNamedProperty(isolate->GetCurrentContext(), key);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
inline Maybe<bool> HasRealIndexedProperty(
|
|
238
|
-
v8::Local<v8::Object> obj
|
|
239
|
-
, uint32_t index) {
|
|
240
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
241
|
-
v8::HandleScope scope(isolate);
|
|
242
|
-
return obj->HasRealIndexedProperty(isolate->GetCurrentContext(), index);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
inline Maybe<bool> HasRealNamedCallbackProperty(
|
|
246
|
-
v8::Local<v8::Object> obj
|
|
247
|
-
, v8::Local<v8::String> key) {
|
|
248
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
249
|
-
v8::HandleScope scope(isolate);
|
|
250
|
-
return obj->HasRealNamedCallbackProperty(isolate->GetCurrentContext(), key);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
inline MaybeLocal<v8::Value> GetRealNamedPropertyInPrototypeChain(
|
|
254
|
-
v8::Local<v8::Object> obj
|
|
255
|
-
, v8::Local<v8::String> key) {
|
|
256
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
257
|
-
v8::EscapableHandleScope scope(isolate);
|
|
258
|
-
return scope.Escape(obj->GetRealNamedPropertyInPrototypeChain(
|
|
259
|
-
isolate->GetCurrentContext(), key)
|
|
260
|
-
.FromMaybe(v8::Local<v8::Value>()));
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
inline MaybeLocal<v8::Value> GetRealNamedProperty(
|
|
264
|
-
v8::Local<v8::Object> obj
|
|
265
|
-
, v8::Local<v8::String> key) {
|
|
266
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
267
|
-
v8::EscapableHandleScope scope(isolate);
|
|
268
|
-
return scope.Escape(
|
|
269
|
-
obj->GetRealNamedProperty(isolate->GetCurrentContext(), key)
|
|
270
|
-
.FromMaybe(v8::Local<v8::Value>()));
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
inline MaybeLocal<v8::Value> CallAsFunction(
|
|
274
|
-
v8::Local<v8::Object> obj
|
|
275
|
-
, v8::Local<v8::Object> recv
|
|
276
|
-
, int argc
|
|
277
|
-
, v8::Local<v8::Value> argv[]) {
|
|
278
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
279
|
-
v8::EscapableHandleScope scope(isolate);
|
|
280
|
-
return scope.Escape(
|
|
281
|
-
obj->CallAsFunction(isolate->GetCurrentContext(), recv, argc, argv)
|
|
282
|
-
.FromMaybe(v8::Local<v8::Value>()));
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
inline MaybeLocal<v8::Value> CallAsConstructor(
|
|
286
|
-
v8::Local<v8::Object> obj
|
|
287
|
-
, int argc, v8::Local<v8::Value> argv[]) {
|
|
288
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
289
|
-
v8::EscapableHandleScope scope(isolate);
|
|
290
|
-
return scope.Escape(
|
|
291
|
-
obj->CallAsConstructor(isolate->GetCurrentContext(), argc, argv)
|
|
292
|
-
.FromMaybe(v8::Local<v8::Value>()));
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
inline
|
|
296
|
-
MaybeLocal<v8::String> GetSourceLine(v8::Local<v8::Message> msg) {
|
|
297
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
298
|
-
v8::EscapableHandleScope scope(isolate);
|
|
299
|
-
return scope.Escape(msg->GetSourceLine(isolate->GetCurrentContext())
|
|
300
|
-
.FromMaybe(v8::Local<v8::String>()));
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
inline Maybe<int> GetLineNumber(v8::Local<v8::Message> msg) {
|
|
304
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
305
|
-
v8::HandleScope scope(isolate);
|
|
306
|
-
return msg->GetLineNumber(isolate->GetCurrentContext());
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
inline Maybe<int> GetStartColumn(v8::Local<v8::Message> msg) {
|
|
310
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
311
|
-
v8::HandleScope scope(isolate);
|
|
312
|
-
return msg->GetStartColumn(isolate->GetCurrentContext());
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
inline Maybe<int> GetEndColumn(v8::Local<v8::Message> msg) {
|
|
316
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
317
|
-
v8::HandleScope scope(isolate);
|
|
318
|
-
return msg->GetEndColumn(isolate->GetCurrentContext());
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
inline MaybeLocal<v8::Object> CloneElementAt(
|
|
322
|
-
v8::Local<v8::Array> array
|
|
323
|
-
, uint32_t index) {
|
|
324
|
-
#if (NODE_MODULE_VERSION >= NODE_6_0_MODULE_VERSION)
|
|
325
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
326
|
-
v8::EscapableHandleScope scope(isolate);
|
|
327
|
-
v8::Local<v8::Context> context = isolate->GetCurrentContext();
|
|
328
|
-
v8::Local<v8::Value> elem;
|
|
329
|
-
v8::Local<v8::Object> obj;
|
|
330
|
-
if (!array->Get(context, index).ToLocal(&elem)) {
|
|
331
|
-
return scope.Escape(obj);
|
|
332
|
-
}
|
|
333
|
-
if (!elem->ToObject(context).ToLocal(&obj)) {
|
|
334
|
-
return scope.Escape(v8::Local<v8::Object>());
|
|
335
|
-
}
|
|
336
|
-
return scope.Escape(obj->Clone());
|
|
337
|
-
#else
|
|
338
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
339
|
-
v8::EscapableHandleScope scope(isolate);
|
|
340
|
-
return scope.Escape(array->CloneElementAt(isolate->GetCurrentContext(), index)
|
|
341
|
-
.FromMaybe(v8::Local<v8::Object>()));
|
|
342
|
-
#endif
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
inline MaybeLocal<v8::Value> Call(
|
|
346
|
-
v8::Local<v8::Function> fun
|
|
347
|
-
, v8::Local<v8::Object> recv
|
|
348
|
-
, int argc
|
|
349
|
-
, v8::Local<v8::Value> argv[]) {
|
|
350
|
-
v8::Isolate *isolate = v8::Isolate::GetCurrent();
|
|
351
|
-
v8::EscapableHandleScope scope(isolate);
|
|
352
|
-
return scope.Escape(fun->Call(isolate->GetCurrentContext(), recv, argc, argv)
|
|
353
|
-
.FromMaybe(v8::Local<v8::Value>()));
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
#endif // NAN_MAYBE_43_INL_H_
|
|
@@ -1,268 +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_MAYBE_PRE_43_INL_H_
|
|
10
|
-
#define NAN_MAYBE_PRE_43_INL_H_
|
|
11
|
-
|
|
12
|
-
template<typename T>
|
|
13
|
-
class MaybeLocal {
|
|
14
|
-
public:
|
|
15
|
-
inline MaybeLocal() : val_(v8::Local<T>()) {}
|
|
16
|
-
|
|
17
|
-
template<typename S>
|
|
18
|
-
# if NODE_MODULE_VERSION >= NODE_0_12_MODULE_VERSION
|
|
19
|
-
inline
|
|
20
|
-
MaybeLocal(v8::Local<S> that) : val_(that) {} // NOLINT(runtime/explicit)
|
|
21
|
-
# else
|
|
22
|
-
inline
|
|
23
|
-
MaybeLocal(v8::Local<S> that) : // NOLINT(runtime/explicit)
|
|
24
|
-
val_(*reinterpret_cast<v8::Local<T>*>(&that)) {}
|
|
25
|
-
# endif
|
|
26
|
-
|
|
27
|
-
inline bool IsEmpty() const { return val_.IsEmpty(); }
|
|
28
|
-
|
|
29
|
-
template<typename S>
|
|
30
|
-
inline bool ToLocal(v8::Local<S> *out) const {
|
|
31
|
-
*out = val_;
|
|
32
|
-
return !IsEmpty();
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
inline v8::Local<T> ToLocalChecked() const {
|
|
36
|
-
#if defined(V8_ENABLE_CHECKS)
|
|
37
|
-
assert(!IsEmpty() && "ToLocalChecked is Empty");
|
|
38
|
-
#endif // V8_ENABLE_CHECKS
|
|
39
|
-
return val_;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
template<typename S>
|
|
43
|
-
inline v8::Local<S> FromMaybe(v8::Local<S> default_value) const {
|
|
44
|
-
return IsEmpty() ? default_value : v8::Local<S>(val_);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
private:
|
|
48
|
-
v8::Local<T> val_;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
inline
|
|
52
|
-
MaybeLocal<v8::String> ToDetailString(v8::Handle<v8::Value> val) {
|
|
53
|
-
return MaybeLocal<v8::String>(val->ToDetailString());
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
inline
|
|
57
|
-
MaybeLocal<v8::Uint32> ToArrayIndex(v8::Handle<v8::Value> val) {
|
|
58
|
-
return MaybeLocal<v8::Uint32>(val->ToArrayIndex());
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
inline
|
|
62
|
-
Maybe<bool> Equals(v8::Handle<v8::Value> a, v8::Handle<v8::Value>(b)) {
|
|
63
|
-
return Just<bool>(a->Equals(b));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
inline
|
|
67
|
-
MaybeLocal<v8::Object> NewInstance(v8::Handle<v8::Function> h) {
|
|
68
|
-
return MaybeLocal<v8::Object>(h->NewInstance());
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
inline
|
|
72
|
-
MaybeLocal<v8::Object> NewInstance(
|
|
73
|
-
v8::Local<v8::Function> h
|
|
74
|
-
, int argc
|
|
75
|
-
, v8::Local<v8::Value> argv[]) {
|
|
76
|
-
return MaybeLocal<v8::Object>(h->NewInstance(argc, argv));
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
inline
|
|
80
|
-
MaybeLocal<v8::Object> NewInstance(v8::Handle<v8::ObjectTemplate> h) {
|
|
81
|
-
return MaybeLocal<v8::Object>(h->NewInstance());
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
inline
|
|
85
|
-
MaybeLocal<v8::Function> GetFunction(v8::Handle<v8::FunctionTemplate> t) {
|
|
86
|
-
return MaybeLocal<v8::Function>(t->GetFunction());
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
inline Maybe<bool> Set(
|
|
90
|
-
v8::Handle<v8::Object> obj
|
|
91
|
-
, v8::Handle<v8::Value> key
|
|
92
|
-
, v8::Handle<v8::Value> value) {
|
|
93
|
-
return Just<bool>(obj->Set(key, value));
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
inline Maybe<bool> Set(
|
|
97
|
-
v8::Handle<v8::Object> obj
|
|
98
|
-
, uint32_t index
|
|
99
|
-
, v8::Handle<v8::Value> value) {
|
|
100
|
-
return Just<bool>(obj->Set(index, value));
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
#include "nan_define_own_property_helper.h" // NOLINT(build/include)
|
|
104
|
-
|
|
105
|
-
inline Maybe<bool> DefineOwnProperty(
|
|
106
|
-
v8::Handle<v8::Object> obj
|
|
107
|
-
, v8::Handle<v8::String> key
|
|
108
|
-
, v8::Handle<v8::Value> value
|
|
109
|
-
, v8::PropertyAttribute attribs = v8::None) {
|
|
110
|
-
v8::PropertyAttribute current = obj->GetPropertyAttributes(key);
|
|
111
|
-
return imp::DefineOwnPropertyHelper(current, obj, key, value, attribs);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
NAN_DEPRECATED inline Maybe<bool> ForceSet(
|
|
115
|
-
v8::Handle<v8::Object> obj
|
|
116
|
-
, v8::Handle<v8::Value> key
|
|
117
|
-
, v8::Handle<v8::Value> value
|
|
118
|
-
, v8::PropertyAttribute attribs = v8::None) {
|
|
119
|
-
return Just<bool>(obj->ForceSet(key, value, attribs));
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
inline MaybeLocal<v8::Value> Get(
|
|
123
|
-
v8::Handle<v8::Object> obj
|
|
124
|
-
, v8::Handle<v8::Value> key) {
|
|
125
|
-
return MaybeLocal<v8::Value>(obj->Get(key));
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
inline MaybeLocal<v8::Value> Get(
|
|
129
|
-
v8::Handle<v8::Object> obj
|
|
130
|
-
, uint32_t index) {
|
|
131
|
-
return MaybeLocal<v8::Value>(obj->Get(index));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
inline Maybe<v8::PropertyAttribute> GetPropertyAttributes(
|
|
135
|
-
v8::Handle<v8::Object> obj
|
|
136
|
-
, v8::Handle<v8::Value> key) {
|
|
137
|
-
return Just<v8::PropertyAttribute>(obj->GetPropertyAttributes(key));
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
inline Maybe<bool> Has(
|
|
141
|
-
v8::Handle<v8::Object> obj
|
|
142
|
-
, v8::Handle<v8::String> key) {
|
|
143
|
-
return Just<bool>(obj->Has(key));
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
inline Maybe<bool> Has(
|
|
147
|
-
v8::Handle<v8::Object> obj
|
|
148
|
-
, uint32_t index) {
|
|
149
|
-
return Just<bool>(obj->Has(index));
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
inline Maybe<bool> Delete(
|
|
153
|
-
v8::Handle<v8::Object> obj
|
|
154
|
-
, v8::Handle<v8::String> key) {
|
|
155
|
-
return Just<bool>(obj->Delete(key));
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
inline Maybe<bool> Delete(
|
|
159
|
-
v8::Handle<v8::Object> obj
|
|
160
|
-
, uint32_t index) {
|
|
161
|
-
return Just<bool>(obj->Delete(index));
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
inline
|
|
165
|
-
MaybeLocal<v8::Array> GetPropertyNames(v8::Handle<v8::Object> obj) {
|
|
166
|
-
return MaybeLocal<v8::Array>(obj->GetPropertyNames());
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
inline
|
|
170
|
-
MaybeLocal<v8::Array> GetOwnPropertyNames(v8::Handle<v8::Object> obj) {
|
|
171
|
-
return MaybeLocal<v8::Array>(obj->GetOwnPropertyNames());
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
inline Maybe<bool> SetPrototype(
|
|
175
|
-
v8::Handle<v8::Object> obj
|
|
176
|
-
, v8::Handle<v8::Value> prototype) {
|
|
177
|
-
return Just<bool>(obj->SetPrototype(prototype));
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
inline MaybeLocal<v8::String> ObjectProtoToString(
|
|
181
|
-
v8::Handle<v8::Object> obj) {
|
|
182
|
-
return MaybeLocal<v8::String>(obj->ObjectProtoToString());
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
inline Maybe<bool> HasOwnProperty(
|
|
186
|
-
v8::Handle<v8::Object> obj
|
|
187
|
-
, v8::Handle<v8::String> key) {
|
|
188
|
-
return Just<bool>(obj->HasOwnProperty(key));
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
inline Maybe<bool> HasRealNamedProperty(
|
|
192
|
-
v8::Handle<v8::Object> obj
|
|
193
|
-
, v8::Handle<v8::String> key) {
|
|
194
|
-
return Just<bool>(obj->HasRealNamedProperty(key));
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
inline Maybe<bool> HasRealIndexedProperty(
|
|
198
|
-
v8::Handle<v8::Object> obj
|
|
199
|
-
, uint32_t index) {
|
|
200
|
-
return Just<bool>(obj->HasRealIndexedProperty(index));
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
inline Maybe<bool> HasRealNamedCallbackProperty(
|
|
204
|
-
v8::Handle<v8::Object> obj
|
|
205
|
-
, v8::Handle<v8::String> key) {
|
|
206
|
-
return Just<bool>(obj->HasRealNamedCallbackProperty(key));
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
inline MaybeLocal<v8::Value> GetRealNamedPropertyInPrototypeChain(
|
|
210
|
-
v8::Handle<v8::Object> obj
|
|
211
|
-
, v8::Handle<v8::String> key) {
|
|
212
|
-
return MaybeLocal<v8::Value>(
|
|
213
|
-
obj->GetRealNamedPropertyInPrototypeChain(key));
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
inline MaybeLocal<v8::Value> GetRealNamedProperty(
|
|
217
|
-
v8::Handle<v8::Object> obj
|
|
218
|
-
, v8::Handle<v8::String> key) {
|
|
219
|
-
return MaybeLocal<v8::Value>(obj->GetRealNamedProperty(key));
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
inline MaybeLocal<v8::Value> CallAsFunction(
|
|
223
|
-
v8::Handle<v8::Object> obj
|
|
224
|
-
, v8::Handle<v8::Object> recv
|
|
225
|
-
, int argc
|
|
226
|
-
, v8::Handle<v8::Value> argv[]) {
|
|
227
|
-
return MaybeLocal<v8::Value>(obj->CallAsFunction(recv, argc, argv));
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
inline MaybeLocal<v8::Value> CallAsConstructor(
|
|
231
|
-
v8::Handle<v8::Object> obj
|
|
232
|
-
, int argc
|
|
233
|
-
, v8::Local<v8::Value> argv[]) {
|
|
234
|
-
return MaybeLocal<v8::Value>(obj->CallAsConstructor(argc, argv));
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
inline
|
|
238
|
-
MaybeLocal<v8::String> GetSourceLine(v8::Handle<v8::Message> msg) {
|
|
239
|
-
return MaybeLocal<v8::String>(msg->GetSourceLine());
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
inline Maybe<int> GetLineNumber(v8::Handle<v8::Message> msg) {
|
|
243
|
-
return Just<int>(msg->GetLineNumber());
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
inline Maybe<int> GetStartColumn(v8::Handle<v8::Message> msg) {
|
|
247
|
-
return Just<int>(msg->GetStartColumn());
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
inline Maybe<int> GetEndColumn(v8::Handle<v8::Message> msg) {
|
|
251
|
-
return Just<int>(msg->GetEndColumn());
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
inline MaybeLocal<v8::Object> CloneElementAt(
|
|
255
|
-
v8::Handle<v8::Array> array
|
|
256
|
-
, uint32_t index) {
|
|
257
|
-
return MaybeLocal<v8::Object>(array->CloneElementAt(index));
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
inline MaybeLocal<v8::Value> Call(
|
|
261
|
-
v8::Local<v8::Function> fun
|
|
262
|
-
, v8::Local<v8::Object> recv
|
|
263
|
-
, int argc
|
|
264
|
-
, v8::Local<v8::Value> argv[]) {
|
|
265
|
-
return MaybeLocal<v8::Value>(fun->Call(recv, argc, argv));
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
#endif // NAN_MAYBE_PRE_43_INL_H_
|