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 c3d87ee

Browse filesBrowse files
trevnorrisMyles Borins
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. Ref: #7048 PR-URL: #5756 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
1 parent ee70405 commit c3d87ee
Copy full SHA for c3d87ee

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
@@ -1177,11 +1177,10 @@ Local<Value> MakeCallback(Environment* env,
11771177
}
11781178

11791179
if (ret.IsEmpty()) {
1180-
if (callback_scope.in_makecallback())
1181-
return ret;
1182-
// NOTE: Undefined() is returned here for backwards compatibility.
1183-
else
1184-
return Undefined(env->isolate());
1180+
// NOTE: For backwards compatibility with public API we return Undefined()
1181+
// if the top level call threw.
1182+
return callback_scope.in_makecallback() ?
1183+
ret : Undefined(env->isolate()).As<Value>();
11851184
}
11861185

11871186
if (has_domain) {

0 commit comments

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