From 59e9c6322baf6cbd1952c40ce5dd0b2ea7802712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 14 Aug 2018 16:29:24 +0200 Subject: [PATCH] Remove hub.file usage from babel-core --- .../babel-helper-module-imports/src/import-builder.js | 10 +++++----- .../babel-helper-module-imports/src/import-injector.js | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/babel-helper-module-imports/src/import-builder.js b/packages/babel-helper-module-imports/src/import-builder.js index 95b2c9a383..7513c85493 100644 --- a/packages/babel-helper-module-imports/src/import-builder.js +++ b/packages/babel-helper-module-imports/src/import-builder.js @@ -10,11 +10,11 @@ export default class ImportBuilder { _resultName = null; _scope = null; - _file = null; + _hub = null; - constructor(importedSource, scope, file) { + constructor(importedSource, scope, hub) { this._scope = scope; - this._file = file; + this._hub = hub; this._importedSource = importedSource; } @@ -91,10 +91,10 @@ export default class ImportBuilder { } defaultInterop() { - return this._interop(this._file.addHelper("interopRequireDefault")); + return this._interop(this._hub.addHelper("interopRequireDefault")); } wildcardInterop() { - return this._interop(this._file.addHelper("interopRequireWildcard")); + return this._interop(this._hub.addHelper("interopRequireWildcard")); } _interop(callee) { diff --git a/packages/babel-helper-module-imports/src/import-injector.js b/packages/babel-helper-module-imports/src/import-injector.js index 5574ba2a32..0e38f9188a 100644 --- a/packages/babel-helper-module-imports/src/import-injector.js +++ b/packages/babel-helper-module-imports/src/import-injector.js @@ -108,7 +108,7 @@ export default class ImportInjector { /** * The file used to inject helpers and resolve paths. */ - _file; + _hub; /** * The default options to use with this instance when imports are added. @@ -127,7 +127,7 @@ export default class ImportInjector { this._programPath = programPath; this._programScope = programPath.scope; - this._file = programPath.hub.file; + this._hub = programPath.hub; this._defaultOpts = this._applyDefaults(importedSource, opts, true); } @@ -218,7 +218,7 @@ export default class ImportInjector { const builder = new ImportBuilder( importedSource, this._programScope, - this._file, + this._hub, ); if (importedType === "es6") {