aboutsummaryrefslogtreecommitdiff
path: root/files/pt-br/web/javascript/reference/global_objects/string/tosource/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/pt-br/web/javascript/reference/global_objects/string/tosource/index.html')
-rw-r--r--files/pt-br/web/javascript/reference/global_objects/string/tosource/index.html102
1 files changed, 102 insertions, 0 deletions
diff --git a/files/pt-br/web/javascript/reference/global_objects/string/tosource/index.html b/files/pt-br/web/javascript/reference/global_objects/string/tosource/index.html
new file mode 100644
index 0000000000..a7f2bce0d5
--- /dev/null
+++ b/files/pt-br/web/javascript/reference/global_objects/string/tosource/index.html
@@ -0,0 +1,102 @@
+---
+title: String.prototype.toSource()
+slug: Web/JavaScript/Reference/Global_Objects/String/toSource
+tags:
+ - JavaScript
+ - Non-standard
+ - Obsoleto
+ - Prototipo
+ - String
+ - metodo
+translation_of: Web/JavaScript/Reference/Global_Objects/String/toSource
+---
+<div>{{JSRef}} {{obsolete_header}}</div>
+
+<p>O método <code>toSource()</code> retorna uma string que representa o código-fonte do objeto.</p>
+
+<h2 id="Sintaxe">Sintaxe</h2>
+
+<pre class="syntaxbox notranslate"><code>String.toSource()
+<var>str</var>.toSource()
+</code></pre>
+
+<h3 id="Valor_retornado">Valor retornado</h3>
+
+<p>Uma string que representa o código-fonte do objeto chamado.</p>
+
+<h2 id="Exemplos">Exemplos</h2>
+
+<h3 id="Função_nativa">Função nativa</h3>
+
+<p>Para o objeto {{jsxref("String")}} , <code>toSource()</code> retorna  a seguinte string (indicando que o código-fonte não está disponível):</p>
+
+<pre class="brush: js notranslate">function String() {
+ [native code]
+}
+</pre>
+
+<p>Ao chamar {{jsxref("String")}} ou string literais, <code>toSource()</code> retorna a string que representa o código-fonte.</p>
+
+<p>Esse método é usualmente invocado internamente pelo JavaScript e não explicitamente no código.</p>
+
+<h2 id="Especificação">Especificação</h2>
+
+<p>Não é parte de nenhum padrão.</p>
+
+<h2 id="Navegadores_compatíveis">Navegadores compatíveis</h2>
+
+<div>{{CompatibilityTable}}</div>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="Veja_também">Veja também</h2>
+
+<ul>
+ <li>{{jsxref("Object.prototype.toSource()")}}</li>
+</ul>