Skip to content

Commit 3cc03e8

Browse files
authored
Fix findMatchingCatch iterating over argument array prototype chain (#21986)
1 parent 0c5cb79 commit 3cc03e8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/library_exceptions.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,7 @@ var LibraryExceptions = {
254254
// Due to inheritance, those types may not precisely match the
255255
// type of the thrown object. Find one which matches, and
256256
// return the type of the catch block which should be called.
257-
for (var arg in args) {
258-
var caughtType = args[arg];
259-
257+
for (var caughtType of args) {
260258
if (caughtType === 0 || caughtType === thrownType) {
261259
// Catch all clause matched or exactly the same type is caught
262260
break;

0 commit comments

Comments
 (0)