Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>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 declarative environment record 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> </blockquote> <p>Nearly. It does contain <code>foo</code>, <code>bar</code> and <code>test_bar</code> (with their values). The environment record is part of an lexical environment that has a pointer to its "outer lexical environment" that holds the record with the global variables like <code>test_test_bar</code>.</p> <blockquote> <p>And one question: Is it true that for all syntactic elements there exists only one environment record. </p> </blockquote> <p>No. Environment records don't have much to do with syntactic elements, they are created dynamically at runtime within the execution contexts. There might as well be multiple environment records alive for the same code element, say in a closure. What the spec said is: "<em>environment records are used to define <strong>the effect</strong> of ECMAScript language syntactic elements</em>". They represent the structures that are used to explain what should happen when a syntax element is executed.</p> <blockquote> <p>What does mean <em>bound name</em> 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> </blockquote> <p>Nah, it's only the <code>Identifier</code>. The pair of identifier and value is called <em>binding</em>. To assign a value to an identifier, you use the <code>SetMutableBinding(bound_name, value, strict_flag)</code> method.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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