@@ -305,6 +305,12 @@ const fixtures = {
305305 js : 'new Uint8Array([1,2,3]).buffer' ,
306306 json : '[["ArrayBuffer","AQID"]]'
307307 } ,
308+ {
309+ name : 'DataView' ,
310+ value : new DataView ( new Uint8Array ( [ 1 , 2 , 3 ] ) . buffer ) ,
311+ js : 'new DataView(new Uint8Array([1,2,3]).buffer)' ,
312+ json : '[["DataView",1],["ArrayBuffer","AQID"]]'
313+ } ,
308314 {
309315 name : 'URL' ,
310316 value : new URL ( 'https://user:password@example.com/<script>/path?foo=bar#hash' ) ,
@@ -670,6 +676,28 @@ const fixtures = {
670676 } ) ( ) ,
671677 js : '(function(a,b){a=new Uint8Array(b);return [a,a,new Uint16Array(b)]}({},new Uint8Array([0,1,2,3,4,5,6,7,8,9]).buffer))' ,
672678 json : '[[1,1,3],["Uint8Array",2],["ArrayBuffer","AAECAwQFBgcICQ=="],["Uint16Array",2]]'
679+ } ,
680+
681+ {
682+ name : 'DataView (repetition)' ,
683+ value : ( ( ) => {
684+ const uint8 = new Uint8Array ( [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] ) ;
685+ const dv = new DataView ( uint8 . buffer ) ;
686+ return [ dv , dv ] ;
687+ } ) ( ) ,
688+ js : '(function(a){a=new DataView(new Uint8Array([0,1,2,3,4,5,6,7,8,9]).buffer);return [a,a]}({}))' ,
689+ json : '[[1,1],["DataView",2],["ArrayBuffer","AAECAwQFBgcICQ=="]]'
690+ } ,
691+
692+ {
693+ name : 'Array Buffer and DataView (repetition)' ,
694+ value : ( ( ) => {
695+ const uint8 = new Uint8Array ( [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ] ) ;
696+ const dv = new DataView ( uint8 . buffer ) ;
697+ return [ dv , dv , uint8 . buffer ] ;
698+ } ) ( ) ,
699+ js : '(function(a,b){a=new DataView(b);return [a,a,b]}({},new Uint8Array([0,1,2,3,4,5,6,7,8,9]).buffer))' ,
700+ json : '[[1,1,2],["DataView",2],["ArrayBuffer","AAECAwQFBgcICQ=="]]'
673701 }
674702 ] ,
675703
0 commit comments