Skip to content

List.insert makes the inserted object into an array in IE 11 #1711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dbwcooper opened this issue May 21, 2019 · 1 comment · Fixed by #1850
Closed

List.insert makes the inserted object into an array in IE 11 #1711

dbwcooper opened this issue May 21, 2019 · 1 comment · Fixed by #1850
Labels
Milestone

Comments

@dbwcooper
Copy link

What happened

List.insert makes the inserted object into an array in IE 11

IE version : 11.648.17134.0

I use IE 11 to open https://immutable-js.github.io/immutable-js/docs/#/List to test in the console.

How to reproduce

  1. Defined an object list
  2. Insert an object at the beginning of the list
  3. The first object becomes an array

e.g.

var a= Immutable.fromJS({ a: 0 })
var b = Immutable.fromJS({ b: 0 })
var c = Immutable.fromJS({ c: 0 });
var list = Immutable.fromJS([b, c])

var newlist = list.insert(0, a); 
// expect [Object, Object, Object]
// actual:  [Array, Object, Object]

pic
image

@jdeniau
Copy link
Member

jdeniau commented Jul 13, 2021

I reduced the issue to the following :

List().concat(['foo']));
// output : 
// non-ie : ["coucou"] 
// ie : [["coucou"]]

If we concat like this, it does work

List().concat(List(['foo'])));

In this issue, it is called here :

: spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum))

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

Successfully merging a pull request may close this issue.

3 participants