New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about type Reference in ECMAScript. #1071

Open
dSalieri opened this Issue Jan 22, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@dSalieri

dSalieri commented Jan 22, 2018

When you read the specification, questions arise. I think people who also read this document in different versions also faced problems of not understanding some of the moments in this document.

Now I want to ask a couple of questions to clarify some moments related to the Reference type.

  1. What data is of type Reference in the specification?
  2. The specification says that: "The base value component is either undefined, an Object, a Boolean, a String, a Symbol, a Number, or an Environment Record". I would like to see examples of code with each base value. For example:
/// Definition variable in javascript code (example of javascript code)
var a;
/// Reference structure in engine
Reference = {
    Base: Environment Record, /// It's one of other cases
    ReferencedName: "a", 
    StrictReference: false
}
  1. In the code, in the global code there is a variable bar (declared, bar - example of variable). We can address to it as window.bar orbar ... and here the most interesting. With window.bar what is base? And when bar? We know that declarations in the global code are the Object Records Environment, and if so, base will be appeal to the bar Records Environment. But appeal to the window.bar, base will be a window - type(Object). And here it is not clear. If this is an object environment, then why call through dot will be a window object, but not an object environment?
  2. If inside of object we work with property object, the property of this object will have a Declarative Records Environment or Object Records Environment.
  3. In the older specification, there was a note under the GetValue method. In the note we were talked about creating an object inside the [[Get]] method. Honestly, this note is in the latest versions of the specification, but the end was removed. In ECMAScript 5.1, this note reads as follows: "The only situation where such an actual property (What property is told about?) access is that of this internal method can have a visible effect is when it invokes (Who is invoker?) an accessor function". The most interesting in the last line. Which is "accessor function"? Where is placed? In internal method or outside (in user's object)? In general, this proposal is confusing. I would like to understand what exactly this sentence says.

I would like to hear answers to all questions so that I could share answers on other resources.

@ndugger

This comment has been minimized.

Show comment
Hide comment
@ndugger

ndugger Jan 25, 2018

I would like to hear answers to all questions so that I could share answers on other resources.

So, you want to steal someone's answer here to get reputation points on StackOverflow?

ndugger commented Jan 25, 2018

I would like to hear answers to all questions so that I could share answers on other resources.

So, you want to steal someone's answer here to get reputation points on StackOverflow?

@michaelficarra

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

michaelficarra Jan 25, 2018

Member

@ndugger Assume good intentions.

Member

michaelficarra commented Jan 25, 2018

@ndugger Assume good intentions.

@dSalieri

This comment has been minimized.

Show comment
Hide comment
@dSalieri

dSalieri Jan 26, 2018

@ndugger Really? Are you serious? Reputation on StackOverflow? Interesting idea but no. If you know about my questions - answer. Dont do flood.
P.S I do not need a reputation! I'll just leave a link to my question on the github!

dSalieri commented Jan 26, 2018

@ndugger Really? Are you serious? Reputation on StackOverflow? Interesting idea but no. If you know about my questions - answer. Dont do flood.
P.S I do not need a reputation! I'll just leave a link to my question on the github!

@littledan littledan added the question label Jan 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment