mozilla

Revision 16343 of RegExp.prototype.toSource()

  • Revision slug: JavaScript/Reference/Global_Objects/RegExp/toSource
  • Revision title: toSource
  • Revision id: 16343
  • Created:
  • Creator: Mgjbot
  • Is current revision? No
  • Comment robot Adding: [[ja:Core JavaScript 1.5 Reference:Global Objects:RegExp:toSource]]

Revision Content

Summary

Returns a string representing the source code of the object.

Method of RegExp
Implemented in: JavaScript 1.3

Syntax

toSource()

Parameters

None.

Description

The toSource method returns the following values:

  • For the built-in RegExp object, toSource returns the following string indicating that the source code is not available:
function RegExp() {
   [native code]
}
  • For instances of RegExp, toSource returns a string representing the source code.

This method is usually called internally by JavaScript and not explicitly in code.

See Also

Object.toSource

{{ wiki.languages( { "ja": "ja/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/toSource", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/RegExp/toSource" } ) }}

Revision Source

<p>
</p>
<h3 name="Summary"> Summary </h3>
<p>Returns a string representing the source code of the object.
</p>
<table class="fullwidth-table">
<tbody><tr>
<td class="header" colspan="2">Method of <a href="en/Core_JavaScript_1.5_Reference/Objects/RegExp">RegExp</a></td>
</tr>
<tr>
<td>Implemented in:</td>
<td>JavaScript 1.3</td>
</tr>
</tbody></table>
<h3 name="Syntax"> Syntax </h3>
<p><code>
toSource()
</code>
</p>
<h3 name="Parameters"> Parameters </h3>
<p>None.
</p>
<h3 name="Description"> Description </h3>
<p>The <code>toSource</code> method returns the following values:
</p>
<ul><li> For the built-in <code>RegExp</code> object, <code>toSource</code> returns the following string indicating that the source code is not available:
</li></ul>
<pre>function RegExp() {
   [native code]
}
</pre>
<ul><li> For instances of <code>RegExp</code>, <code>toSource</code> returns a string representing the source code.
</li></ul>
<p>This method is usually called internally by JavaScript and not explicitly in code.
</p>
<h3 name="See_Also"> See Also </h3>
<p><a href="en/Core_JavaScript_1.5_Reference/Objects/Object/toSource">Object.toSource</a>
</p>{{ wiki.languages( { "ja": "ja/Core_JavaScript_1.5_Reference/Global_Objects/RegExp/toSource", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/RegExp/toSource" } ) }}
Revert to this revision