Skip to content

Commit f2fa82c

Browse files
authored
fix(eslint-plugin): [unbound-method] fix crash due to missing Intl (typescript-eslint#2090)
1 parent 014341b commit f2fa82c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/eslint-plugin/src/rules/unbound-method.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ const SUPPORTED_GLOBALS = [
8282
'Intl',
8383
] as const;
8484
const nativelyBoundMembers = SUPPORTED_GLOBALS.map(namespace => {
85+
if (!(namespace in global)) {
86+
// node.js might not have namespaces like Intl depending on compilation options
87+
// https://nodejs.org/api/intl.html#intl_options_for_building_node_js
88+
return [];
89+
}
8590
const object = global[namespace];
8691
return Object.getOwnPropertyNames(object)
8792
.filter(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy