[TIMOB-18326] Windows: JSValue context issue
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-01-28T19:54:30.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Windows |
Labels | n/a |
Reporter | Ingo Muschenetz |
Assignee | Matt Langston |
Created | 2015-01-06T20:58:42.000+0000 |
Updated | 2017-03-22T22:48:05.000+0000 |
Description
Parroting bug discovered by @garymathews in #23:
> There's a bug with JSValue that prevents it's value being set from another context due to the 'new' context overwriting the one the JSValue was created with. Shouldn't we be retaining the context and just setting the value?
*Example*
Javascript
var window = Ti.UI.createWindow();
var button = Ti.UI.createButton({
top: 20,
bottom: 20,
width: 200,
height: Ti.UI.SIZE
})
// Set the title
// This doesn't crash because the text 'BUTTON' belongs to the same
// context 'button' was created in
button.title = 'BUTTON';
button.addEventListener('click',
function (e) {
// This will cause a crash due to the context of 'CRASH!'
// overwriting the context 'title' was created with
// shouldn't we be retaining the original context?
button.title = 'CRASH!';
}
);
window.add(button);
This is a issue on HAL and fixed in https://github.com/appcelerator/HAL/pull/21, needs to be integrated in titanium_mobile_windows.
Sounds like this should be fixed now.
Closing ticket as fixed.