File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -7563,7 +7563,7 @@ namespace Js
75637563 {
75647564 return res;
75657565 }
7566- if (JavascriptArray::Is (args[0 ]))
7566+ if (JavascriptArray::Is (args[0 ]) && ! JavascriptArray::FromVar (args[ 0 ])-> IsCrossSiteObject () )
75677567 {
75687568#if ENABLE_COPYONACCESS_ARRAY
75697569 JavascriptLibrary::CheckAndConvertCopyOnAccessNativeIntArray<Var>(args[0 ]);
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ e instanceOf TypeError = true
4848a.length = 1
4949ary.length = 18
5050arr.length = 6
51+ Crosssite new length: 2
5152Overridden unshift
5253Overridden unshift
5354Overridden unshift
Original file line number Diff line number Diff line change @@ -140,6 +140,14 @@ function test1(arr)
140140
141141WScript . Echo ( "arr.length = " + test1 ( new Array ( 10 ) ) ) ;
142142
143+ // OS 9357224: Array.prototype.unshift does not marshal parameters correctly
144+ function crossSiteUnshift ( ) {
145+ var sc0 = WScript . LoadScript ( '' , 'samethread' ) ;
146+ sc0 . ary = [ 1 ] ;
147+ return sc0 . eval ( 'Array.prototype.unshift.call(ary, null)' ) ;
148+ }
149+ WScript . Echo ( "Crosssite new length: " + crossSiteUnshift ( ) ) ; // 2
150+
143151//
144152// To check bailouts for inlined unshift
145153//
@@ -164,4 +172,3 @@ function foo()
164172Array . prototype . unshift = function ( ) { WScript . Echo ( "Overridden unshift" ) } ;
165173foo ( ) ;
166174WScript . Echo ( a ) ;
167-
You can’t perform that action at this time.
0 commit comments