summaryrefslogtreecommitdiff
path: root/js/src/vm/SelfHosting.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/vm/SelfHosting.h')
-rw-r--r--js/src/vm/SelfHosting.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/vm/SelfHosting.h b/js/src/vm/SelfHosting.h
index 6b1a03e851..04962f4445 100644
--- a/js/src/vm/SelfHosting.h
+++ b/js/src/vm/SelfHosting.h
@@ -22,6 +22,19 @@ namespace js {
bool
IsSelfHostedFunctionWithName(JSFunction* fun, JSAtom* name);
+/*
+ * Returns the name of the function's binding in the self-hosted global.
+ *
+ * This returns a non-null value only when:
+ * * This is a top level function declaration in the self-hosted global.
+ * * And either:
+ * * This function is not cloned and `_SetCanonicalName` has been called to
+ * set a different function name.
+ * * This function is cloned.
+ *
+ * For functions not cloned and not `_SetCanonicalName`ed, use
+ * `fun->explicitName()` instead.
+ */
JSAtom*
GetSelfHostedFunctionName(JSFunction* fun);