@@ -84,10 +84,10 @@ function doTestUnsignedValue(
8484 }
8585
8686 // Encoding values outside the valid range should assert.
87- expect ( function ( ) {
87+ expect ( ( ) => {
8888 writeValue . call ( encoder , - 1 ) ;
8989 } ) . toThrow ( ) ;
90- expect ( function ( ) {
90+ expect ( ( ) => {
9191 writeValue . call ( encoder , upperLimit * 1.1 ) ;
9292 } ) . toThrow ( ) ;
9393}
@@ -155,11 +155,11 @@ function doTestSignedValue(
155155 }
156156}
157157
158- describe ( 'binaryDecoderTest' , function ( ) {
158+ describe ( 'binaryDecoderTest' , ( ) => {
159159 /**
160160 * Tests the decoder instance cache.
161161 */
162- it ( 'testInstanceCache' , /** @suppress {visibility} */ function ( ) {
162+ it ( 'testInstanceCache' , /** @suppress {visibility} */ ( ) => {
163163 // Empty the instance caches.
164164 jspb . BinaryDecoder . instanceCache_ = [ ] ;
165165
@@ -183,7 +183,7 @@ describe('binaryDecoderTest', function() {
183183 } ) ;
184184
185185
186- describe ( 'varint64' , function ( ) {
186+ describe ( 'varint64' , ( ) => {
187187 let /** !jspb.BinaryEncoder */ encoder ;
188188 let /** !jspb.BinaryDecoder */ decoder ;
189189
@@ -195,7 +195,7 @@ describe('binaryDecoderTest', function() {
195195 String . fromCharCode ( 0x12 , 0x34 , 0x56 , 0x78 , 0x87 , 0x65 , 0x43 , 0x21 ) ;
196196 const hashD =
197197 String . fromCharCode ( 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ) ;
198- beforeEach ( function ( ) {
198+ beforeEach ( ( ) => {
199199 encoder = new jspb . BinaryEncoder ( ) ;
200200
201201 encoder . writeVarintHash64 ( hashA ) ;
@@ -211,7 +211,7 @@ describe('binaryDecoderTest', function() {
211211 decoder = jspb . BinaryDecoder . alloc ( encoder . end ( ) ) ;
212212 } ) ;
213213
214- it ( 'reads 64-bit integers as hash strings' , function ( ) {
214+ it ( 'reads 64-bit integers as hash strings' , ( ) => {
215215 expect ( hashA ) . toEqual ( decoder . readVarintHash64 ( ) ) ;
216216 expect ( hashB ) . toEqual ( decoder . readVarintHash64 ( ) ) ;
217217 expect ( hashC ) . toEqual ( decoder . readVarintHash64 ( ) ) ;
@@ -223,7 +223,7 @@ describe('binaryDecoderTest', function() {
223223 expect ( hashD ) . toEqual ( decoder . readFixedHash64 ( ) ) ;
224224 } ) ;
225225
226- it ( 'reads split 64 bit integers' , function ( ) {
226+ it ( 'reads split 64 bit integers' , ( ) => {
227227 function hexJoin ( bitsLow , bitsHigh ) {
228228 return `0x${ ( bitsHigh >>> 0 ) . toString ( 16 ) } :0x${
229229 ( bitsLow >>> 0 ) . toString ( 16 ) } `;
@@ -245,7 +245,7 @@ describe('binaryDecoderTest', function() {
245245 } ) ;
246246 } ) ;
247247
248- describe ( 'sint64' , function ( ) {
248+ describe ( 'sint64' , ( ) => {
249249 let /** !jspb.BinaryDecoder */ decoder ;
250250
251251 const hashA =
@@ -256,7 +256,7 @@ describe('binaryDecoderTest', function() {
256256 String . fromCharCode ( 0x12 , 0x34 , 0x56 , 0x78 , 0x87 , 0x65 , 0x43 , 0x21 ) ;
257257 const hashD =
258258 String . fromCharCode ( 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ) ;
259- beforeEach ( function ( ) {
259+ beforeEach ( ( ) => {
260260 const encoder = new jspb . BinaryEncoder ( ) ;
261261
262262 encoder . writeZigzagVarintHash64 ( hashA ) ;
@@ -267,7 +267,7 @@ describe('binaryDecoderTest', function() {
267267 decoder = jspb . BinaryDecoder . alloc ( encoder . end ( ) ) ;
268268 } ) ;
269269
270- it ( 'reads 64-bit integers as decimal strings' , function ( ) {
270+ it ( 'reads 64-bit integers as decimal strings' , ( ) => {
271271 const signed = true ;
272272 expect ( decoder . readZigzagVarint64String ( ) )
273273 . toEqual ( jspb . utils . hash64ToDecimalString ( hashA , signed ) ) ;
@@ -279,14 +279,14 @@ describe('binaryDecoderTest', function() {
279279 . toEqual ( jspb . utils . hash64ToDecimalString ( hashD , signed ) ) ;
280280 } ) ;
281281
282- it ( 'reads 64-bit integers as hash strings' , function ( ) {
282+ it ( 'reads 64-bit integers as hash strings' , ( ) => {
283283 expect ( decoder . readZigzagVarintHash64 ( ) ) . toEqual ( hashA ) ;
284284 expect ( decoder . readZigzagVarintHash64 ( ) ) . toEqual ( hashB ) ;
285285 expect ( decoder . readZigzagVarintHash64 ( ) ) . toEqual ( hashC ) ;
286286 expect ( decoder . readZigzagVarintHash64 ( ) ) . toEqual ( hashD ) ;
287287 } ) ;
288288
289- it ( 'reads split 64 bit zigzag integers' , function ( ) {
289+ it ( 'reads split 64 bit zigzag integers' , ( ) => {
290290 function hexJoin ( bitsLow , bitsHigh ) {
291291 return `0x${ ( bitsHigh >>> 0 ) . toString ( 16 ) } :0x${
292292 ( bitsLow >>> 0 ) . toString ( 16 ) } `;
@@ -306,7 +306,7 @@ describe('binaryDecoderTest', function() {
306306 . toEqual ( hexJoinHash ( hashD ) ) ;
307307 } ) ;
308308
309- it ( 'does zigzag encoding properly' , function ( ) {
309+ it ( 'does zigzag encoding properly' , ( ) => {
310310 // Test cases directly from the protobuf dev guide.
311311 // https://engdoc.corp.google.com/eng/howto/protocolbuffers/developerguide/encoding.shtml?cl=head#types
312312 const testCases = [
@@ -340,7 +340,7 @@ describe('binaryDecoderTest', function() {
340340 /**
341341 * Tests reading and writing large strings
342342 */
343- it ( 'testLargeStrings' , function ( ) {
343+ it ( 'testLargeStrings' , ( ) => {
344344 const encoder = new jspb . BinaryEncoder ( ) ;
345345
346346 const len = 150000 ;
@@ -359,7 +359,7 @@ describe('binaryDecoderTest', function() {
359359 /**
360360 * Test encoding and decoding utf-8.
361361 */
362- it ( 'testUtf8' , function ( ) {
362+ it ( 'testUtf8' , ( ) => {
363363 const encoder = new jspb . BinaryEncoder ( ) ;
364364
365365 const ascii = 'ASCII should work in 3, 2, 1...' ;
@@ -384,43 +384,43 @@ describe('binaryDecoderTest', function() {
384384 /**
385385 * Verifies that passing a non-string to writeString raises an error.
386386 */
387- it ( 'testBadString' , function ( ) {
387+ it ( 'testBadString' , ( ) => {
388388 const encoder = new jspb . BinaryEncoder ( ) ;
389389
390- expect ( function ( ) {
390+ expect ( ( ) => {
391391 encoder . writeString ( 42 )
392392 } ) . toThrow ( ) ;
393- expect ( function ( ) {
393+ expect ( ( ) => {
394394 encoder . writeString ( null )
395395 } ) . toThrow ( ) ;
396396 } ) ;
397397
398398 /**
399399 * Verifies that misuse of the decoder class triggers assertions.
400400 */
401- it ( 'testDecodeErrors' , function ( ) {
401+ it ( 'testDecodeErrors' , ( ) => {
402402 // Reading a value past the end of the stream should trigger an assertion.
403403 const decoder = jspb . BinaryDecoder . alloc ( [ 0 , 1 , 2 ] ) ;
404- expect ( function ( ) {
404+ expect ( ( ) => {
405405 decoder . readUint64 ( )
406406 } ) . toThrow ( ) ;
407407
408408 // Overlong varints should trigger assertions.
409409 decoder . setBlock (
410410 [ 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 255 , 0 ] ) ;
411- expect ( function ( ) {
411+ expect ( ( ) => {
412412 decoder . readUnsignedVarint64 ( )
413413 } ) . toThrow ( ) ;
414414 decoder . reset ( ) ;
415- expect ( function ( ) {
415+ expect ( ( ) => {
416416 decoder . readSignedVarint64 ( )
417417 } ) . toThrow ( ) ;
418418 decoder . reset ( ) ;
419- expect ( function ( ) {
419+ expect ( ( ) => {
420420 decoder . readZigzagVarint64 ( )
421421 } ) . toThrow ( ) ;
422422 decoder . reset ( ) ;
423- expect ( function ( ) {
423+ expect ( ( ) => {
424424 decoder . readUnsignedVarint32 ( )
425425 } ) . toThrow ( ) ;
426426 } ) ;
@@ -429,7 +429,7 @@ describe('binaryDecoderTest', function() {
429429 /**
430430 * Tests encoding and decoding of unsigned integers.
431431 */
432- it ( 'testUnsignedIntegers' , function ( ) {
432+ it ( 'testUnsignedIntegers' , ( ) => {
433433 doTestUnsignedValue (
434434 jspb . BinaryDecoder . prototype . readUint8 ,
435435 jspb . BinaryEncoder . prototype . writeUint8 , 1 , 0xFF , Math . round ) ;
@@ -462,7 +462,7 @@ describe('binaryDecoderTest', function() {
462462 /**
463463 * Tests encoding and decoding of signed integers.
464464 */
465- it ( 'testSignedIntegers' , function ( ) {
465+ it ( 'testSignedIntegers' , ( ) => {
466466 doTestSignedValue (
467467 jspb . BinaryDecoder . prototype . readInt8 ,
468468 jspb . BinaryEncoder . prototype . writeInt8 , 1 , - 0x80 , 0x7F , Math . round ) ;
@@ -497,7 +497,7 @@ describe('binaryDecoderTest', function() {
497497 /**
498498 * Tests encoding and decoding of floats.
499499 */
500- it ( 'testFloats' , function ( ) {
500+ it ( 'testFloats' , ( ) => {
501501 /**
502502 * @param {number } x
503503 * @return {number }
0 commit comments