GeezerVison is showing github.com — src: remove calls to deprecated v8 functions (BooleanValue) · nodejs/node@9914677
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: lib/internal/crypto/cipher.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -181,7 +181,7 @@ Cipher.prototype.final = function final(outputEncoding) { | 181 | 181 |
| 182 | 182 |
| 183 | 183 | Cipher.prototype.setAutoPadding = function setAutoPadding(ap) { | 184 | | - if (!this._handle.setAutoPadding(ap)) | | 184 | + if (!this._handle.setAutoPadding(!!ap)) | 185 | 185 | throw new ERR_CRYPTO_INVALID_STATE('setAutoPadding'); | 186 | 186 | return this; | 187 | 187 | }; | |
Collapse file Copy file name to clipboardExpand all lines: lib/internal/readline.js +5-3Lines changed: 5 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -36,9 +36,11 @@ if (process.binding('config').hasIntl) { | 36 | 36 | options = options || {}; | 37 | 37 | if (!Number.isInteger(str)) | 38 | 38 | str = stripVTControlCharacters(String(str)); | 39 | | - return icu.getStringWidth(str, | 40 | | - Boolean(options.ambiguousAsFullWidth), | 41 | | - Boolean(options.expandEmojiSequence)); | | 39 | + return icu.getStringWidth( | | 40 | + str, | | 41 | + Boolean(options.ambiguousAsFullWidth), | | 42 | + Boolean(options.expandEmojiSequence) | | 43 | + ); | 42 | 44 | }; | 43 | 45 | isFullWidthCodePoint = | 44 | 46 | function isFullWidthCodePoint(code, options) { | |
Collapse file Copy file name to clipboardExpand all lines: lib/net.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -1723,7 +1723,7 @@ if (process.platform === 'win32') { | 1723 | 1723 | } | 1724 | 1724 |
| 1725 | 1725 | if (handle._simultaneousAccepts !== simultaneousAccepts) { | 1726 | | - handle.setSimultaneousAccepts(simultaneousAccepts); | | 1726 | + handle.setSimultaneousAccepts(!!simultaneousAccepts); | 1727 | 1727 | handle._simultaneousAccepts = simultaneousAccepts; | 1728 | 1728 | } | 1729 | 1729 | }; | |
Collapse file Copy file name to clipboardExpand all lines: src/node_crypto.cc +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -3096,7 +3096,7 @@ void CipherBase::SetAutoPadding(const FunctionCallbackInfo<Value>& args) { | 3096 | 3096 | CipherBase* cipher; | 3097 | 3097 | ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); | 3098 | 3098 |
| 3099 | | - bool b = cipher->SetAutoPadding(args.Length() < 1 || args[0]->BooleanValue()); | | 3099 | + bool b = cipher->SetAutoPadding(args.Length() < 1 || args[0]->IsTrue()); | 3100 | 3100 | args.GetReturnValue().Set(b); // Possibly report invalid state failure | 3101 | 3101 | } | 3102 | 3102 |
| @@ -5190,7 +5190,8 @@ void SetFipsCrypto(const FunctionCallbackInfo<Value>& args) { | 5190 | 5190 | CHECK(!force_fips_crypto); | 5191 | 5191 | Environment* env = Environment::GetCurrent(args); | 5192 | 5192 | const bool enabled = FIPS_mode(); | 5193 | | - const bool enable = args[0]->BooleanValue(); | | 5193 | + bool enable; | | 5194 | + if (!args[0]->BooleanValue(env->context()).To(&enable)) return; | 5194 | 5195 | if (enable == enabled) | 5195 | 5196 | return; // No action needed. | 5196 | 5197 | if (!FIPS_mode_set(enable)) { | |
Collapse file Copy file name to clipboardExpand all lines: src/node_file.cc +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -1316,7 +1316,7 @@ static void ReadDir(const FunctionCallbackInfo<Value>& args) { | 1316 | 1316 |
| 1317 | 1317 | const enum encoding encoding = ParseEncoding(env->isolate(), args[1], UTF8); | 1318 | 1318 |
| 1319 | | - bool with_types = args[2]->BooleanValue(); | | 1319 | + bool with_types = args[2]->IsTrue(); | 1320 | 1320 |
| 1321 | 1321 | FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); | 1322 | 1322 | if (req_wrap_async != nullptr) { // readdir(path, encoding, withTypes, req) | |
Collapse file Copy file name to clipboardExpand all lines: src/node_i18n.cc +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -815,8 +815,8 @@ static void GetStringWidth(const FunctionCallbackInfo<Value>& args) { | 815 | 815 | if (args.Length() < 1) | 816 | 816 | return; | 817 | 817 |
| 818 | | - bool ambiguous_as_full_width = args[1]->BooleanValue(); | 819 | | - bool expand_emoji_sequence = args[2]->BooleanValue(); | | 818 | + bool ambiguous_as_full_width = args[1]->IsTrue(); | | 819 | + bool expand_emoji_sequence = args[2]->IsTrue(); | 820 | 820 |
| 821 | 821 | if (args[0]->IsNumber()) { | 822 | 822 | args.GetReturnValue().Set( | |
Collapse file Copy file name to clipboardExpand all lines: src/tcp_wrap.cc +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -168,7 +168,7 @@ void TCPWrap::SetNoDelay(const FunctionCallbackInfo<Value>& args) { | 168 | 168 | ASSIGN_OR_RETURN_UNWRAP(&wrap, | 169 | 169 | args.Holder(), | 170 | 170 | args.GetReturnValue().Set(UV_EBADF)); | 171 | | - int enable = static_cast<int>(args[0]->BooleanValue()); | | 171 | + int enable = static_cast<int>(args[0]->IsTrue()); | 172 | 172 | int err = uv_tcp_nodelay(&wrap->handle_, enable); | 173 | 173 | args.GetReturnValue().Set(err); | 174 | 174 | } | @@ -192,7 +192,7 @@ void TCPWrap::SetSimultaneousAccepts(const FunctionCallbackInfo<Value>& args) { | 192 | 192 | ASSIGN_OR_RETURN_UNWRAP(&wrap, | 193 | 193 | args.Holder(), | 194 | 194 | args.GetReturnValue().Set(UV_EBADF)); | 195 | | - bool enable = args[0]->BooleanValue(); | | 195 | + bool enable = args[0]->IsTrue(); | 196 | 196 | int err = uv_tcp_simultaneous_accepts(&wrap->handle_, enable); | 197 | 197 | args.GetReturnValue().Set(err); | 198 | 198 | } | |
|