Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18326] Windows: JSValue context issue

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-01-28T19:54:30.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsWindows
Labelsn/a
ReporterIngo Muschenetz
AssigneeMatt Langston
Created2015-01-06T20:58:42.000+0000
Updated2017-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);

Comments

  1. Kota Iguchi 2015-01-20

    This is a issue on HAL and fixed in https://github.com/appcelerator/HAL/pull/21, needs to be integrated in titanium_mobile_windows.
  2. Christopher Williams 2015-01-28

    Sounds like this should be fixed now.
  3. Lee Morris 2017-03-22

    Closing ticket as fixed.

JSON Source