This file is indexed.

/usr/share/doc/libjuce/apiref/classJavascriptEngine.html is in libjuce-doc 4.3.0~repack-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JUCE: JavascriptEngine Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">JUCE
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.12 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="classJavascriptEngine-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">JavascriptEngine Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A simple javascript interpreter!  
 <a href="classJavascriptEngine.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a4982557880163aadbad5337751057269"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classJavascriptEngine.html#a4982557880163aadbad5337751057269">JavascriptEngine</a> ()</td></tr>
<tr class="memdesc:a4982557880163aadbad5337751057269"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates an instance of the engine.  <a href="#a4982557880163aadbad5337751057269">More...</a><br /></td></tr>
<tr class="separator:a4982557880163aadbad5337751057269"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7b279a3ee909a2324804a73f16a6708"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classJavascriptEngine.html#af7b279a3ee909a2324804a73f16a6708">~JavascriptEngine</a> ()</td></tr>
<tr class="memdesc:af7b279a3ee909a2324804a73f16a6708"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#af7b279a3ee909a2324804a73f16a6708">More...</a><br /></td></tr>
<tr class="separator:af7b279a3ee909a2324804a73f16a6708"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0726c85d9bad8b676f9820a36135b203"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classResult.html">Result</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classJavascriptEngine.html#a0726c85d9bad8b676f9820a36135b203">execute</a> (const <a class="el" href="classString.html">String</a> &amp;javascriptCode)</td></tr>
<tr class="memdesc:a0726c85d9bad8b676f9820a36135b203"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attempts to parse and run a block of javascript code.  <a href="#a0726c85d9bad8b676f9820a36135b203">More...</a><br /></td></tr>
<tr class="separator:a0726c85d9bad8b676f9820a36135b203"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0cf3bac2ba4e208b69b09777f84a3f8c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classvar.html">var</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classJavascriptEngine.html#a0cf3bac2ba4e208b69b09777f84a3f8c">evaluate</a> (const <a class="el" href="classString.html">String</a> &amp;javascriptCode, <a class="el" href="classResult.html">Result</a> *errorMessage=nullptr)</td></tr>
<tr class="memdesc:a0cf3bac2ba4e208b69b09777f84a3f8c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attempts to parse and run a javascript expression, and returns the result.  <a href="#a0cf3bac2ba4e208b69b09777f84a3f8c">More...</a><br /></td></tr>
<tr class="separator:a0cf3bac2ba4e208b69b09777f84a3f8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a875997c4f7e2ac48977b04d707253851"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classvar.html">var</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classJavascriptEngine.html#a875997c4f7e2ac48977b04d707253851">callFunction</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;function, const <a class="el" href="structvar_1_1NativeFunctionArgs.html">var::NativeFunctionArgs</a> &amp;args, <a class="el" href="classResult.html">Result</a> *errorMessage=nullptr)</td></tr>
<tr class="memdesc:a875997c4f7e2ac48977b04d707253851"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calls a function in the root namespace, and returns the result.  <a href="#a875997c4f7e2ac48977b04d707253851">More...</a><br /></td></tr>
<tr class="separator:a875997c4f7e2ac48977b04d707253851"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c9f43562e6e82084d5e92a714bfa5eb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classJavascriptEngine.html#a0c9f43562e6e82084d5e92a714bfa5eb">registerNativeObject</a> (const <a class="el" href="classIdentifier.html">Identifier</a> &amp;objectName, <a class="el" href="classDynamicObject.html">DynamicObject</a> *object)</td></tr>
<tr class="memdesc:a0c9f43562e6e82084d5e92a714bfa5eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a native object to the root namespace.  <a href="#a0c9f43562e6e82084d5e92a714bfa5eb">More...</a><br /></td></tr>
<tr class="separator:a0c9f43562e6e82084d5e92a714bfa5eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abc067f3103d266c44d417cbac8380f56"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classNamedValueSet.html">NamedValueSet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classJavascriptEngine.html#abc067f3103d266c44d417cbac8380f56">getRootObjectProperties</a> () const noexcept</td></tr>
<tr class="memdesc:abc067f3103d266c44d417cbac8380f56"><td class="mdescLeft">&#160;</td><td class="mdescRight">Provides access to the set of properties of the root namespace object.  <a href="#abc067f3103d266c44d417cbac8380f56">More...</a><br /></td></tr>
<tr class="separator:abc067f3103d266c44d417cbac8380f56"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a4a08635cda469509d851264f9fcf2c46"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classRelativeTime.html">RelativeTime</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classJavascriptEngine.html#a4a08635cda469509d851264f9fcf2c46">maximumExecutionTime</a></td></tr>
<tr class="memdesc:a4a08635cda469509d851264f9fcf2c46"><td class="mdescLeft">&#160;</td><td class="mdescRight">This value indicates how long a call to one of the evaluate methods is permitted to run before timing-out and failing.  <a href="#a4a08635cda469509d851264f9fcf2c46">More...</a><br /></td></tr>
<tr class="separator:a4a08635cda469509d851264f9fcf2c46"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A simple javascript interpreter! </p>
<p>It's not fully standards-compliant, and won't be as fast as the fancy JIT-compiled engines that you get in browsers, but this is an extremely compact, low-overhead javascript interpreter, which is integrated with the juce var and <a class="el" href="classDynamicObject.html" title="Represents a dynamically implemented object. ">DynamicObject</a> classes. If you need a few simple bits of scripting in your app, and want to be able to easily let the JS work with native objects defined as <a class="el" href="classDynamicObject.html" title="Represents a dynamically implemented object. ">DynamicObject</a> subclasses, then this might do the job.</p>
<p>To use, simply create an instance of this class and call <a class="el" href="classJavascriptEngine.html#a0726c85d9bad8b676f9820a36135b203" title="Attempts to parse and run a block of javascript code. ">execute()</a> to run your code. Variables that the script sets can be retrieved with <a class="el" href="classJavascriptEngine.html#a0cf3bac2ba4e208b69b09777f84a3f8c" title="Attempts to parse and run a javascript expression, and returns the result. ">evaluate()</a>, and if you need to provide native objects for the script to use, you can add them with <a class="el" href="classJavascriptEngine.html#a0c9f43562e6e82084d5e92a714bfa5eb" title="Adds a native object to the root namespace. ">registerNativeObject()</a>.</p>
<p>One caveat: Because the values and objects that the engine works with are <a class="el" href="classDynamicObject.html" title="Represents a dynamically implemented object. ">DynamicObject</a> and var objects, they use reference-counting rather than garbage-collection, so if your script creates complex connections between objects, you run the risk of creating cyclic dependencies and hence leaking. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a4982557880163aadbad5337751057269"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4982557880163aadbad5337751057269">&sect;&nbsp;</a></span>JavascriptEngine()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">JavascriptEngine::JavascriptEngine </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates an instance of the engine. </p>
<p>This creates a root namespace and defines some basic Object, <a class="el" href="classString.html" title="The JUCE String class! ">String</a>, <a class="el" href="classArray.html" title="Holds a resizable array of primitive or copy-by-value objects. ">Array</a> and Math library methods. </p>

</div>
</div>
<a id="af7b279a3ee909a2324804a73f16a6708"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af7b279a3ee909a2324804a73f16a6708">&sect;&nbsp;</a></span>~JavascriptEngine()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">JavascriptEngine::~JavascriptEngine </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destructor. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a0726c85d9bad8b676f9820a36135b203"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0726c85d9bad8b676f9820a36135b203">&sect;&nbsp;</a></span>execute()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classResult.html">Result</a> JavascriptEngine::execute </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td>
          <td class="paramname"><em>javascriptCode</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Attempts to parse and run a block of javascript code. </p>
<p>If there's a parse or execution error, the error description is returned in the result. You can specify a maximum time for which the program is allowed to run, and it'll return with an error message if this time is exceeded. </p>

</div>
</div>
<a id="a0cf3bac2ba4e208b69b09777f84a3f8c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0cf3bac2ba4e208b69b09777f84a3f8c">&sect;&nbsp;</a></span>evaluate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classvar.html">var</a> JavascriptEngine::evaluate </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classString.html">String</a> &amp;&#160;</td>
          <td class="paramname"><em>javascriptCode</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classResult.html">Result</a> *&#160;</td>
          <td class="paramname"><em>errorMessage</em> = <code>nullptr</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Attempts to parse and run a javascript expression, and returns the result. </p>
<p>If there's a syntax error, or the expression can't be evaluated, the return value will be <a class="el" href="classvar.html#aa8ad714f97623c9c8f0e0e7e139b09d4" title="Returns a var object that can be used where you need the javascript &quot;undefined&quot; value. ">var::undefined()</a>. The errorMessage parameter gives you a way to find out any parsing errors. You can specify a maximum time for which the program is allowed to run, and it'll return with an error message if this time is exceeded. </p>

</div>
</div>
<a id="a875997c4f7e2ac48977b04d707253851"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a875997c4f7e2ac48977b04d707253851">&sect;&nbsp;</a></span>callFunction()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classvar.html">var</a> JavascriptEngine::callFunction </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td>
          <td class="paramname"><em>function</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structvar_1_1NativeFunctionArgs.html">var::NativeFunctionArgs</a> &amp;&#160;</td>
          <td class="paramname"><em>args</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classResult.html">Result</a> *&#160;</td>
          <td class="paramname"><em>errorMessage</em> = <code>nullptr</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calls a function in the root namespace, and returns the result. </p>
<p>The function arguments are passed in the same format as used by native methods in the var class. </p>

</div>
</div>
<a id="a0c9f43562e6e82084d5e92a714bfa5eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c9f43562e6e82084d5e92a714bfa5eb">&sect;&nbsp;</a></span>registerNativeObject()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void JavascriptEngine::registerNativeObject </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classIdentifier.html">Identifier</a> &amp;&#160;</td>
          <td class="paramname"><em>objectName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classDynamicObject.html">DynamicObject</a> *&#160;</td>
          <td class="paramname"><em>object</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds a native object to the root namespace. </p>
<p>The object passed-in is reference-counted, and will be retained by the engine until the engine is deleted. The name must be a simple JS identifier, without any dots. </p>

</div>
</div>
<a id="abc067f3103d266c44d417cbac8380f56"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc067f3103d266c44d417cbac8380f56">&sect;&nbsp;</a></span>getRootObjectProperties()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classNamedValueSet.html">NamedValueSet</a>&amp; JavascriptEngine::getRootObjectProperties </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Provides access to the set of properties of the root namespace object. </p>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="a4a08635cda469509d851264f9fcf2c46"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a08635cda469509d851264f9fcf2c46">&sect;&nbsp;</a></span>maximumExecutionTime</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classRelativeTime.html">RelativeTime</a> JavascriptEngine::maximumExecutionTime</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This value indicates how long a call to one of the evaluate methods is permitted to run before timing-out and failing. </p>
<p>The default value is a number of seconds, but you can change this to whatever value suits your application. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="juce__Javascript_8h.html">juce_Javascript.h</a></li>
</ul>
</div><!-- contents -->
<hr class="footer"/>
<address class="footer"><small>All content &copy ROLI Ltd.</small></address><br/>
</body>
</html>