Global object, this
and indirect eval call in vm sandbox
#3593
Labels
vm
Issues and PRs related to the vm subsystem.
this
and indirect eval call in vm sandbox
#3593
I have a couple of questions regarding the behavior of
this
and(1, eval)("this")
in vm.According to 18.2.1.1 and 8.1.1.4.11 of ECMAScript language specification,
this
and(1, eval)("this")
in the global scope both resolve to the global object, and according tovm
module docs, the global object is the sandbox argument tovm.runInNewContext
for scripts running this way:Is my understanding correct? I don't really understand these results I got:
false
in (1) and (2)? I know that e.g. mutating or adding properties tothis
inside vm is visible outside, is there a technical reason for these objects not being equal and also for the difference between (6) and (7)?this === (1, eval)("this")
not consistent and why does it depend on the presence ofglobal
in the sandbox's prototype chain? Isglobal
unique in this regard?The text was updated successfully, but these errors were encountered: