1

Is there a way to find if given function reference has a closure and eventually to access to closed variables? I was searching for something similiar to "arguments" property, but in vain.

Edit : outside or inside given function

3
  • Are you asking if you can detect a closure at runtime (e.g., by some runtime state query), or if by examining the code, it is possible to spot where closures might be produced? Commented May 9, 2012 at 6:17
  • @IraBaxter runtime. Doing code analysis for that seems huge overkill for me Commented May 20, 2012 at 11:39
  • It may seem like huge overkill, unless you have another solution. Commented May 20, 2012 at 13:33

1 Answer 1

1

Nope, you will never know. That's why closures are used to emulate private members, since you never know what's inside, hence "private".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.