Skip to content

Instantly share code, notes, and snippets.

@AndreasMadsen
Created August 25, 2014 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreasMadsen/6581c06ca3eb7296477b to your computer and use it in GitHub Desktop.
Save AndreasMadsen/6581c06ca3eb7296477b to your computer and use it in GitHub Desktop.
Add CallSiteGetFunctionArguments to frame object
diff --git a/src/messages.js b/src/messages.js
index c86c12d..ad5921c 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -801,6 +801,10 @@ function CallSiteGetFunction() {
? UNDEFINED : GET_PRIVATE(this, CallSiteFunctionKey);
}
+function CallSiteGetFunctionArguments() {
+ return GET_PRIVATE(this, CallSiteFunctionKey).arguments;
+}
+
function CallSiteGetFunctionName() {
// See if the function knows its own name
var name = GET_PRIVATE(this, CallSiteFunctionKey).name;
@@ -973,6 +977,7 @@ SetUpLockedPrototype(CallSite, $Array("receiver", "fun", "pos"), $Array(
"getEvalOrigin", CallSiteGetEvalOrigin,
"getScriptNameOrSourceURL", CallSiteGetScriptNameOrSourceURL,
"getFunction", CallSiteGetFunction,
+ "getFunctionArguments", CallSiteGetFunctionArguments,
"getFunctionName", CallSiteGetFunctionName,
"getMethodName", CallSiteGetMethodName,
"getFileName", CallSiteGetFileName,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment