[TIMOB-5090] Giving names to KrollContext, KrollCallback, etc.
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Trivial |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2020-02-13T15:14:09.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | core, tbs-1.9.0 |
Reporter | Rick Blalock |
Assignee | Eric Merriman |
Created | 2011-08-24T06:15:23.000+0000 |
Updated | 2020-02-13T15:14:09.000+0000 |
Description
If you do something like console out 'this' inside a callback you get
back "KrollCallback 0x000123". In Instruments you can see where this is
at by looking at the '0x000123' or however many characters it is.
Is there a way to name these? A good example is NodeJS. When you're
doing any debugging in NodeJS you can name your callbacks in place and
they will show up in the stack trace. I.e. someEvent('res', function
coolbeans() {}); Then 'coolbeans' will show up in the stack trace. Is
it possible to give KrollCallbacks actual names?
I do want the memory address (it'd be 32 bits, so 8 digits) to stay, as it vastly helps in differentiating between objects on the native side. However, we do have some options on what other information is provided as well. The following Kroll classes have JS analogs. * KrollBridge: Not visible to JS. * KrollContext: Not visible to JS. * KrollMethod: Represents a function on a proxy. * KrollCallback: Represents a JS function held natively. * KrollWrapper: Represents a JS object, not held. * KrollObject: Proxy, already reports the proxy information.
no longer relevant