Project import generated by Copybara

PiperOrigin-RevId: 417821950
pull/9333/head
Protobuf Team 3 years ago committed by Copybara-Service
parent b360b9e388
commit 8f6c3c6824
  1. 10
      js/experimental/benchmarks/code_size/apps_jspb/all_types_proto2.js
  2. 10
      js/experimental/benchmarks/code_size/apps_jspb/all_types_proto3.js
  3. 28
      js/experimental/runtime/kernel/kernel_test.js
  4. 4
      js/experimental/runtime/kernel/tag_test.js

@ -119,7 +119,7 @@ function accessAllTypes() {
arrayVal[0] = true;
msgAllTypes.setRepeatedBoolList(arrayVal);
msgAllTypes.setRepeatedBytesList(['']);
arrayVal = msgAllTypes.getRepeatedBytesList();
arrayVal = msgAllTypes.getRepeatedBytesList_asB64();
arrayVal[0] = '';
msgAllTypes.setRepeatedBytesList(arrayVal);
msgPackedTypes.setPackedDoubleList([1.0]);
@ -233,8 +233,7 @@ function accessAllTypes() {
let s = '';
s += msgAllTypes.getOptionalBool() || false;
s += msgAllTypes.getOptionalBytes() || '';
// s += msgAllTypes.getOptionalBytes_asB64() || "";
s += msgAllTypes.getOptionalBytes_asB64() || '';
// s += msgAllTypes.getOptionalBytes_asU8() || new Uint8Array([]);
s += msgAllTypes.getOptionalDouble() || 0.0;
s += msgAllTypes.getOptionalFixed32() || 0;
@ -254,10 +253,9 @@ function accessAllTypes() {
s += msgAllTypes.getRepeatedBoolList();
s += msgAllTypes.getRepeatedBoolList()[0];
s += msgAllTypes.getRepeatedBoolList().length;
s += msgAllTypes.getRepeatedBytesList();
s += msgAllTypes.getRepeatedBytesList()[0];
s += msgAllTypes.getRepeatedBytesList().length;
s += msgAllTypes.getRepeatedBytesList_asB64();
s += msgAllTypes.getRepeatedBytesList_asB64()[0];
s += msgAllTypes.getRepeatedBytesList_asB64().length;
s += msgAllTypes.getRepeatedBytesList_asU8();
s += msgAllTypes.getRepeatedDoubleList();
s += msgAllTypes.getRepeatedDoubleList()[0];

@ -119,7 +119,7 @@ function accessAllTypes() {
arrayVal[0] = true;
msgAllTypes.setRepeatedBoolList(arrayVal);
msgAllTypes.setRepeatedBytesList(['']);
arrayVal = msgAllTypes.getRepeatedBytesList();
arrayVal = msgAllTypes.getRepeatedBytesList_asB64();
arrayVal[0] = '';
msgAllTypes.setRepeatedBytesList(arrayVal);
msgPackedTypes.setPackedDoubleList([1.0]);
@ -233,8 +233,7 @@ function accessAllTypes() {
let s = '';
s += msgAllTypes.getOptionalBool() || false;
s += msgAllTypes.getOptionalBytes() || '';
// s += msgAllTypes.getOptionalBytes_asB64() || "";
s += msgAllTypes.getOptionalBytes_asB64() || '';
// s += msgAllTypes.getOptionalBytes_asU8() || new Uint8Array([]);
s += msgAllTypes.getOptionalDouble() || 0.0;
s += msgAllTypes.getOptionalFixed32() || 0;
@ -254,10 +253,9 @@ function accessAllTypes() {
s += msgAllTypes.getRepeatedBoolList();
s += msgAllTypes.getRepeatedBoolList()[0];
s += msgAllTypes.getRepeatedBoolList().length;
s += msgAllTypes.getRepeatedBytesList();
s += msgAllTypes.getRepeatedBytesList()[0];
s += msgAllTypes.getRepeatedBytesList().length;
s += msgAllTypes.getRepeatedBytesList_asB64();
s += msgAllTypes.getRepeatedBytesList_asB64()[0];
s += msgAllTypes.getRepeatedBytesList_asB64().length;
s += msgAllTypes.getRepeatedBytesList_asU8();
s += msgAllTypes.getRepeatedDoubleList();
s += msgAllTypes.getRepeatedDoubleList()[0];

@ -699,7 +699,7 @@ describe('Bytes access', () => {
expect(accessor.getBytesWithDefault(1)).toEqual(simpleByteString);
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor = Kernel.fromArrayBuffer(
createArrayBuffer(0x0A, 0x01, 0x00, 0x0A, 0x01, 0x01));
expect(accessor.getBytesWithDefault(1)).toEqual(simpleByteString);
@ -801,7 +801,7 @@ describe('Fixed32 access', () => {
expect(accessor.getFixed32WithDefault(1)).toEqual(1);
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor = Kernel.fromArrayBuffer(createArrayBuffer(
0x0D, 0x01, 0x00, 0x80, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00));
expect(accessor.getFixed32WithDefault(1)).toEqual(2);
@ -909,7 +909,7 @@ describe('Fixed64 access', () => {
expect(accessor.getFixed64WithDefault(1)).toEqual(Int64.fromInt(1));
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor = Kernel.fromArrayBuffer(createArrayBuffer(
0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00));
@ -1008,7 +1008,7 @@ describe('Float access', () => {
expect(accessor.getFloatWithDefault(1)).toEqual(1);
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor = Kernel.fromArrayBuffer(createArrayBuffer(
0x0D, 0x00, 0x00, 0x80, 0x3F, 0x0D, 0x00, 0x00, 0x80, 0xBF));
expect(accessor.getFloatWithDefault(1)).toEqual(-1);
@ -1110,7 +1110,7 @@ describe('Int32 access', () => {
expect(accessor.getInt32WithDefault(1)).toEqual(1);
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor =
Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02));
expect(accessor.getInt32WithDefault(1)).toEqual(2);
@ -1207,7 +1207,7 @@ describe('Int64 access', () => {
expect(accessor.getInt64WithDefault(1)).toEqual(Int64.fromInt(1));
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor =
Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02));
expect(accessor.getInt64WithDefault(1)).toEqual(Int64.fromInt(2));
@ -1306,7 +1306,7 @@ describe('Sfixed32 access', () => {
expect(accessor.getSfixed32WithDefault(1)).toEqual(1);
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor = Kernel.fromArrayBuffer(createArrayBuffer(
0x0D, 0x01, 0x00, 0x80, 0x00, 0x0D, 0x02, 0x00, 0x00, 0x00));
expect(accessor.getSfixed32WithDefault(1)).toEqual(2);
@ -1404,7 +1404,7 @@ describe('Sfixed64 access', () => {
expect(accessor.getSfixed64WithDefault(1)).toEqual(Int64.fromInt(1));
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor = Kernel.fromArrayBuffer(createArrayBuffer(
0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00));
@ -1502,7 +1502,7 @@ describe('Sint32 access', () => {
expect(accessor.getSint32WithDefault(1)).toEqual(1);
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor =
Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x03, 0x08, 0x02));
expect(accessor.getSint32WithDefault(1)).toEqual(1);
@ -1599,7 +1599,7 @@ describe('SInt64 access', () => {
expect(accessor.getSint64WithDefault(1)).toEqual(Int64.fromInt(1));
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor =
Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02));
expect(accessor.getSint64WithDefault(1)).toEqual(Int64.fromInt(1));
@ -1698,7 +1698,7 @@ describe('String access', () => {
expect(accessor.getStringWithDefault(1)).toEqual('a');
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor = Kernel.fromArrayBuffer(
createArrayBuffer(0x0A, 0x01, 0x60, 0x0A, 0x01, 0x61));
expect(accessor.getStringWithDefault(1)).toEqual('a');
@ -1789,7 +1789,7 @@ describe('Uint32 access', () => {
expect(accessor.getUint32WithDefault(1)).toEqual(1);
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor =
Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02));
expect(accessor.getUint32WithDefault(1)).toEqual(2);
@ -1896,7 +1896,7 @@ describe('Uint64 access', () => {
expect(accessor.getUint64WithDefault(1)).toEqual(Int64.fromInt(1));
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor =
Kernel.fromArrayBuffer(createArrayBuffer(0x08, 0x01, 0x08, 0x02));
expect(accessor.getUint64WithDefault(1)).toEqual(Int64.fromInt(2));
@ -1996,7 +1996,7 @@ describe('Double access', () => {
});
it('decodes value from wire with multiple values being present', () => {
it('decodes value from wire with multple values being present', () => {
const accessor = Kernel.fromArrayBuffer(createArrayBuffer(
0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x3F, 0x09, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xF0, 0xBF));

@ -95,12 +95,12 @@ describe('skipField', () => {
it('skips group in group', () => {
const buffer = createArrayBuffer(
0x0B, // start outer
0x0B, // start outter
0x10, 0x01, // field: 2, value: 1
0x0B, // start inner group
0x10, 0x01, // payload inner group
0x0C, // stop inner group
0x0C // end outer
0x0C // end outter
);
const bufferDecoder = BufferDecoder.fromArrayBuffer(buffer);
bufferDecoder.setCursor(1);

Loading…
Cancel
Save