Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 304 Bytes

wrong-this-parameter-in-with-in-eval.md

File metadata and controls

22 lines (18 loc) · 304 Bytes
const obj = {
  foo: function () {
    return { this };
  },
};
with (obj) {
  console.log(eval("foo();"));
}

Normal output and Aran output when instrumenting everything:

{ this: { foo: [Function: foo] } }

Aran output when instrumenting only "foo();":

{ this: undefined }