Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3312] Android: Correctly handle app:/// URLs in compiled JS

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-26T09:50:50.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.0, Sprint 2011-10
ComponentsAndroid
Labelsandroid, compiler, defect, release-1.6.1, release-1.7.0, reported-1.6.1, rplist, url
ReporterMarshall Culpepper
AssigneeMarshall Culpepper
Created2011-04-15T03:41:54.000+0000
Updated2011-04-26T09:50:50.000+0000

Description

In evaluated mode, an app:// URL with a preceding "/" is resolved to an absolute path, but in compiled mode we replace the leading slash with an underscore and the class isn't found at runtime

Comments

  1. Marshall Culpepper 2011-04-15

    (from [6d9b0f3e05ba71621da82c4ca98f4d5d1b250705]) force utf8 encoding in the js compiler, correctly deal with an absolute prefix on an app:// URL for compiled JS, matching up with the behavior
    in interpreted mode [#3312 state:fixed-in-qa] [#3080 state:fixed-in-qa]
    https://github.com/appcelerator/titanium_mobile/commit/6d9b0f3e05ba71621da82c4ca98f4d5d1b250705"> https://github.com/appcelerator/titanium_mobile/commit/6d9b0f3e05ba...

  2. Marshall Culpepper 2011-04-15

    (from [89c196d407d96d587e0c7883d6670e6523ff52c3]) force utf8 encoding in the js compiler, correctly deal with an absolute prefix on an app:// URL for compiled JS, matching up with the behavior
    in interpreted mode [#3312 state:fixed-in-qa] [#3080 state:fixed-in-qa]
    https://github.com/appcelerator/titanium_mobile/commit/89c196d407d96d587e0c7883d6670e6523ff52c3"> https://github.com/appcelerator/titanium_mobile/commit/89c196d407d9...

  3. Marshall Culpepper 2011-04-15

    Testcase code (2 files)

    app.js:

       
       var win = Ti.UI.createWindow({
           url: Ti.Filesystem.resourcesDirectory + "/test.js"
       });
       
       win.open();
       

    test.js:

       
       var win = Ti.UI.currentWindow;
       win.backgroundColor = 'blue';
       

    tiapp.xml:

       
       <ti:app>
        ...
        <property name="ti.android.compilejs" type="bool">true</property>
       </ti:app>
       

    If the test.js fails to load, you've reproduced this bug (you should see an exception). If it does load, then the bug should be fixed.

  4. Natalie Huynh 2011-04-15

    Tested with Titanium SDK version: 1.6.1 (03/10/11 13:25 2e8c438...) on
    Emulator 2.1
    Samsung Galaxy 2.2

    Tested with Titanium SDK version: 1.7.0 (03/11/11 12:08 86cfe14) on
    Emulator 2.1
    Samsung Galaxy 2.2

  5. Marshall Culpepper 2011-04-15

    (from [727a5e1d7bc90e0c26ee528075f4648fe6fa14e7]) force utf8 encoding in the js compiler, correctly deal with an absolute prefix on an app:// URL for compiled JS, matching up with the behavior
    in interpreted mode [#3312 state:fixed-in-qa] [#3080 state:fixed-in-qa]
    https://github.com/appcelerator/titanium_mobile/commit/727a5e1d7bc90e0c26ee528075f4648fe6fa14e7"> https://github.com/appcelerator/titanium_mobile/commit/727a5e1d7bc9...

JSON Source