getsentry/raven-js — pull request #182 by Stereobit (2014-01-18 18:02:05+00:00)
Title: add option to prevent wrapping also the functions arguments

Hey,

I've been running into some problems when wrapping require JS define and require functions. I often return functions that have to be called as constructor functions. My first approach was checking if the function is called as a constructor function and if so calling the wrapped function with the new keyword as well. Which is impossible as long as you want variable arguments.

The next approach was using a ES6 Object.setPrototypeOf() polyfill. It's working but it is strongly discouraged, because it is very slow and unavoidably slows down subsequent execution in modern JavaScript implementations.

So I ended up adding a option to prevent wrapping the functions arguments.

~ Tobi