{ "id": "64005", "key": "TIMOB-3373", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2011-08-10T09:45:20.000+0000", "created": "2011-04-15T03:43:25.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android" ], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "issuelinks": [ { "id": "12362", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "78705", "key": "TIMOB-4876", "fields": { "summary": "Android - \"hasOwnProperty\" and JSON.parse incompatible", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T22:20:32.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}
The JSLint parser barfs warnings in Developer if you do a 'for'\r\niteration through an object's properties. It states that you need\r\nto wrap the for loop's logic with an 'if' condition to filter out\r\nproperties from the prototype. JSLint is not happy until you do\r\nso.
\r\nUsing the Object.hasOwnProperty(p) function is necessary to do\r\nso. So, I dutifully implemented it, and the warnings went away.\r\nThen I ran my app on Android. Puke! Android doesn't like that\r\nfunction.
\r\nI hereby nominate DT to fix this, because Don seems to rock the\r\nknown universe.
Please edit the ticket and provide more information.
\n1) Small source sample that demonstrates the problem.
\n2) What version(s) of the TiSDK are you using?
\n3) Have you tried the 1.7 CI build.
I just tested the latest 1.7 build, no luck, same error. You can\nsee it using this plugin https://github.com/appcelerator/TiStorage
JSON.parse('{z: 1}').hasOwnProperty('z');
\nGives:
\nTypeError: Cannot call property hasOwnProperty in object: { 'z':\n1 }. It is not a function. It is \"object\".
\nI don't get an error from:
\n({z: 1}).hasOwnProperty('z');
\nSo I assume this has something to do with JSON parsing.
BTW, so far I've been able to work around this with:
\n\nvar json_parse = function (s) {\n var result = {};\n s = JSON.parse(s);\n for (var name in s) {\n if (! (name in result)) {\n result[name] = s[name];\n }\n }\n return result;\n};
\n