Skip to content

Commit

Permalink
Fix for old nodejs versions
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Sep 27, 2023
1 parent 06ebd3b commit 2d3bcfc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/syntax/node/FeatureFunction.js
Expand Up @@ -11,7 +11,8 @@ export const structure = {
};

function getFeatureParser(kind, name) {
const parser = this.features[kind]?.[name];
const featuresOfKind = this.features[kind] || {};
const parser = featuresOfKind[name];

if (typeof parser !== 'function') {
this.error(`Unknown feature ${name}()`);
Expand Down

0 comments on commit 2d3bcfc

Please sign in to comment.