Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19183] Window: JSON.stringify throws “invalid document source” exception when you dump Titanium proxy

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-07-23T15:43:33.000+0000
Affected Version/sRelease 4.1.0
Fix Version/sRelease 5.0.0
ComponentsWindows
Labelsqe-4.1.0
ReporterLokesh Choudhary
AssigneeKota Iguchi
Created2015-07-07T00:40:35.000+0000
Updated2015-08-25T00:09:07.000+0000

Description

Steps to reproduce:

1. Create an app for windows & replace the app.js with the code below:
 var c = Ti.Network.createHTTPClient();
Ti.API.info('HTTP : ' + JSON.stringify(c));
c.onload = function () {
    Ti.API.info('Data: + ' + this.responseText);
};
c.open('GET', "http://www.appcelerator.com/");
c.onerror = function (e) {
    Ti.API.info('Error: ' + JSON.stringify(e));
};
Ti.API.info('URL: ' + url);
c.send();
Ti.API.info('HTTP : ' + JSON.stringify(c));
2. Build for windows emulator.

Actual Results:

1. We get exception:
[ERROR] :  Application Error: {
[ERROR] :    "message": "Error while require(./app) invalid document source",
[ERROR] :    "native_stack": [
[ERROR] :      "JSExportClass<class Titanium::GlobalObject>::CallNamedFunction"
[ERROR] :    ],
[ERROR] :    "stack": "require@[native code]\nglobal code",
[ERROR] :    "line": 2
[ERROR] :  }
2. Attached is the screenshot of the on device exception error.

Expected Resut:

1. We should not get any exceptions using JSON.stringify

Attachments

FileDateSize
Capture.PNG2015-07-07T00:40:47.000+000041675

Comments

  1. Lokesh Choudhary 2015-07-07

    This issue will be fixed when TIMOB-19181 is resolved.
  2. Christopher Williams 2015-07-07

    For comparison's sake, here's what we get for iOS:
       [INFO]  HTTP : {}
       [INFO]  HTTP : {"url":"http://www.appcelerator.com/","method":"GET"}
       
    The first is after creating an httpclient, the second is after the open and send function calls.
  3. Kota Iguchi 2015-07-22

    https://github.com/appcelerator/titanium_mobile_windows/pull/387
  4. Lokesh Choudhary 2015-08-25

    Verified the fix. Closing. Environment: Appc Studio: 5.0.0.v20150819140421 Ti SDK: 5.0.0.v20150820100424 Ti CLI: 4.1.4 Alloy: 1.6.2 Windows: 8.1 Enterprise 64-bit APPC NPM: 4.2.0-1 APPC CLI: 5.0.0-8 Node : v0.10.37 Device: Nokia Lumia 928 - Windows Phone 8.1 Windows emulator : 8.1

JSON Source