For Function.prototype’s script, this is null. For scripts created by eval or the Function constructor, this may be a synthesized filename, starting with a valid URL and followed by information tracking how the code was introduced into the system the entire string is not a valid URL. If the instance refers to a JSScript, the filename or URL from which this script’s code was loaded. If the script’s function has no name, SpiderMonkey attempts to infer an appropriate name for it given its context. If the script’s function has a given name, its display name is the same as its function’s given name. If the script has no display name - for example, if it is a top-level eval script - this is undefined. If the instance refers to a JSScript, this is the script’s display name, if it has one. True if this instance refers to a JSScript for an async function, defined with an async function expression or statement. True if this instance refers to a JSScript for a function defined with a function* expression or statement. Accessor Properties of the Debugger.Script Prototype Object ¶Ī Debugger.Script instance inherits the following accessor properties from its prototype: isGeneratorFunction If the behavior does not differ, no such emphasized headings will appear. Convention ¶įor descriptions of properties and methods below, if the behavior of the property or method differs between the instance referring to a JSScript or to a block of WebAssembly code, the text will be split into two sections, headed by “ if the instance refers to a JSScript” and “ if the instance refers to WebAssembly code”, respectively. Please note at the time of this writing, support for WebAssembly is very preliminary. SpiderMonkey constructs exactly one Debugger.Script for each underlying WebAssembly module per Debugger instance.Ī Debugger.Script instance is a strong reference to the underlying WebAssembly module it protects the module it refers to from being garbage collected. Debugger.Script for WebAssembly ¶įor Debugger.Script instances referring to a block of WebAssembly code, they are distinguished by their format property being "wasm".Ĭurrently only entire modules evaluated via new WebAssembly.Module are represented.ĭebugger.Script objects for WebAssembly are uncovered via onNewScript when a new WebAssembly module is instantiated and via the findScripts method on Debugger instances. Note that SpiderMonkey may use the same Debugger.Script instances for equivalent functions or evaluated code-that is, scripts representing the same source code, at the same position in the same source file, evaluated in the same lexical environment. This allows the code using each Debugger instance to place whatever properties it likes on its Debugger.Script instances, without worrying about interfering with other debuggers.)Ī Debugger.Script instance is a strong reference to a JSScript object it protects the script it refers to from being garbage collected. (If more than one Debugger instance is debugging the same code, each Debugger gets a separate Debugger.Script instance for a given script. For a given Debugger instance, SpiderMonkey constructs exactly one Debugger.Script instance for each underlying script object debugger code can add its own properties to a script object and expect to find them later, use = to decide whether two expressions refer to the same script, and so on. The Debugger interface constructs Debugger.Script objects as scripts of debuggee code are uncovered by the debugger: via the onNewScript handler method via Debugger.Frame’s script properties via the functionScript method of Debugger.Object instances and so on. The code passed to a single call to eval, excluding the bodies of any functions that code defines.Ī DOM event handler, whether embedded in HTML or attached to the element by other JavaScript code. The body of a function-that is, all the code in the function that is not contained within some nested function. Debugger.Script for JSScripts ¶įor Debugger.Script instances referring to a JSScript, they are distinguished by their format property being "js".Įach of the following is represented by a single JSScript object: The two cases are distinguished by their format property being "js" or "wasm". For the former, it is the Debugger API’s presentation of a JSAPI JSScript object. Turning on Firefox tests for a new configurationĪ Debugger.Script instance may refer to a sequence of bytecode in the debuggee or to a block of WebAssembly code.Getting Set Up To Work On The Firefox Codebase.
0 Comments
Leave a Reply. |