mirror of https://github.com/webpack/webpack.git
fix : optimize loc for monomorphic inline caching
This commit is contained in:
commit
87b203b27e
|
@ -132,19 +132,23 @@ class Dependency {
|
|||
get loc() {
|
||||
if (this._loc !== undefined) return this._loc;
|
||||
/** @type {SyntheticDependencyLocation & RealDependencyLocation} */
|
||||
const loc = {};
|
||||
const loc = {
|
||||
start: { line: 0, column: 0 },
|
||||
end: { line: 0, column: 0 },
|
||||
name: "",
|
||||
index: -1
|
||||
};
|
||||
if (this._locSL > 0) {
|
||||
loc.start = { line: this._locSL, column: this._locSC };
|
||||
}
|
||||
if (this._locEL > 0) {
|
||||
loc.end = { line: this._locEL, column: this._locEC };
|
||||
}
|
||||
if (this._locN !== undefined) {
|
||||
|
||||
loc.name = this._locN;
|
||||
}
|
||||
if (this._locI !== undefined) {
|
||||
|
||||
loc.index = this._locI;
|
||||
}
|
||||
|
||||
return (this._loc = loc);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue