mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
Merge commit '6e92d2345e8231a44556ce7d416451f5f3e6c398' as 'engine262'
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import type { Protocol } from 'devtools-protocol';
|
||||
import { DynamicParsedCodeRecord, SourceTextModuleRecord, type ScriptRecord } from '#self';
|
||||
|
||||
export function getParsedEvent(source: ScriptRecord | SourceTextModuleRecord | DynamicParsedCodeRecord, id: string, executionContextId: number): Protocol.Debugger.ScriptParsedEvent {
|
||||
const lines = source.ECMAScriptCode.sourceText.split('\n');
|
||||
return {
|
||||
isModule: source instanceof SourceTextModuleRecord,
|
||||
scriptId: id,
|
||||
url: source.HostDefined.specifier || `vm:///${id}`,
|
||||
startLine: 0,
|
||||
startColumn: 0,
|
||||
endLine: lines.length,
|
||||
endColumn: lines.pop()!.length,
|
||||
executionContextId,
|
||||
hash: '',
|
||||
buildId: '',
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user