diff options
author | Miguel Angel Asencio Hurtado <maasencioh@gmail.com> | 2017-08-04 17:13:36 +0200 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-08-08 15:52:39 -0700 |
commit | 9564c20810d7dccaae8bb917251681051a2a1144 (patch) | |
tree | 6d7ac8e37dc9155d1f7510bfa425ae789797265b /test/async-hooks/init-hooks.js | |
parent | e67220ec81ce55833559e9d40f44a08b80756a07 (diff) | |
download | android-node-v8-9564c20810d7dccaae8bb917251681051a2a1144.tar.gz android-node-v8-9564c20810d7dccaae8bb917251681051a2a1144.tar.bz2 android-node-v8-9564c20810d7dccaae8bb917251681051a2a1144.zip |
test: replace indexOf with includes
Refs: https://github.com/nodejs/node/issues/12586
PR-URL: https://github.com/nodejs/node/pull/14630
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Diffstat (limited to 'test/async-hooks/init-hooks.js')
-rw-r--r-- | test/async-hooks/init-hooks.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/async-hooks/init-hooks.js b/test/async-hooks/init-hooks.js index c99383204f..a5f835cdff 100644 --- a/test/async-hooks/init-hooks.js +++ b/test/async-hooks/init-hooks.js @@ -67,7 +67,7 @@ class ActivityCollector { const violations = []; function v(msg) { violations.push(msg); } for (const a of this._activities.values()) { - if (types != null && types.indexOf(a.type) < 0) continue; + if (types != null && !types.includes(a.type)) continue; if (a.init && a.init.length > 1) { v('Activity inited twice\n' + activityString(a) + @@ -131,7 +131,7 @@ class ActivityCollector { activitiesOfTypes(types) { if (!Array.isArray(types)) types = [ types ]; - return this.activities.filter((x) => types.indexOf(x.type) >= 0); + return this.activities.filter((x) => types.includes(x.type)); } get activities() { |