0

The question is not what these entities contain. The question in terms of their use. I.e what sense from VarDeclaredNames if in VarScopeDeclarations contains and names (at least it is possible to extract) (Same touchesLexicallyDeclaredNames, LexicallyScopeDeclarations)

For example

  1. http://www.ecma-international.org/ecma-262/#sec-functiondeclarationinstantiation
    • Has VarDeclaredNames, LexicallyDeclaredNames, VarScopeDeclarations, LexicallyScopeDeclarations
  2. http://www.ecma-international.org/ecma-262/#sec-globaldeclarationinstantiation
    • Has VarDeclaredNames, LexicallyDeclaredNames, VarScopeDeclarations, LexicallyScopeDeclarations
  3. http://www.ecma-international.org/ecma-262/#sec-moduledeclarationinstantiation
    • Has VarScopeDeclarations, LexicallyScopeDeclarations
  4. http://www.ecma-international.org/ecma-262/#sec-blockdeclarationinstantiation
    • Has LexicallyScopeDeclarations
  5. http://www.ecma-international.org/ecma-262/#sec-evaldeclarationinstantiation
    • Has VarDeclaredNames, VarScopeDeclarations, LexicallyScopeDeclarations
MaximPro
  • 563
  • 8
  • 21
  • What do you mean by _"what sense from VarDeclaredNames if in VarScopeDeclarations contains and names "_? – a better oliver May 23 '18 at 13:08
  • @zeroflag Well: **VarScopeDeclarations** (list) - `function a (){/*code*/}, var c = 10 ` **VarDeclaredNames** (list) -`"a","c"` – MaximPro May 23 '18 at 13:12
  • Ok, but the question was: what does the sentence mean? And if you know the difference then what is your actual question? – a better oliver May 23 '18 at 13:16
  • @zeroflagL *The question in terms of their use* What for in the specification `VarDeclaredNames` are used, if `VarScopeDeclarations` contains the information much more and in algorithms of the specification it is visible. Look at GlobalDeclarationInstatiation where `VarScopeDeclarations` is used to create the bindings (to extract the names) – MaximPro May 23 '18 at 13:23
  • It's simpler. If you have to operate on names then you can do that directly. – a better oliver May 23 '18 at 14:16
  • @zeroflagL Really? I'm talking about this and ask! Why use names like `VarDeclaredNames`? I already said that names can be obtained from `VarScopeDeclarations` (which is done in the specification). Then what's the point? I can specify places if necessary. – MaximPro May 23 '18 at 14:32
  • It is a specification's job to be as explicit as possible. Someone implementing this logic would be 100% free to share the logic for it and may well do so, but that doesn't mean it makes sense for the specification language to do so. – loganfsmyth May 23 '18 at 16:37
  • If a task requires just the names, it is inefficient to extract the names from a larger list. In this case, it is more efficient to have a list with just the names extracted beforehand. –  May 23 '18 at 20:31
  • @TinyGiant If you say that it's better to use the list of names in advance, since less time to extract then why the list of names is not used everywhere, but there are places where the list of declarations from which the names are extracted is used? – MaximPro May 24 '18 at 06:32
  • @MaximPro I would have to look more closely at the spec, and probably an implementation, but I'm going to assume that is because in those cases more information is needed than just the names. –  May 24 '18 at 15:41

0 Answers0