[TIMOB-19701] Android: Support extending native types in hyperloop
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2015-11-12T17:30:30.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 5.4.0 |
| Components | Android, Hyperloop |
| Labels | n/a |
| Reporter | Christopher Williams |
| Assignee | Christopher Williams |
| Created | 2015-10-09T14:10:22.000+0000 |
| Updated | 2018-08-06T17:49:16.000+0000 |
Description
Support some syntax that allows users to subclass existing native types in Hyperloop JS.
https://github.com/appcelerator/hyperloop-android-module/pull/10
Example syntax/impl:
you call Supertype.extend({}); the argument is a JSObject with overriding method implementations. The key is the overriden method name, the value is the overriding function implementationvar AuthenticationCallback = require('android.hardware.fingerprint.FingerprintManager.AuthenticationCallback'); var callback = AuthenticationCallback.extend({ onAuthenticationError: function(code, msg) { console.log('onAuthenticationError'); }, onAuthenticationHelp: function (code, help) { console.log('onAuthenticationHelp'); }, onAuthenticationSucceeded: function (result) { console.log('onAuthenticationSucceeded'); }, onAuthenticationFailed: function () { console.log('onAuthenticationFailed'); }, onAuthenticationAcquired: function (code) { console.log('onAuthenticationAcquired'); } });Expected Result: console.log will appear when executed. Without this PR, there's no logging.
[~cng], I see no console logs when I run the code above. Any thoughts ?
[~cwilliams] ^ ?
Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.