Remove hub.file usage from babel-core

This commit is contained in:
Nicolò Ribaudo 2018-08-14 16:29:24 +02:00
parent 0fd3da110d
commit 59e9c6322b
2 changed files with 8 additions and 8 deletions

View File

@ -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) {

View File

@ -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") {