easy-scratch/doc/scratch-vm/-_StackFrame.html

1343 lines
79 KiB
HTML
Raw Normal View History

2025-02-12 12:27:32 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>_StackFrame - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
<script src="scripts/nav.js" defer></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav >
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="-_StackFrame.html">_StackFrame</a><ul class='methods'><li data-type='method'><a href="-_StackFrame.html#.create">create</a></li><li data-type='method'><a href="-_StackFrame.html#.release">release</a></li><li data-type='method'><a href="-_StackFrame.html#reset">reset</a></li><li data-type='method'><a href="-_StackFrame.html#reuse">reuse</a></li></ul></li><li><a href="BLE.html">BLE</a><ul class='methods'><li data-type='method'><a href="BLE.html#connectPeripheral">connectPeripheral</a></li><li data-type='method'><a href="BLE.html#didReceiveCall">didReceiveCall</a></li><li data-type='method'><a href="BLE.html#disconnect">disconnect</a></li><li data-type='method'><a href="BLE.html#handleDisconnectError">handleDisconnectError</a></li><li data-type='method'><a href="BLE.html#isConnected">isConnected</a></li><li data-type='method'><a href="BLE.html#read">read</a></li><li data-type='method'><a href="BLE.html#requestPeripheral">requestPeripheral</a></li><li data-type='method'><a href="BLE.html#startNotifications">startNotifications</a></li><li data-type='method'><a href="BLE.html#write">write</a></li></ul></li><li><a href="BlockCached.html">BlockCached</a></li><li><a href="Blocks.html">Blocks</a><ul class='methods'><li data-type='method'><a href="Blocks.html#_addScript">_addScript</a></li><li data-type='method'><a href="Blocks.html#_deleteScript">_deleteScript</a></li><li data-type='method'><a href="Blocks.html#_getBackdropField">_getBackdropField</a></li><li data-type='method'><a href="Blocks.html#_getBlockParams">_getBlockParams</a></li><li data-type='method'><a href="Blocks.html#_getCostumeField">_getCostumeField</a></li><li data-type='method'><a href="Blocks.html#_getCustomBlockInternal">_getCustomBlockInternal</a></li><li data-type='method'><a href="Blocks.html#_getSoundField">_getSoundField</a></li><li data-type='method'><a href="Blocks.html#_getSpriteField">_getSpriteField</a></li><li data-type='method'><a href="Blocks.html#blocklyListen">blocklyListen</a></li><li data-type='method'><a href="Blocks.html#blockToXML">blockToXML</a></li><li data-type='method'><a href="Blocks.html#changeBlock">changeBlock</a></li><li data-type='method'><a href="Blocks.html#createBlock">createBlock</a></li><li data-type='method'><a href="Blocks.html#deleteBlock">deleteBlock</a></li><li data-type='method'><a href="Blocks.html#emitProjectChanged">emitProjectChanged</a></li><li data-type='method'><a href="Blocks.html#getAllVariableAndListReferences">getAllVariableAndListReferences</a></li><li data-type='method'><a href="Blocks.html#getBlock">getBlock</a></li><li data-type='method'><a href="Blocks.html#getBranch">getBranch</a></li><li data-type='method'><a href="Blocks.html#getFields">getFields</a></li><li data-type='method'><a href="Blocks.html#getInputs">getInputs</a></li><li data-type='method'><a href="Blocks.html#getMutation">getMutation</a></li><li data-type='method'><a href="Blocks.html#getNextBlock">getNextBlock</a></li><li data-type='method'><a href="Blocks.html#getOpcode">getOpcode</a></li><li data-type='method'><a href="Blocks.html#getProcedureDefinition">getProcedureDefinition</a></li><li data-type='method'><a href="Blocks.html#getProcedureParamNamesAndIds">getProcedureParamNamesAndIds</a></li><li data-type='method'><a href="Blocks.html#getProcedureParamNamesIdsAndDefaults">getProcedureParamNamesIdsAndDefaults</a></li><li data-type='method'><a href="Blocks.html#getScripts">getScripts</a></li><li data-type='method'><a href="Blocks.html#getTopLevelScript">getTopLevelScript</a></li><li data-type='method'><a href="Blocks.html#moveBlock">moveBlock</a></li><li data-type='method'><a href="Blocks.html#mutationToXML">mutationToXML</a></li><li data-type='method'><a href="Blocks.html#resetCache">resetCache</a></li><li data-type='method'><a href="Blocks.html#runAllMonitored">runAllMonitored</a></li><li data-type='method'><a href="Blocks.html#toXML">toXML</a></li><li data-type='method'><a href="Blocks.html#updateAssetName">updateAssetName</a></li><li data-type='method'><a href
</nav>
<div id="main">
<h1 class="page-title">_StackFrame</h1>
<section>
<header>
<h2>
_StackFrame
</h2>
<div class="class-description"><p>A frame used for each level of the stack. A general purpose
place to store a bunch of execution context and parameters</p></div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="_StackFrame"><span class="type-signature">(private) </span>new _StackFrame<span class="signature">(warpMode)</span><span class="type-signature"></span></h4>
<dl class="details">
</dl>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>warpMode</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Whether this level of the stack is warping</p></td>
</tr>
</tbody>
</table>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="executionContext"><span class="type-signature"></span>executionContext<span class="type-signature"> :Object</span></h4>
<dl class="details">
</dl>
<div class="description">
<p>A context passed to block implementations.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h4 class="name" id="isLoop"><span class="type-signature"></span>isLoop<span class="type-signature"> :boolean</span></h4>
<dl class="details">
</dl>
<div class="description">
<p>Whether this level of the stack is a loop.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">boolean</span>
</li>
</ul>
<h4 class="name" id="justReported"><span class="type-signature"></span>justReported<span class="type-signature"> :Any</span></h4>
<dl class="details">
</dl>
<div class="description">
<p>Reported value from just executed block.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Any</span>
</li>
</ul>
<h4 class="name" id="params"><span class="type-signature"></span>params<span class="type-signature"> :Object</span></h4>
<dl class="details">
</dl>
<div class="description">
<p>Procedure parameters.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h4 class="name" id="reported"><span class="type-signature"></span>reported<span class="type-signature"> :Object</span></h4>
<dl class="details">
</dl>
<div class="description">
<p>Persists reported inputs during async block.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">Object</span>
</li>
</ul>
<h4 class="name" id="reporting"><span class="type-signature"></span>reporting<span class="type-signature"> :string</span></h4>
<dl class="details">
</dl>
<div class="description">
<p>The active block that is waiting on a promise.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<h4 class="name" id="waitingReporter"><span class="type-signature"></span>waitingReporter<span class="type-signature"> :string</span></h4>
<dl class="details">
</dl>
<div class="description">
<p>Name of waiting reporter.</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">string</span>
</li>
</ul>
<h4 class="name" id="warpMode"><span class="type-signature"></span>warpMode<span class="type-signature"> :boolean</span></h4>
<dl class="details">
</dl>
<div class="description">
<p>Whether this level is in warp mode. Is set by some legacy blocks and
&quot;turbo mode&quot;</p>
</div>
<h5>Type:</h5>
<ul>
<li>
<span class="param-type">boolean</span>
</li>
</ul>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".create"><span class="type-signature">(static) </span>create<span class="signature">(warpMode)</span><span class="type-signature"> &rarr; {<a href="-_StackFrame.html">_StackFrame</a>}</span></h4>
<dl class="details">
</dl>
<div class="description">
<p>Create or recycle a stack frame object.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>warpMode</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="description last"><p>Enable warpMode on this frame.</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
<p>The clean stack frame with correct warpMode setting.</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="-_StackFrame.html">_StackFrame</a></span>
</dd>
</dl>
<h4 class="name" id=".release"><span class="type-signature">(static) </span>release<span class="signature">(stackFrame)</span><span class="type-signature"></span></h4>
<dl class="details">
</dl>
<div class="description">
<p>Put a stack frame object into the recycle bin for reuse.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>stackFrame</code></td>
<td class="type">
<span class="param-type"><a href="-_StackFrame.html">_StackFrame</a></span>
</td>
<td class="description last"><p>The frame to reset and recycle.</p></td>
</tr>
</tbody>
</table>
<h4 class="name" id="reset"><span class="type-signature"></span>reset<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="-_StackFrame.html">_StackFrame</a>}</span></h4>
<dl class="details">
</dl>
<div class="description">
<p>Reset all properties of the frame to pristine null and false states.
Used to recycle.</p>
</div>
<h5>Returns:</h5>
<div class="param-desc">
<p>this</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="-_StackFrame.html">_StackFrame</a></span>
</dd>
</dl>
<h4 class="name" id="reuse"><span class="type-signature"></span>reuse<span class="signature">(warpMode<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {<a href="-_StackFrame.html">_StackFrame</a>}</span></h4>
<dl class="details">
</dl>
<div class="description">
<p>Reuse an active stack frame in the stack.</p>
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>warpMode</code></td>
<td class="type">
<span class="param-type">boolean</span>
</td>
<td class="attributes">
&lt;nullable><br>
</td>
<td class="description last"><p>defaults to current warpMode</p></td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
<p>this</p>
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="-_StackFrame.html">_StackFrame</a></span>
</dd>
</dl>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/polyfill.js"></script>
<script src="scripts/linenumber.js"></script>
</body>
</html>