* @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,
sourceMapMetadata?: ISourceMapMetadata,
public readonly inlineScriptOffset?: InlineScriptOffset,
public readonly runtimeScriptOffset?: InlineScriptOffset,
public readonly contentHash?: string,
)
| 87 | * not be shown to the user. |
| 88 | */ |
| 89 | constructor( |
| 90 | container: SourceContainer, |
| 91 | public readonly url: string, |
| 92 | absolutePath: string | undefined, |
| 93 | contentGetter: ContentGetter, |
| 94 | sourceMapMetadata?: ISourceMapMetadata, |
| 95 | public readonly inlineScriptOffset?: InlineScriptOffset, |
| 96 | public readonly runtimeScriptOffset?: InlineScriptOffset, |
| 97 | public readonly contentHash?: string, |
| 98 | ) { |
| 99 | this.sourceReference = container.getSourceReference(url); |
| 100 | this._contentGetter = once(contentGetter); |
| 101 | this._container = container; |
| 102 | this.absolutePath = absolutePath || ''; |
| 103 | this._fqname = this._fullyQualifiedName(); |
| 104 | this._name = this._humanName(); |
| 105 | this.setSourceMapUrl(sourceMapMetadata); |
| 106 | |
| 107 | this._existingAbsolutePath = this.checkContentHash(contentHash); |
| 108 | } |
| 109 | |
| 110 | /** Returns the absolute path if the conten hash matches. */ |
| 111 | protected checkContentHash(contentHash?: string) { |
nothing calls this directly
no test coverage detected