MCPcopy Index your code
hub / github.com/angular/angular / addMapping

Method addMapping

packages/compiler/src/output/source_map.ts:54–75  ·  view source on GitHub ↗
(col0: number, sourceUrl?: string, sourceLine0?: number, sourceCol0?: number)

Source from the content-addressed store, hash-verified

52 }
53
54 addMapping(col0: number, sourceUrl?: string, sourceLine0?: number, sourceCol0?: number): this {
55 if (!this.currentLine) {
56 throw new Error(`A line must be added before mappings can be added`);
57 }
58 if (sourceUrl != null && !this.sourcesContent.has(sourceUrl)) {
59 throw new Error(`Unknown source file "${sourceUrl}"`);
60 }
61 if (col0 == null) {
62 throw new Error(`The column in the generated code must be provided`);
63 }
64 if (col0 < this.lastCol0) {
65 throw new Error(`Mapping should be added in output order`);
66 }
67 if (sourceUrl && (sourceLine0 == null || sourceCol0 == null)) {
68 throw new Error(`The source location must be provided when a source url is provided`);
69 }
70
71 this.hasMappings = true;
72 this.lastCol0 = col0;
73 this.currentLine.push({col0, sourceUrl, sourceLine0, sourceCol0});
74 return this;
75 }
76
77 /**
78 * @internal strip this from published d.ts files due to

Callers 3

source_map_spec.tsFile · 0.80
toSourceMapGeneratorMethod · 0.80

Calls 2

hasMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected