Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upQuestions about GetValue() in Runtime Semantics Evaluation of the with Statement in 13.11.7 #1297
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
devsnek
Aug 26, 2018
Contributor
in your example Expression is an Identifier which gets evaluated into a Reference whose base component is the global environment record, and the referenced name is "Math"
|
in your example Expression is an Identifier which gets evaluated into a Reference whose base component is the global environment record, and the referenced name is "Math" |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
sakura90
commented
Aug 28, 2018
|
Thank you very much. I have got a better understanding. |
sakura90
closed this
Aug 28, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sakura90 commentedAug 26, 2018
Hi,
Some questions about the following steps in 13.11.7.
13.11.7 Runtime Semantics: Evaluation
WithStatement : with ( Expression ) Statement
I guess I understand most of what the evaluation is about. The object of Expression is binded in a new environment, and Statement is evaluated in the new environment.
I am not very sure about the details of some of the steps and I have some questions below.
In step 1, what is the specification type of val?
In step 2, what is the reference that calls GetValue(val)?
If the specification type of val is reference, in step 3 in 6.2.4.8 GetValue(V), what does the base value component of V store? And in step 5b, what does the referenced name component of V store?
If an example is going to help explain, please use the following example or any other examples for the explanation.
var a, x, y;
var r = 10;
with (Math) {
a = PI * r * r;
x = r * cos(PI);
y = r * sin(PI / 2);
}
The questions may be asking too many details of 13.11.7, and it may not be what the way is to understand 13.11.7. If the steps of 13.11.7 are supposed to be conveying the rough steps of how evaluation is done, and my understanding does not have to cover the details, please feel free to let me know.
Thanks,
Patrick