# Debugger.Source
A `Debugger.Source` instance represents either a piece of JavaScript source
code or the serialized text of a block of WebAssembly code. The two cases are
distinguished by the latter having its `introductionType` property always
being `"wasm"` and the former having its `introductionType` property never
being `"wasm"`.
Each [`Debugger`][debugger-object] instance has a separate collection of
`Debugger.Source` instances representing the source code that has been
presented to the system.
A debugger may place its own properties on `Debugger.Source` instances,
to store metadata about particular pieces of source code.
## Debugger.Source for JavaScript
For a `Debugger.Source` instance representing a piece of JavaScript source
code, its properties provide the source code itself as a string, and describe
where it came from. Each [`Debugger.Script`][script] instance refers to the
`Debugger.Source` instance holding the source code from which it was produced.
If a single piece of source code contains both top-level code and
function definitions, perhaps with nested functions, then the
[`Debugger.Script`][script] instances for those all refer to the same
`Debugger.Source` instance. Each script indicates the substring of the
overall source to which it corresponds.
A `Debugger.Source` instance may represent only a portion of a larger
source document. For example, an HTML document can contain JavaScript in
multiple `` elements.
* `"injectedScript"`, for code belonging to scripts that _would_ be
`"inlineScript"` except that they were not part of the initial file itself.
For example, scripts created via:
* `document.write("")`
* `var s = document.createElement("script"); s.text = "code";`
* `"importedModule"`, for code that was loaded indirectly by being imported
by another script using ESM static or dynamic imports.
* `"javascriptURL"`, for code presented in `javascript:` URLs.
* `"domTimer"`, for code passed to `setTimeout`/`setInterval` as a string.
* `"self-hosted"`, for internal self-hosted JS code.
* `undefined`, if the implementation doesn't know how the code was
introduced.
**If the instance refers to WebAssembly code**, `"wasm"`.
### `introductionScript` & `introductionOffset`
**If the instance refers to JavaScript source**, and if this source was
introduced by calling a function from debuggee code, then
`introductionScript` is the [`Debugger.Script`][script] instance referring
to the script containing that call, and `introductionOffset` is the call's
bytecode offset within that script. Otherwise, these are both `undefined`.
Taken together, these properties indicate the location of the introducing
call.
For the purposes of these accessors, assignments to accessor properties are
treated as function calls. Thus, setting a DOM element's event handler IDL
attribute by assigning to the corresponding JavaScript property creates a
source whose `introductionScript` and `introductionOffset` refer to the
property assignment.
Since a `