lib: enforce use of Array from primordials

PR-URL: https://github.com/nodejs/node/pull/30635
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
Michaël Zasso 2019-11-23 10:09:05 +01:00
parent 5904dfcc9c
commit 141a6e34ee
No known key found for this signature in database
GPG key ID: 770F7A9A5AE15600
48 changed files with 139 additions and 68 deletions

View file

@ -1,6 +1,7 @@
'use strict';
const {
ArrayIsArray,
ObjectDefineProperties,
ObjectDefineProperty,
ObjectKeys,
@ -335,7 +336,7 @@ class PerformanceObserver extends AsyncResource {
if (typeof options !== 'object' || options === null) {
throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
}
if (!Array.isArray(options.entryTypes)) {
if (!ArrayIsArray(options.entryTypes)) {
throw new ERR_INVALID_OPT_VALUE('entryTypes', options);
}
const entryTypes = options.entryTypes.filter(filterTypes).map(mapTypes);