* @param inlineScriptOffset Offset of the start location of the script in * its source file. This is used on scripts in HTML pages, where the script * is nested in the content. * @param contentHash Optional hash of the file contents. This is used to * check whether the script we get is t
(
container: SourceContainer,
public readonly url: string,
absolutePath: string | undefined,
contentGetter: ContentGetter,
sourceMapUrl?: string,
public readonly inlineScriptOffset?: InlineScriptOffset,
contentHash?: string,
)
| 133 | * can be used to detect in-place transpilation. |
| 134 | */ |
| 135 | constructor( |
| 136 | container: SourceContainer, |
| 137 | public readonly url: string, |
| 138 | absolutePath: string | undefined, |
| 139 | contentGetter: ContentGetter, |
| 140 | sourceMapUrl?: string, |
| 141 | public readonly inlineScriptOffset?: InlineScriptOffset, |
| 142 | contentHash?: string, |
| 143 | ) { |
| 144 | this._sourceReference = container.getSourceReference(url); |
| 145 | this._contentGetter = once(contentGetter); |
| 146 | this._container = container; |
| 147 | this._absolutePath = absolutePath || ''; |
| 148 | this._fqname = this._fullyQualifiedName(); |
| 149 | this._name = this._humanName(); |
| 150 | this.setSourceMapUrl(sourceMapUrl); |
| 151 | |
| 152 | this._existingAbsolutePath = sourceUtils.checkContentHash( |
| 153 | this._absolutePath, |
| 154 | // Inline scripts will never match content of the html file. We skip the content check. |
| 155 | inlineScriptOffset ? undefined : contentHash, |
| 156 | container._fileContentOverridesForTest.get(this._absolutePath), |
| 157 | ); |
| 158 | } |
| 159 | |
| 160 | private setSourceMapUrl(sourceMapUrl?: string) { |
| 161 | if (!sourceMapUrl) { |
nothing calls this directly
no test coverage detected