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
{{ message }}
Repository navigation
Commit 2dc604f
Browse filesBrowse the repository at this point in the historyBrowse files
feat(runtime): warn when Java dispatches past a class's own method
Java->JS calls look the method up on the JS instance per call, so an own
property of the instance (a per-instance override, a spy, a TypeScript
class-field arrow function) or a method replaced after extend() is what
runs. The iOS runtime binds a class's methods when it is extended and
never sees either. Before deciding whether to align Android with iOS, we
want to know how often apps rely on this.
In debug builds (APPLICATION_IN_DEBUG), each extend() now captures the
implementation object's own function-valued data properties. The class's
record is reached from the wrapper's link state, which the call path
already fetches, and it is keyed lazily by Java's method-name id. A call
that resolves to a different function than the captured one is logged
once per class and method under the JS tag, with the location of the
function that ran. For a name the class does not define, the first call
resolves to whatever the class inherits, unless the instance, its
prototype or the implementation object owns the name.
Behaviour is unchanged: the call still goes to the function it reaches
today. Release builds (nativescript-optimized) compile none of it.
Instances of `new SomeInterface({...})` are not checked yet: their
implementation object is per instance, so a per-class record does not
apply to them.
0 commit comments