Skip to content

Commit 1d8b52b

Browse files
committed
Use strict mode in the JavaScript binding.
1 parent 8c3cdbe commit 1d8b52b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict';
12
var binary = require('node-pre-gyp');
23
var path = require('path');
34
var bindingPath =
@@ -13,8 +14,8 @@ var request = Promise.promisify(bindings.request);
1314

1415
// Hacky way to make strings safe for eval.
1516
var addslashes = function(s) {
16-
return "'" + s.replace(/[\'\\\000]/g, function(c) {
17-
if (c === '\000') {
17+
return "'" + s.replace(/[\'\\\x00]/g, function(c) {
18+
if (c === '\x00') {
1819
return '\'."\0".\'';
1920
}
2021
return '\\' + c;

0 commit comments

Comments
 (0)