Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

114
Views
Accessing a class by proxing a function called by its constructor

I'm writing a short game hacking project. As such, I need a way to retrieve a class that is wrapped in an anonymous function without any global references. The simplified class layout looks like this:

class n {
  constructor() {
    this.test = localStorage.getItem("test");
  }
}

My approach is to proxy the localStorage.getItem function called inside the constructor. The issue appears when I access the caller: it returns null. My code is as following:

class n {
  constructor() {
    this.test = localStorage.getItem("test");
  }
}

localStorage.getItem = new Proxy(localStorage.getItem, {
  apply: function(target, that, args) {
    console.log(arguments.callee.caller);
  }
})

const l = new n();
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!