You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This CL enables the `goog.callerLocation` feature for all users in google3, where JSCompiler will add tracing data to the call sites of functions.
To get tracing data, users need to annotate their function with a parameter that has `goog.callerLocation()` as the default value
This is the flow of how JSCompiler will transform code:
User writes:
```
function signal(here = goog.callerLocation()) {}
signal();
signal();
```
RewriteCallerCodeLocation will rewrite the callsite of this function to include the file paths + lineno + charno of the callsite:
```
function signal(here = goog.callerLocation()) {}
signal(goog.callerLocationIdInternalDoNotCallOrElse('testcode:2:0'))
signal(goog.callerLocationIdInternalDoNotCallOrElse('testcode:3:0'))
```
ReplaceIdGenerators will obfuscate the file paths:
```
function signal(here = goog.callerLocation()) {}
signal('a')
signal('b')
```
PiperOrigin-RevId: 702883718
0 commit comments