mirror of https://github.com/webpack/webpack.git
				
				
				
			refactor call and callArgs for HarmonyImportSpecifierDependency
This commit is contained in:
		
							parent
							
								
									459fef0263
								
							
						
					
					
						commit
						a09b9a5b8f
					
				| 
						 | 
					@ -122,7 +122,6 @@ module.exports = class HarmonyImportDependencyParserPlugin {
 | 
				
			||||||
			.for("imported var")
 | 
								.for("imported var")
 | 
				
			||||||
			.tap("HarmonyImportDependencyParserPlugin", expr => {
 | 
								.tap("HarmonyImportDependencyParserPlugin", expr => {
 | 
				
			||||||
				const args = expr.arguments;
 | 
									const args = expr.arguments;
 | 
				
			||||||
				const fullExpr = expr;
 | 
					 | 
				
			||||||
				expr = expr.callee;
 | 
									expr = expr.callee;
 | 
				
			||||||
				if (expr.type !== "Identifier") return;
 | 
									if (expr.type !== "Identifier") return;
 | 
				
			||||||
				const name = expr.name;
 | 
									const name = expr.name;
 | 
				
			||||||
| 
						 | 
					@ -136,8 +135,7 @@ module.exports = class HarmonyImportDependencyParserPlugin {
 | 
				
			||||||
					this.strictExportPresence
 | 
										this.strictExportPresence
 | 
				
			||||||
				);
 | 
									);
 | 
				
			||||||
				dep.directImport = true;
 | 
									dep.directImport = true;
 | 
				
			||||||
				dep.callArgs = args;
 | 
									dep.call = true;
 | 
				
			||||||
				dep.call = fullExpr;
 | 
					 | 
				
			||||||
				dep.loc = expr.loc;
 | 
									dep.loc = expr.loc;
 | 
				
			||||||
				parser.state.module.addDependency(dep);
 | 
									parser.state.module.addDependency(dep);
 | 
				
			||||||
				if (args) parser.walkExpressions(args);
 | 
									if (args) parser.walkExpressions(args);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,6 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
 | 
				
			||||||
		this.range = range;
 | 
							this.range = range;
 | 
				
			||||||
		this.strictExportPresence = strictExportPresence;
 | 
							this.strictExportPresence = strictExportPresence;
 | 
				
			||||||
		this.namespaceObjectAsContext = false;
 | 
							this.namespaceObjectAsContext = false;
 | 
				
			||||||
		this.callArgs = undefined;
 | 
					 | 
				
			||||||
		this.call = undefined;
 | 
							this.call = undefined;
 | 
				
			||||||
		this.directImport = undefined;
 | 
							this.directImport = undefined;
 | 
				
			||||||
		this.shorthand = undefined;
 | 
							this.shorthand = undefined;
 | 
				
			||||||
| 
						 | 
					@ -192,7 +191,6 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
 | 
				
			||||||
		write(this.range);
 | 
							write(this.range);
 | 
				
			||||||
		write(this.strictExportPresence);
 | 
							write(this.strictExportPresence);
 | 
				
			||||||
		write(this.namespaceObjectAsContext);
 | 
							write(this.namespaceObjectAsContext);
 | 
				
			||||||
		write(this.callArgs);
 | 
					 | 
				
			||||||
		write(this.call);
 | 
							write(this.call);
 | 
				
			||||||
		write(this.directImport);
 | 
							write(this.directImport);
 | 
				
			||||||
		write(this.shorthand);
 | 
							write(this.shorthand);
 | 
				
			||||||
| 
						 | 
					@ -206,7 +204,6 @@ class HarmonyImportSpecifierDependency extends HarmonyImportDependency {
 | 
				
			||||||
		this.range = read();
 | 
							this.range = read();
 | 
				
			||||||
		this.strictExportPresence = read();
 | 
							this.strictExportPresence = read();
 | 
				
			||||||
		this.namespaceObjectAsContext = read();
 | 
							this.namespaceObjectAsContext = read();
 | 
				
			||||||
		this.callArgs = read();
 | 
					 | 
				
			||||||
		this.call = read();
 | 
							this.call = read();
 | 
				
			||||||
		this.directImport = read();
 | 
							this.directImport = read();
 | 
				
			||||||
		this.shorthand = read();
 | 
							this.shorthand = read();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue