function

jsc.callerSourceOrigin

function callerSourceOrigin(): null | string;

Returns the URL of the source file containing the code that called this function, such as "file:///home/me/app/index.ts". Code created with eval or new Function reports the file that created it.

Returns null when no JavaScript caller is on the stack, for example when this function itself is passed as a callback to Promise.prototype.then.

JavaScriptCore performs proper tail calls in strict mode code, which includes every ES module, so a helper that does return callerSourceOrigin() reports the file of the helper's caller rather than its own.