Skip to content
This repository has been archived by the owner on Mar 11, 2019. It is now read-only.

IE fails to stringify/parse arrays #154

Open
ar7casper opened this issue Feb 4, 2016 · 3 comments
Open

IE fails to stringify/parse arrays #154

ar7casper opened this issue Feb 4, 2016 · 3 comments

Comments

@ar7casper
Copy link

After using kango.storage.getItem on an array, the array that is returned is CSV.
No map, reduce, etc.

var foo = ['bar1', 'bar2'];
kango.storage.setItem('foo', foo);
var outcome = kango.storage.getItem('foo');
outcome.map(funciton(v){
console.log(v);
});

The code breaks on the map method -

Error in script (unknown): Object doesn't support property or method "map"......

When I print out the type of "outcome", i get [object Object] instead of [object Array].

I reckon that it happens due to compatibility with older versions of IE.
Microsoft announced that they drop support for IE10- - https://www.microsoft.com/en-us/WindowsForBusiness/End-of-IE-support

Any chance for a quick fix on that?

@akrylysov
Copy link
Member

We are looking for a way to fix the issue, meanwhile you can use this workaround:

function arrayLikeObjectToArray(obj) {
    var result = [];
    for (var i = 0; i < obj.length; i++) {
        result.push(obj[i]);
    }
    return result;
}

var outcome = arrayLikeObjectToArray(kango.storage.getItem('foo'));

@ar7casper
Copy link
Author

Hi,

Thank you for your reply.
Do you have an estimate on when it's going to be ready?

Another issue I encountered -
I'm using window.postMessage to communicate different things.
When I'm using window.postMessage from the console, all works, when I click
somewhere in the app where it
invokes the postMessage, I get the following msg - "No such interface
supported".
(On IE).
Do you know this problem? Do you know a way to workaround pass it?

Thank you very much,
Alex.

Alex

On Thu, Feb 4, 2016 at 3:56 PM, Artem Krylysov [email protected]
wrote:

We are looking for a way to fix the issue, meanwhile you can use this
workaround:

function arrayLikeObjectToArray(obj) {
var result = [];
for (var i = 0; i < obj.length; i++) {
result.push(obj[i]);
}
return result;
}
var outcome = arrayLikeObjectToArray(kango.storage.getItem('foo'));


Reply to this email directly or view it on GitHub
#154 (comment)
.

@ar7casper
Copy link
Author

Hi,

Can you help us with updates regarding IE & FF?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants