Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f9d0166

Browse filesBrowse files
trevnorrisevanlucas
authored andcommitted
src: reword command and add ternary
Make comment clear that Undefined() is returned for legacy compatibility. This will change in the future as a semver-major change, but to be able to port this to previous releases it needs to stay as is. PR-URL: #5756 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
1 parent f1488bb commit f9d0166
Copy full SHA for f9d0166

File tree

Expand file treeCollapse file tree

1 file changed

+4
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-5
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,11 +1187,10 @@ Local<Value> MakeCallback(Environment* env,
11871187
}
11881188

11891189
if (ret.IsEmpty()) {
1190-
if (callback_scope.in_makecallback())
1191-
return ret;
1192-
// NOTE: Undefined() is returned here for backwards compatibility.
1193-
else
1194-
return Undefined(env->isolate());
1190+
// NOTE: For backwards compatibility with public API we return Undefined()
1191+
// if the top level call threw.
1192+
return callback_scope.in_makecallback() ?
1193+
ret : Undefined(env->isolate()).As<Value>();
11951194
}
11961195

11971196
if (has_domain) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.