@@ -31,6 +31,7 @@ QUnit.test('DataView', assert => {
3131 assert . throws ( ( ) => new DataView ( new ArrayBuffer ( 8 ) , - 1 ) , RangeError , 'If offset < 0, throw a RangeError exception' ) ;
3232 assert . throws ( ( ) => new DataView ( new ArrayBuffer ( 8 ) , 16 ) , RangeError , 'If newByteLength < 0, throw a RangeError exception' ) ;
3333 assert . throws ( ( ) => new DataView ( new ArrayBuffer ( 24 ) , 8 , 24 ) , RangeError , 'If offset+newByteLength > bufferByteLength, throw a RangeError exception' ) ;
34+ assert . throws ( ( ) => new DataView ( new ArrayBuffer ( 8 ) , 0 , - 1 ) , RangeError , 'negative byteLength throws RangeError' ) ;
3435 // Android ~ 4.0
3536 assert . throws ( ( ) => DataView ( 1 ) , TypeError , 'throws without `new`' ) ;
3637 assert . throws ( ( ) => DataView ( 1 ) , 'throws without `new`' ) ;
@@ -39,6 +40,7 @@ QUnit.test('DataView', assert => {
3940 assert . throws ( ( ) => new DataView ( new ArrayBuffer ( 8 ) , - 1 ) , 'If offset < 0, throw a RangeError exception' ) ;
4041 assert . throws ( ( ) => new DataView ( new ArrayBuffer ( 8 ) , 16 ) , 'If newByteLength < 0, throw a RangeError exception' ) ;
4142 assert . throws ( ( ) => new DataView ( new ArrayBuffer ( 24 ) , 8 , 24 ) , 'If offset+newByteLength > bufferByteLength, throw a RangeError exception' ) ;
43+ assert . throws ( ( ) => new DataView ( new ArrayBuffer ( 8 ) , 0 , - 1 ) , 'negative byteLength throws' ) ;
4244 }
4345 dataview = new DataView ( new ArrayBuffer ( 8 ) ) ;
4446 dataview . setUint32 ( 0 , 0x12345678 ) ;
0 commit comments