mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
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: https://github.com/nodejs/node/pull/7048 PR-URL: https://github.com/nodejs/node/pull/5756 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
This commit is contained in:
1 parent
ee7040568d
commit
c3d87eee49
1 file changed
+4
-5
+4
-5
@@ -1177,11 +1177,10 @@ Local<Value> MakeCallback(Environment* env,
|
||||
}
|
||||
|
||||
if (ret.IsEmpty()) {
|
||||
if (callback_scope.in_makecallback())
|
||||
return ret;
|
||||
// NOTE: Undefined() is returned here for backwards compatibility.
|
||||
else
|
||||
return Undefined(env->isolate());
|
||||
// NOTE: For backwards compatibility with public API we return Undefined()
|
||||
// if the top level call threw.
|
||||
return callback_scope.in_makecallback() ?
|
||||
ret : Undefined(env->isolate()).As<Value>();
|
||||
}
|
||||
|
||||
if (has_domain) {
|
||||
|
||||
Reference in new issue
Block a user