@@ -49,95 +49,95 @@ goog.require('jspb.utils');
4949goog . requireType ( 'jspb.BinaryMessage' ) ;
5050
5151
52- describe ( 'binaryWriterTest' , function ( ) {
52+ describe ( 'binaryWriterTest' , ( ) => {
5353 /**
5454 * Verifies that misuse of the writer class triggers assertions.
5555 */
56- it ( 'testWriteErrors' , function ( ) {
56+ it ( 'testWriteErrors' , ( ) => {
5757 // Submessages with invalid field indices should assert.
5858 let writer = new jspb . BinaryWriter ( ) ;
5959 const dummyMessage = /** @type {!jspb.BinaryMessage } */ ( { } ) ;
6060
61- expect ( function ( ) {
61+ expect ( ( ) => {
6262 writer . writeMessage ( - 1 , dummyMessage , ( ) => { } ) ;
6363 } ) . toThrow ( ) ;
6464
6565 // Writing invalid field indices should assert.
6666 writer = new jspb . BinaryWriter ( ) ;
67- expect ( function ( ) {
67+ expect ( ( ) => {
6868 writer . writeUint64 ( - 1 , 1 ) ;
6969 } ) . toThrow ( ) ;
7070
7171 // Writing out-of-range field values should assert.
7272 writer = new jspb . BinaryWriter ( ) ;
7373
74- expect ( function ( ) {
74+ expect ( ( ) => {
7575 writer . writeInt32 ( 1 , - Infinity ) ;
7676 } ) . toThrow ( ) ;
77- expect ( function ( ) {
77+ expect ( ( ) => {
7878 writer . writeInt32 ( 1 , Infinity ) ;
7979 } ) . toThrow ( ) ;
8080
81- expect ( function ( ) {
81+ expect ( ( ) => {
8282 writer . writeInt64 ( 1 , - Infinity ) ;
8383 } ) . toThrow ( ) ;
84- expect ( function ( ) {
84+ expect ( ( ) => {
8585 writer . writeInt64 ( 1 , Infinity ) ;
8686 } ) . toThrow ( ) ;
8787
88- expect ( function ( ) {
88+ expect ( ( ) => {
8989 writer . writeUint32 ( 1 , - 1 ) ;
9090 } ) . toThrow ( ) ;
91- expect ( function ( ) {
91+ expect ( ( ) => {
9292 writer . writeUint32 ( 1 , Infinity ) ;
9393 } ) . toThrow ( ) ;
9494
95- expect ( function ( ) {
95+ expect ( ( ) => {
9696 writer . writeUint64 ( 1 , - 1 ) ;
9797 } ) . toThrow ( ) ;
98- expect ( function ( ) {
98+ expect ( ( ) => {
9999 writer . writeUint64 ( 1 , Infinity ) ;
100100 } ) . toThrow ( ) ;
101101
102- expect ( function ( ) {
102+ expect ( ( ) => {
103103 writer . writeSint32 ( 1 , - Infinity ) ;
104104 } ) . toThrow ( ) ;
105- expect ( function ( ) {
105+ expect ( ( ) => {
106106 writer . writeSint32 ( 1 , Infinity ) ;
107107 } ) . toThrow ( ) ;
108108
109- expect ( function ( ) {
109+ expect ( ( ) => {
110110 writer . writeSint64 ( 1 , - Infinity ) ;
111111 } ) . toThrow ( ) ;
112- expect ( function ( ) {
112+ expect ( ( ) => {
113113 writer . writeSint64 ( 1 , Infinity ) ;
114114 } ) . toThrow ( ) ;
115115
116- expect ( function ( ) {
116+ expect ( ( ) => {
117117 writer . writeFixed32 ( 1 , - 1 ) ;
118118 } ) . toThrow ( ) ;
119- expect ( function ( ) {
119+ expect ( ( ) => {
120120 writer . writeFixed32 ( 1 , Infinity ) ;
121121 } ) . toThrow ( ) ;
122122
123- expect ( function ( ) {
123+ expect ( ( ) => {
124124 writer . writeFixed64 ( 1 , - 1 ) ;
125125 } ) . toThrow ( ) ;
126- expect ( function ( ) {
126+ expect ( ( ) => {
127127 writer . writeFixed64 ( 1 , Infinity ) ;
128128 } ) . toThrow ( ) ;
129129
130- expect ( function ( ) {
130+ expect ( ( ) => {
131131 writer . writeSfixed32 ( 1 , - Infinity ) ;
132132 } ) . toThrow ( ) ;
133- expect ( function ( ) {
133+ expect ( ( ) => {
134134 writer . writeSfixed32 ( 1 , Infinity ) ;
135135 } ) . toThrow ( ) ;
136136
137- expect ( function ( ) {
137+ expect ( ( ) => {
138138 writer . writeSfixed64 ( 1 , - Infinity ) ;
139139 } ) . toThrow ( ) ;
140- expect ( function ( ) {
140+ expect ( ( ) => {
141141 writer . writeSfixed64 ( 1 , Infinity ) ;
142142 } ) . toThrow ( ) ;
143143 } ) ;
@@ -146,7 +146,7 @@ describe('binaryWriterTest', function() {
146146 /**
147147 * Basic test of retrieving the result as a Uint8Array buffer
148148 */
149- it ( 'testGetResultBuffer' , function ( ) {
149+ it ( 'testGetResultBuffer' , ( ) => {
150150 const expected = '0864120b48656c6c6f20776f726c641a0301020320c801' ;
151151
152152 const writer = new jspb . BinaryWriter ( ) ;
@@ -163,7 +163,7 @@ describe('binaryWriterTest', function() {
163163 /**
164164 * Tests websafe encodings for base64 strings.
165165 */
166- it ( 'testWebSafeOption' , function ( ) {
166+ it ( 'testWebSafeOption' , ( ) => {
167167 const writer = new jspb . BinaryWriter ( ) ;
168168 writer . writeBytes ( 1 , new Uint8Array ( [ 127 ] ) ) ;
169169 expect ( 'CgF/' ) . toEqual ( writer . getResultBase64String ( ) ) ;
@@ -173,7 +173,7 @@ describe('binaryWriterTest', function() {
173173 goog . crypt . base64 . Alphabet . WEBSAFE_NO_PADDING ) ) ;
174174 } ) ;
175175
176- it ( 'writes split 64 fields' , function ( ) {
176+ it ( 'writes split 64 fields' , ( ) => {
177177 const writer = new jspb . BinaryWriter ( ) ;
178178 writer . writeSplitVarint64 ( 1 , 0x1 , 0x2 ) ;
179179 writer . writeSplitVarint64 ( 1 , 0xFFFFFFFF , 0xFFFFFFFF ) ;
@@ -243,7 +243,7 @@ describe('binaryWriterTest', function() {
243243 ] ) ;
244244 } ) ;
245245
246- it ( 'writes zigzag 64 fields' , function ( ) {
246+ it ( 'writes zigzag 64 fields' , ( ) => {
247247 // Test cases directly from the protobuf dev guide.
248248 // https://engdoc.corp.google.com/eng/howto/protocolbuffers/developerguide/encoding.shtml?cl=head#types
249249 const testCases = [
@@ -355,7 +355,7 @@ describe('binaryWriterTest', function() {
355355 } ) ) ;
356356 } ) ;
357357
358- it ( 'writes float32 fields' , function ( ) {
358+ it ( 'writes float32 fields' , ( ) => {
359359 const testCases = [
360360 0 , 1 , - 1 , jspb . BinaryConstants . FLOAT32_MIN ,
361361 - jspb . BinaryConstants . FLOAT32_MIN , jspb . BinaryConstants . FLOAT32_MAX ,
@@ -378,7 +378,7 @@ describe('binaryWriterTest', function() {
378378 } ) ;
379379 } ) ;
380380
381- it ( 'writes double fields' , function ( ) {
381+ it ( 'writes double fields' , ( ) => {
382382 const testCases = [
383383 0 , 1 , - 1 , Number . MAX_SAFE_INTEGER , Number . MIN_SAFE_INTEGER ,
384384 Number . MAX_VALUE , Number . MIN_VALUE , jspb . BinaryConstants . FLOAT32_MIN ,
0 commit comments