Skip to content

Commit 4c99e9e

Browse files
committed
fix build errors
1 parent ee9117c commit 4c99e9e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

bcrypt.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,14 @@ module.exports.genSalt = function genSalt(rounds, minor, cb) {
8787
/// @param {String} salt the salt to use when hashing
8888
/// @return {String} hash
8989
module.exports.hashSync = function hashSync(data, salt) {
90+
9091
if (data == null || salt == null) {
9192
throw new Error('data and salt arguments required');
9293
}
93-
94+
95+
if (salt === '') {
96+
throw new Error('Salt cannot be empty');
97+
}
9498
if (typeof data !== 'string' || (typeof salt !== 'string' && typeof salt !== 'number')) {
9599
throw new Error('data must be a string and salt must either be a salt string or a number of rounds');
96100
}

binding.gyp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@
3838
'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
3939
}
4040
}],
41-
['OS=="zos" and NODE_VERSION < 16',{
41+
['OS=="zos" and NODE_VERSION <= 16',{
4242
'cflags': [
4343
'-qascii',
4444
],
45+
'defines': ["NAPI_DISABLE_CPP_EXCEPTIONS"],
4546
}],
4647
],
4748
},

0 commit comments

Comments
 (0)