[TIMOB-6815] Android: Modules: Rhino: Base proxy created instead of derived proxy
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-02-10T00:15:02.000+0000 |
Affected Version/s | Release 1.8.0.1 |
Fix Version/s | Sprint 2012-01, Release 2.0.0, Release 1.8.1 |
Components | Android |
Labels | module_module, qe-testadded |
Reporter | Jeff English |
Assignee | Opie Cyrus |
Created | 2011-12-21T10:17:30.000+0000 |
Updated | 2012-02-10T00:15:02.000+0000 |
Description
If you have a proxy class in your module and then you subclass that proxy class with another and both are marked as 'creatableInModule', when you create an instance of the derived proxy class in your JavaScript it will actually create an instance of the base class instead of the derived class. This works correctly on V8 but fails on Rhino.
Base Class:
@Kroll.proxy(creatableInModule = HarnessModule.class)
public class LifeCycleProxy extends KrollProxy
{
public LifeCycleProxy()
{
super();
Log.e("BUGBUG", "LifeCycleProxy");
}
}
Derived Class:
@Kroll.proxy(creatableInModule = HarnessModule.class)
public class KrollDemoProxy extends LifeCycleProxy
{
public KrollDemoProxy()
{
super();
Log.e("BUGBUG", "KrollDemoProxy");
}
}
JavaScript code:
Ti.API.info("Creating Kroll Demo");
harness.createKrollDemo();
Ti.API.info("Creating LifeCycle");
harness.createLifeCycle();
This will output the following sequence on Rhino:
Creating Kroll Demo
LifeCycleProxy
Creating LifeCycle
LifeCycleProxy
But the correct output on V8:
Creating Kroll Demo
LifeCycleProxy
KrollDemoProxy
Creating LifeCycle
LifeCycleProxy
Attachments
File | Date | Size |
---|---|---|
harness.zip | 2011-12-21T10:17:54.000+0000 | 23684 |
ti.harness-android-0.1.zip | 2012-01-04T10:47:52.000+0000 | 34417 |
Sample module that demonstrates the issue
Module built with TiSDK 1.8.0.1
Closing bug. Verified fix on: SDK build: 1.9.0.v20120112104633 Runtime: V8, Rhino Titanium Studio, build: 1.0.8.201201111843 Device: Droid 3 (2.3.4) Note to QE: When testing, attached module or module from scratch are valid tests for this bug.