[TIMOB-18328] Windows: Changing function parent did not work
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-03-19T22:07:29.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 4.1.0 |
Components | Windows |
Labels | n/a |
Reporter | Kota Iguchi |
Assignee | Kota Iguchi |
Created | 2015-01-06T21:00:44.000+0000 |
Updated | 2015-07-10T00:36:00.000+0000 |
Description
Related to #12 . Opened this so that we can trace this issue.
c++
js_context.JSEvaluateScript("Ti.API.trace('Hello, world');"); // OK
js_context.JSEvaluateScript("var a = {}; a.trace = Ti.API.trace; a.trace('Hello, world');"); // FAIL
For the record: latest HAL doesn't fix this issue yet.
I can confirm this is still an issue with the version of HAL being pointed at from titanium_mobile_windows now.
I think that changing parent "should not" work for functions because in this case the caller (function parent) does not point to correct object. For example: This should work, because "parent" of trace is not changed.
On the other hand this should not work (do nothing, or throw exception?), because function parent (A) does not point to Ti.API anymore. I am thinking that it does nothing but return undefined. Even in this case this should not cause crash.
I found that Node.js handles all of scenarios above. We should handle that similarly.
Unlike static functions like Ti.API and Ti.UI.createXXX functions, functions involving "new" would work differently.
https://github.com/appcelerator/titanium_mobile_windows/pull/177
Verified using: Windows 8.1 Appc CLI (NPM): 4.1.0 Appc CLI (Registry): 4.1.0 Ti SDK: 4.1.0.GA When using changing the function parent such as
the code works as expected Closing ticket