Skip to content

Commit a37ca25

Browse files
committed
Releasing v1.5.2
2 parents b7b7414 + cb600af commit a37ca25

File tree

3 files changed

+37
-39
lines changed

3 files changed

+37
-39
lines changed

package-lock.json

+27-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "systemd-journald",
3-
"version": "1.5.1",
3+
"version": "1.5.2",
44
"description": "Native bindings to journald",
55
"keywords": [
66
"logging",
@@ -22,10 +22,10 @@
2222
"pretest": "jshint *.js"
2323
},
2424
"dependencies": {
25-
"nan": "^2.13.2"
25+
"nan": "^2.14.0"
2626
},
2727
"devDependencies": {
28-
"jshint": "^2.10.2",
28+
"jshint": "^2.11.0",
2929
"mocha": "^2.5.3",
3030
"mockery": "^1.7.0"
3131
},

src/journal_send.cc

+7-15
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ const char *const syslogPrio[] = {
3535
#define PRIO_FIELD_NAME "PRIORITY="
3636
#define PRIO_FIELD_NAME_LEN 9
3737

38-
39-
void send( const Nan::FunctionCallbackInfo<v8::Value>& args ) {
40-
41-
int argc = args.Length();
38+
NAN_METHOD( send ) {
39+
int argc = info.Length();
4240
struct iovec iov[ argc ];
4341

4442
// Make sure nobody forgot the arguments
@@ -47,7 +45,7 @@ void send( const Nan::FunctionCallbackInfo<v8::Value>& args ) {
4745
return;
4846
}
4947

50-
Nan::MaybeLocal<v8::Integer> priorityArg = Nan::To<v8::Integer>(args[0]);
48+
Nan::MaybeLocal<v8::Integer> priorityArg = Nan::To<v8::Integer>(info[0]);
5149

5250
// Make sure first argument is a number
5351
if( priorityArg.IsEmpty() ) {
@@ -72,7 +70,7 @@ void send( const Nan::FunctionCallbackInfo<v8::Value>& args ) {
7270

7371
// Copy all remaining arguments to the iovec
7472
for( int i = 1; i < argc; i++ ) {
75-
Nan::MaybeLocal<v8::String> strArg = Nan::To<v8::String>(args[i]);
73+
Nan::MaybeLocal<v8::String> strArg = Nan::To<v8::String>(info[i]);
7674
// First ensure that the argument is a string
7775
if( strArg.IsEmpty() ) {
7876
Nan::ThrowTypeError( "Arguments must be strings" );
@@ -95,17 +93,11 @@ void send( const Nan::FunctionCallbackInfo<v8::Value>& args ) {
9593
}
9694

9795
v8::Local<v8::Number> returnValue = Nan::New( ret );
98-
args.GetReturnValue().Set( returnValue );
99-
96+
info.GetReturnValue().Set( returnValue );
10097
}
10198

102-
void init( v8::Local<v8::Object> exports ) {
103-
104-
exports->Set(
105-
Nan::New("send").ToLocalChecked(),
106-
Nan::GetFunction(Nan::New<v8::FunctionTemplate>(send)).ToLocalChecked()
107-
);
108-
99+
NAN_MODULE_INIT( init ) {
100+
NAN_EXPORT(target, send);
109101
}
110102

111103
NODE_MODULE( journal_send, init )

0 commit comments

Comments
 (0)