Skip to content

Commit f2fa82c

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

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: packages/eslint-plugin/src/rules/unbound-method.ts

+5
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)