Note that there are some explanatory texts on larger screens.

plurals
  1. POEnvironment record method CreateMutableBinding in JavaScript
    text
    copied!<h1>About Environment Record</h1> <p>At <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-10.2" rel="nofollow"><strong>sec. 10.2</strong></a> said</p> <blockquote> <p>An Environment Record records the identifier bindings that are created within the scope of its associated Lexical Environment.</p> </blockquote> <p>and at <a href="http://www.ecma-international.org/ecma-262/5.1/#sec-10.2.1" rel="nofollow"><strong>sec 10.2.1</strong></a> said that</p> <blockquote> <p>There are two kinds of Environment Record values used in this specification: declarative environment records and object environment records. Declarative environment records are used to define the effect of ECMAScript language syntactic elements such as FunctionDeclarations, VariableDeclarations, and Catch clauses that directly associate identifier bindings with ECMAScript language values. Object environment records are used to define the effect of ECMAScript elements such as Program and WithStatement that associate identifier bindings with the properties of some object.</p> </blockquote> <p>Please, check my understanding:</p> <p>Thus, if we consider the following code snippet:</p> <pre><code>function foo(){ var bar={prop:'prop'} var test_bar=bar; test_test_bar={p:'p'}; } </code></pre> <p>corresponding <strong>declarative environment record</strong> will be contain bindings <code>bar--&gt;{prop:'prop'}, test_bar--&gt;{prop:'prop'}, test_test_bar--&gt;{p:'p'}</code>. Is it true?</p> <p>And one <strong>question</strong>:</p> <p>Is it true that for all syntactic elements there exists only one <code>environment record</code>. This is either declarative or object environment record.</p> <h1>About Absctract method of environment record</h1> <p><a href="http://www.ecma-international.org/ecma-262/5.1/#sec-10.2.1http://www.ecma-international.org/ecma-262/5.1/#sec-10.2.1" rel="nofollow"><strong>Sec 10.2.1</strong></a> contains info about abstract method of <code>environment record</code>.</p> <p>Method:</p> <p><code>CreateMutableBinding(N, D)</code> </p> <p>Purpose: </p> <blockquote> <p>Create a new mutable binding in an environment record. The String value N is the text of the bound name. If the optional Boolean argument D is true the binding is may be subsequently deleted.</p> </blockquote> <p>So <strong>question</strong> is the following:</p> <p>What does mean <strong>bound name</strong> in this method's purpose? Is it pair of <code>Identifier--&gt;variable</code> such as <code>bar--&gt;{prop:'prop'}</code> in my example above?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload