Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25012] Windows: Crash in mocha suite when checking instanceof against a blob

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2017-09-01T05:01:07.000+0000
Affected Version/sRelease 7.0.0
Fix Version/sn/a
ComponentsWindows
Labelsfailure-reviewed
ReporterEwan Harris
AssigneeKota Iguchi
Created2017-07-24T10:43:12.000+0000
Updated2018-08-02T22:20:05.000+0000

Description

Description

When running the mocha suite, the ti.blob - constructed from image test crashes the application, it crashes on the should(blob).be.an.instanceof(Ti.Blob); check You can use https://github.com/ewanharris/mocha-test to test this, just paste the code from the test suite it and it _should_ work Interestingly, this is what the .instanceof assertion boils down to Object(this.obj) instanceof constructor so I think this crash might happen in the should.js lib somewhere

Steps to reproduce

Grab the code from the link in environment

Add to the test app provided at the git repo above

Build for any Windows target

Actual

App crashes

Expected

App should not crash

Comments

  1. Kota Iguchi 2017-09-01

    So even when I create Ti.Blob instance from new Ti.Blob(), blob instanceof Ti.Blob fails. I think it's something to do in HAL implementation.
       var blob = new Ti.Blob();
       alert(blob instanceof Ti.Blob);
       
    Interestingly this code does not work with iOS too. As we think iOS as reference platform, I would think we can skip this test for now.
       var win = Ti.UI.createWindow({ backgroundColor: 'green' });
       var blob = Ti.Filesystem.getFile('app.js').read();
       win.addEventListener('open', function () {
           alert((blob instanceof Ti.Blob));
       });
       
       win.open();
       
  2. Eric Merriman 2018-08-02

    Closing old "Won't fix" tickets. If you disagree, please reopen.

JSON Source