You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[MERGE chakra-core#717] ES6 Spread over zealous optimization for Arrays ignores user changes to %ArrayIteratorPrototype%.next property
Merge pull request chakra-core#717 from tcare:spreadIterator
This is a similar bug that was reported in chakra-core#608 and fixed by @suwc for TypedArray in chakra-core#635.
The core problem is that we do not check for changes to %ArrayIteratorPrototype%.next that could have side effects when optimizing spread item copying. Using a function Suwei added, we attempt to get the value without invoking implicit calls, e.g. a getter. In this case we will fall back to calling the iterator for each element.
I moved out the ArrayIteratorPrototypeHasUserDefinedNext function from TypedArray to JavascriptLibrary since we now use it in JavascriptOperators.
name: "Corner case: Spread of an array with an accessor property (ES5Array) should call that getter and recognize a change in length during iteration",
289
308
body: function(){
@@ -363,7 +382,7 @@ var tests = [
363
382
assert.areEqual(7,result[2],"Spread for the array initializer called the getter of the third element of a and copied the result to the third element of b");
364
383
assert.areEqual(8,result[3],"Spread for the array initializer recognized the new length of four and copied the fourth element of a to the fourth element of b");
0 commit comments