Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 57888 of Object.prototype.eval()

  • Revision slug: JavaScript/Reference/Global_Objects/Object/eval
  • Revision title: eval
  • Revision id: 57888
  • Created:
  • Creator: fryn
  • Is current revision? No
  • Comment one or more formatting changes; page display name reset to default

Revision Content

{{ Obsolete_header() }}

Summary

Deprecated. Evaluates a string of JavaScript code in the context of an object.

Method of Object
Implemented in: JavaScript 1.1, NES2.0

JavaScript 1.2, NES 3.0: Deprecated as a method of objects; retained as a top-level function.

Syntax

object.eval(string)

Parameters

string 
Any string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects.

Description

The eval method should no longer be used as a method of Object. Use the top-level eval function instead.

See Also

eval

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

Revision Source

<p>{{ Obsolete_header() }}</p>
<h3 name="Summary">Summary</h3>
<p>Deprecated. Evaluates a string of JavaScript code in the context of an object.</p>
<table class="fullwidth-table"> <tbody> <tr> <td class="header" colspan="2">Method of <a href="/en/JavaScript/Reference/Global_Objects/Object" title="en/Core_JavaScript_1.5_Reference/Global_Objects/Object">Object</a></td> </tr> <tr> <td>Implemented in:</td> <td>JavaScript 1.1, NES2.0 <p>JavaScript 1.2, NES 3.0: Deprecated as a method of objects; retained as a top-level function.</p> </td> </tr> </tbody>
</table>
<h3 name="Syntax">Syntax</h3>
<p><code><em>object</em>.eval(<em>string</em>)</code></p>
<h3 name="Parameters">Parameters</h3>
<dl> <dt><code>string</code> </dt> <dd>Any string representing a JavaScript expression, statement, or sequence of statements. The expression can include variables and properties of existing objects.</dd>
</dl>
<h3 name="Description">Description</h3>
<p>The <code>eval</code> method should no longer be used as a method of <code>Object</code>. Use the top-level <code><a href="/en/JavaScript/Reference/Global_Objects/eval" title="en/JavaScript/Reference/Global_Functions/eval">eval</a></code> function instead.</p>
<h3 name="See_Also">See Also</h3>
<p><a href="/en/JavaScript/Reference/Global_Objects/eval" title="en/JavaScript/Reference/Global_Functions/eval">eval</a></p>
<p>{{ languages( { "ja": "ja/Core_JavaScript_1.5_Reference/Global_Objects/Object/eval", "pl": "pl/Dokumentacja_j\u0119zyka_JavaScript_1.5/Obiekty/Object/eval" } ) }}</p>
Revert to this revision