/
githubmirror
/
babel
Обзор
Документация
Войти
/
githubmirror
/
babel
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/babel-core/src/transformation/plugin-pass.ts
61 строка
1 KB
liuxingbaoyu
Enable `strictNullChecks` for `@babel/core` (#17611)
23 янв 2026, 15:42
Не верифицирован
23 янв 2026, 15:42
6d97ee8
Код
Авторство
О чём код?
import type * as t from "@babel/types"; import type File from "./file/file.ts"; export default class PluginPass<Options = object> { _map = new Map<unknown, unknown>(); key: string | undefined | null; file: File; opts: Partial<Options>; /** * The working directory that Babel's programmatic options are loaded * relative to. */ cwd: string; /** The absolute path of the file being compiled. */ filename: string | undefined; /** * Is Babel executed in async mode or not. */ isAsync: boolean; constructor( file: File, key: string | null | undefined, options: Options | undefined, isAsync: boolean, ) { this.key = key; this.file = file; this.opts = options || {}; this.cwd = file.opts.cwd; this.filename = file.opts.filename; this.isAsync = isAsync; } set(key: unknown, val: unknown) { this._map.set(key, val); } get(key: unknown): any { return this._map.get(key); } availableHelper(name: string, versionRange?: string | null) { return this.file.availableHelper(name, versionRange); } addHelper(name: string) { return this.file.addHelper(name); } buildCodeFrameError( node: t.Node | undefined | null, msg: string, _Error?: typeof Error, ) { return this.file.buildCodeFrameError(node, msg, _Error); } }