JS IsExternalString

  • Revision slug: SpiderMonkey/JSAPI_Reference/JS_IsExternalString
  • Revision title: JS IsExternalString
  • Revision id: 313543
  • Created:
  • Creator: tschneidereit
  • Is current revision? No
  • Comment

Revision Content

{{ Jsapi_minversion_header("6") }}

Determines whether or not the specified JSString is an external string (that is, a string created by calling JS_NewExternalString() rather than JS_NewExternalStringWithClosure()).

Syntax

JSBool JS_IsExternalString(JSContext *cx, JSString *str);
Name Type Description
cx JSContext * The context from which to retrieve the closure for a string. {{ Jsapi-requires-request() }}
str JSString * The string to check.

The returned value is true if the string is an external string; otherwise it's false.

{{ LXRSearch("ident", "i", "JS_GetExternalStringClosure") }}

Revision Source

<p>{{ Jsapi_minversion_header("6") }}</p>
<p>Determines whether or not the specified <code><a href="/en/SpiderMonkey/JSAPI_Reference/JSString" title="en/SpiderMonkey/JSAPI Reference/JSString">JSString</a></code> is an external string (that is, a string created by calling <a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewExternalString" title="en/SpiderMonkey/JSAPI Reference/JS NewExternalString"><code>JS_NewExternalString()</code></a> rather than <a href="/en/SpiderMonkey/JSAPI_Reference/JS_NewExternalString" title="en/SpiderMonkey/JSAPI Reference/JS NewExternalString"><code>JS_NewExternalStringWithClosure()</code></a>).</p>
<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="eval">
<a href="/En/SpiderMonkey/JSAPI_Reference/JSBool" title="en/SpiderMonkey/JSAPI Reference/JSBool">JSBool</a> <strong>JS_IsExternalString</strong>(<a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a> *cx, <a href="/en/SpiderMonkey/JSAPI_Reference/JSString" title="en/JSString">JSString</a> *str);</pre>
<table class="fullwidth-table">
  <tbody>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
    </tr>
    <tr>
      <td><code>cx</code></td>
      <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/JSRuntime" title="en/JSRuntime">JSContext</a>&nbsp;*</code></td>
      <td>The context from which to retrieve the closure for a string. {{ Jsapi-requires-request() }}</td>
    </tr>
    <tr>
      <td><code>str</code></td>
      <td><code><a href="/en/SpiderMonkey/JSAPI_Reference/JSString" title="en/SpiderMonkey/JSAPI Reference/JSString">JSString</a> *</code></td>
      <td>The string to check.</td>
    </tr>
  </tbody>
</table>
<p>The returned value is <code>true</code> if the string is an external string; otherwise it's <code>false</code>.</p>
<p>{{ LXRSearch("ident", "i", "JS_GetExternalStringClosure") }}</p>
Revert to this revision