Mark wanted to disentangle the meaning of inputs to PerformEval and raised an example https://github.com/tc39/ecma262/pull/1504#discussion_r273709029
Given
const outerRealm = Realm.makeRootRealm();
const outerEval = outerRealm.global.eval;
const innerRealm = Realm.makeRootRealm();
const innerEval = innerRealm.global.eval;
For each of the following two cases, for the evaluation of the code ‘1+2’, what are the evalRealm, the callerRealm, the calleeRealm, the current realm:
direct eval:
outerEval('eval => eval("1 + 2;");')(innerEval);
indirect eval:
outerEval('innerEval => innerEval("1 + 2;");')(innerEval);