diff options
Diffstat (limited to 'tools/node_modules/eslint/node_modules/@babel/types/lib/modifications/inherits.js')
-rw-r--r-- | tools/node_modules/eslint/node_modules/@babel/types/lib/modifications/inherits.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/node_modules/eslint/node_modules/@babel/types/lib/modifications/inherits.js b/tools/node_modules/eslint/node_modules/@babel/types/lib/modifications/inherits.js new file mode 100644 index 0000000000..8701897d0e --- /dev/null +++ b/tools/node_modules/eslint/node_modules/@babel/types/lib/modifications/inherits.js @@ -0,0 +1,31 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = inherits; + +var _constants = require("../constants"); + +var _inheritsComments = require("../comments/inheritsComments"); + +function inherits(child, parent) { + if (!child || !parent) return child; + + for (const key of _constants.INHERIT_KEYS.optional) { + if (child[key] == null) { + child[key] = parent[key]; + } + } + + for (const key of Object.keys(parent)) { + if (key[0] === "_" && key !== "__clone") child[key] = parent[key]; + } + + for (const key of _constants.INHERIT_KEYS.force) { + child[key] = parent[key]; + } + + (0, _inheritsComments.default)(child, parent); + return child; +}
\ No newline at end of file |