Debugger: Difference between revisions

Jump to navigation Jump to search
158 bytes added ,  6 September 2012
0bb3b79 In Debugger.Environment, change setVariable not to create new bindings. Add deleteVariable.
([master c06c44c] Clarify Debugger.Object::evalInGlobalWithBindings.)
(0bb3b79 In Debugger.Environment, change setVariable not to create new bindings. Add deleteVariable.)
Line 846: Line 846:


<dt>setVariable(<i>name</i>, <i>value</i>)
<dt>setVariable(<i>name</i>, <i>value</i>)
<dd>Store <i>value</i> as the value of the variable bound to <i>name</i> in this environment, creating the variable if it does not exist. <i>Name</i> must be a string that is a valid ECMAScript identifier name; <i>value</i> must be a debuggee value.
<dd>Store <i>value</i> as the value of the variable bound to <i>name</i> in this environment. <i>Name</i> must be a string that is a valid ECMAScript identifier name; <i>value</i> must be a debuggee value.


If this call would add a new variable to this environment, but implementation restrictions prevent SpiderMonkey from extending the environment as requested, this call throws an <code>Error</code> exception.
If this environment binds no variable named <i>name</i>, throw a <code>ReferenceError</code>.


This is not an [[#Invocation_Functions_and_.22debugger.22_Frames|invocation function]]; if this call would cause debuggee code to run, this call throws a [[#The_Debugger.DebuggeeWouldRun_Exception|<code>Debugger.DebuggeeWouldRun</code>]] exception.
This is not an [[#Invocation_Functions_and_.22debugger.22_Frames|invocation function]]; if this call would cause debuggee code to run, this call throws a [[#The_Debugger.DebuggeeWouldRun_Exception|<code>Debugger.DebuggeeWouldRun</code>]] exception.
Line 858: Line 858:
writing code that operates properly on descriptors for either kind may be difficult.)</i>
writing code that operates properly on descriptors for either kind may be difficult.)</i>


If there is no variable named <i>name</i> bound in this environment, throw a <code>ReferenceError</code>.
If this environment binds no variable named <i>name</i>, throw a <code>ReferenceError</code>.


<dt>defineVariable(<i>name</i>, <i>descriptor</i>)
<dt>defineVariable(<i>name</i>, <i>descriptor</i>)
Line 864: Line 864:


If implementation restrictions prevent SpiderMonkey from creating or reconfiguring the variable as requested, this call throws an <code>Error</code> exception.
If implementation restrictions prevent SpiderMonkey from creating or reconfiguring the variable as requested, this call throws an <code>Error</code> exception.
<dt>deleteVariable(<i>name</i>)
<dd>Delete this environment's binding for <i>name</i>.
If this environment binds no variable named <i>name</i>, throw a <code>ReferenceError</code>.
If implementation restrictions prevent SpiderMonkey from deleting the variable as requested, this call throws an <code>Error</code> exception.


<dt>find(<i>name</i>)
<dt>find(<i>name</i>)
Confirmed users
497

edits

Navigation menu