Skip to content

Commit dbe4844

Browse files
committed
deps: backport f782159 from v8's upstream
Backport f78215962bf5de9d47c022e7baa3952d0bf6d17f from V8's upstream to speed up promise introspection. Original commit message: Remove obsolete try/catch from ObjectIsPromise(). Review URL: https://codereview.chromium.org/1367123003 Cr-Commit-Position: refs/heads/master@{#30966} PR-URL: #3130 Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]>
1 parent 9a1bc4e commit dbe4844

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

deps/v8/src/mirror-debugger.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,9 @@ function ToggleMirrorCache(value) {
1919
}
2020

2121

22-
// Wrapper to check whether an object is a Promise. The call may not work
23-
// if promises are not enabled.
24-
// TODO(yangguo): remove try-catch once promises are enabled by default.
2522
function ObjectIsPromise(value) {
26-
try {
27-
return IS_SPEC_OBJECT(value) &&
28-
!IS_UNDEFINED(%DebugGetProperty(value, builtins.$promiseStatus));
29-
} catch (e) {
30-
return false;
31-
}
23+
return IS_SPEC_OBJECT(value) &&
24+
!IS_UNDEFINED(%DebugGetProperty(value, builtins.$promiseStatus));
3225
}
3326

3427

0 commit comments

Comments
 (0)