TBR jscore: Add int8
MultiPart: 4/4
Change-Id: If14cf34801d151387abbc1c4bd6641ec594294d7
diff --git a/src/gen-vdl/v.io/v23/vom/index.js b/src/gen-vdl/v.io/v23/vom/index.js
index 3fe93e6..06c01a2 100644
--- a/src/gen-vdl/v.io/v23/vom/index.js
+++ b/src/gen-vdl/v.io/v23/vom/index.js
@@ -178,6 +178,8 @@
module.exports.WireIdAny = canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_typetypeId))(new vdl.BigInt(1, new Uint8Array([0xf])), true), _typetypeId);
+ module.exports.WireIdInt8 = canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_typetypeId))(new vdl.BigInt(1, new Uint8Array([0x10])), true), _typetypeId);
+
module.exports.WireIdByteList = canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_typetypeId))(new vdl.BigInt(1, new Uint8Array([0x27])), true), _typetypeId);
module.exports.WireIdStringList = canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_typetypeId))(new vdl.BigInt(1, new Uint8Array([0x28])), true), _typetypeId);
diff --git a/src/gen-vdl/v.io/v23/vom/testdata/data80/index.js b/src/gen-vdl/v.io/v23/vom/testdata/data80/index.js
index 3009b03..67280ff 100644
--- a/src/gen-vdl/v.io/v23/vom/testdata/data80/index.js
+++ b/src/gen-vdl/v.io/v23/vom/testdata/data80/index.js
@@ -144,17 +144,17 @@
'hexValue': "4e00",
},
{
- 'name': "[]byte(\"\\x01\\x02\\x03\")",
+ 'name': "[]byte(\"\\xff\\x00\\x01\")",
'value': canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_type2))(new Uint8Array([
+255,
+0,
1,
-2,
-3,
]), true), _type2),
'typeString': "[]byte",
- 'hex': "804e03010203",
+ 'hex': "804e03ff0001",
'hexVersion': "80",
'hexType': "",
- 'hexValue': "4e03010203",
+ 'hexValue': "4e03ff0001",
},
{
'name': "[]byte(\"adef\")",
@@ -1306,17 +1306,17 @@
'hexValue': "5200",
},
{
- 'name': "types.NByteSlice(\"\\x01\\x02\\x03\")",
+ 'name': "types.NByteSlice(\"\\xff\\x00\\x01\")",
'value': canonicalize.reduce(new types.NByteSlice(new Uint8Array([
+255,
+0,
1,
-2,
-3,
]), true), new types.NByteSlice()._type),
'typeString': "v.io/v23/vom/testdata/types.NByteSlice []byte",
- 'hex': "80512c030026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e42797465536c6963650102e15203010203",
+ 'hex': "80512c030026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e42797465536c6963650102e15203ff0001",
'hexVersion': "80",
'hexType': "512c030026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e42797465536c6963650102e1",
- 'hexValue': "5203010203",
+ 'hexValue': "5203ff0001",
},
{
'name': "types.NByteSlice(\"abc\")",
@@ -1346,18 +1346,18 @@
'hexValue': "520000000000",
},
{
- 'name': "types.NByteArray(\"\\x01\\x02\\x03\\x00\")",
+ 'name': "types.NByteArray(\"\\xff\\x00\\x01\\x00\")",
'value': canonicalize.reduce(new types.NByteArray(new Uint8Array([
+255,
+0,
1,
-2,
-3,
0,
]), true), new types.NByteArray()._type),
'typeString': "v.io/v23/vom/testdata/types.NByteArray [4]byte",
- 'hex': "80512e020026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e42797465417272617901020204e1520001020300",
+ 'hex': "80512e020026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e42797465417272617901020204e15200ff000100",
'hexVersion': "80",
'hexType': "512e020026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e42797465417272617901020204e1",
- 'hexValue': "520001020300",
+ 'hexValue': "5200ff000100",
},
{
'name': "types.NByteArray(\"abcd\")",
@@ -3793,7 +3793,7 @@
],
},
]],
- ["string, []byte, [n]byte, and enum", [
+ ["string and enum", [
{
'name': "enum (A)",
'primaryType': types.NEnum.A._type,
@@ -3801,9 +3801,6 @@
canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.STRING))("A", true), vdl.types.STRING),
canonicalize.reduce(new types.NString("A", true), new types.NString()._type),
types.NEnum.A,
-canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_type2))(new Uint8Array([
-65,
-]), true), _type2),
],
},
{
@@ -3814,40 +3811,6 @@
canonicalize.reduce(new types.NString("Brie", true), new types.NString()._type),
types.BrieEnum.BRIE,
types.FoodEnum.BRIE,
-canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_type2))(new Uint8Array([
-66,
-114,
-105,
-101,
-]), true), _type2),
-canonicalize.reduce(new types.NByteArray(new Uint8Array([
-66,
-114,
-105,
-101,
-]), true), new types.NByteArray()._type),
-],
-},
-{
- 'name': "[4]byte",
- 'primaryType': new types.NByteArray()._type,
- 'values': [
-canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.STRING))("Bean", true), vdl.types.STRING),
-canonicalize.reduce(new types.NString("Bean", true), new types.NString()._type),
-types.BeanEnum.BEAN,
-types.FoodEnum.BEAN,
-canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_type2))(new Uint8Array([
-66,
-101,
-97,
-110,
-]), true), _type2),
-canonicalize.reduce(new types.NByteArray(new Uint8Array([
-66,
-101,
-97,
-110,
-]), true), new types.NByteArray()._type),
],
},
{
@@ -3857,22 +3820,6 @@
canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.STRING))("Cherry", true), vdl.types.STRING),
canonicalize.reduce(new types.NString("Cherry", true), new types.NString()._type),
types.FoodEnum.CHERRY,
-canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_type2))(new Uint8Array([
-67,
-104,
-101,
-114,
-114,
-121,
-]), true), _type2),
-canonicalize.reduce(new types.NByteSlice(new Uint8Array([
-67,
-104,
-101,
-114,
-114,
-121,
-]), true), new types.NByteSlice()._type),
],
},
]],
diff --git a/src/gen-vdl/v.io/v23/vom/testdata/data81/index.js b/src/gen-vdl/v.io/v23/vom/testdata/data81/index.js
index 8321061..be3a6f9 100644
--- a/src/gen-vdl/v.io/v23/vom/testdata/data81/index.js
+++ b/src/gen-vdl/v.io/v23/vom/testdata/data81/index.js
@@ -144,17 +144,17 @@
'hexValue': "4e00",
},
{
- 'name': "[]byte(\"\\x01\\x02\\x03\")",
+ 'name': "[]byte(\"\\xff\\x00\\x01\")",
'value': canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_type2))(new Uint8Array([
+255,
+0,
1,
-2,
-3,
]), true), _type2),
'typeString': "[]byte",
- 'hex': "814e03010203",
+ 'hex': "814e03ff0001",
'hexVersion': "81",
'hexType': "",
- 'hexValue': "4e03010203",
+ 'hexValue': "4e03ff0001",
},
{
'name': "[]byte(\"adef\")",
@@ -192,10 +192,10 @@
'name': "byte(255)",
'value': canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.BYTE))(255, true), vdl.types.BYTE),
'typeString': "byte",
- 'hex': "8104ff",
+ 'hex': "8104ffff",
'hexVersion': "81",
'hexType': "",
- 'hexValue': "04ff",
+ 'hexValue': "04ffff",
},
{
'name': "uint16(0)",
@@ -1306,17 +1306,17 @@
'hexValue': "5200",
},
{
- 'name': "types.NByteSlice(\"\\x01\\x02\\x03\")",
+ 'name': "types.NByteSlice(\"\\xff\\x00\\x01\")",
'value': canonicalize.reduce(new types.NByteSlice(new Uint8Array([
+255,
+0,
1,
-2,
-3,
]), true), new types.NByteSlice()._type),
'typeString': "v.io/v23/vom/testdata/types.NByteSlice []byte",
- 'hex': "81512c030026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e42797465536c6963650102e15203010203",
+ 'hex': "81512c030026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e42797465536c6963650102e15203ff0001",
'hexVersion': "81",
'hexType': "512c030026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e42797465536c6963650102e1",
- 'hexValue': "5203010203",
+ 'hexValue': "5203ff0001",
},
{
'name': "types.NByteSlice(\"abc\")",
@@ -1346,18 +1346,18 @@
'hexValue': "520000000000",
},
{
- 'name': "types.NByteArray(\"\\x01\\x02\\x03\\x00\")",
+ 'name': "types.NByteArray(\"\\xff\\x00\\x01\\x00\")",
'value': canonicalize.reduce(new types.NByteArray(new Uint8Array([
+255,
+0,
1,
-2,
-3,
0,
]), true), new types.NByteArray()._type),
'typeString': "v.io/v23/vom/testdata/types.NByteArray [4]byte",
- 'hex': "81512e020026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e42797465417272617901020204e1520001020300",
+ 'hex': "81512e020026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e42797465417272617901020204e15200ff000100",
'hexVersion': "81",
'hexType': "512e020026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e42797465417272617901020204e1",
- 'hexValue': "520001020300",
+ 'hexValue': "5200ff000100",
},
{
'name': "types.NByteArray(\"abcd\")",
@@ -1395,10 +1395,10 @@
'name': "types.NByte(255)",
'value': canonicalize.reduce(new types.NByte(255, true), new types.NByte()._type),
'typeString': "v.io/v23/vom/testdata/types.NByte byte",
- 'hex': "815127000021762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e427974650102e152ff",
+ 'hex': "815127000021762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e427974650102e152ffff",
'hexVersion': "81",
'hexType': "5127000021762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e427974650102e1",
- 'hexValue': "52ff",
+ 'hexValue': "52ffff",
},
{
'name': "types.NUint16(0)",
@@ -3595,6 +3595,112 @@
'hexType': "5333060025762e696f2f7632332f766f6d2f74657374646174612f74797065732e537472756374416e7901010003416e79010fe1e1510403012ae15528000022762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e496e7431360107e15728000022762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e496e7433320108e15928000022762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e496e7436340109e1",
'hexValue': "52032b2c2d1104000002e1000104e1000206e1000108e1",
},
+{
+ 'name': "int8(0)",
+ 'value': canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.INT8))(0, true), vdl.types.INT8),
+ 'typeString': "int8",
+ 'hex': "812000",
+ 'hexVersion': "81",
+ 'hexType': "",
+ 'hexValue': "2000",
+},
+{
+ 'name': "int8(-128)",
+ 'value': canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.INT8))(-128, true), vdl.types.INT8),
+ 'typeString': "int8",
+ 'hex': "8120ffff",
+ 'hexVersion': "81",
+ 'hexType': "",
+ 'hexValue': "20ffff",
+},
+{
+ 'name': "int8(127)",
+ 'value': canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.INT8))(127, true), vdl.types.INT8),
+ 'typeString': "int8",
+ 'hex': "8120fffe",
+ 'hexVersion': "81",
+ 'hexType': "",
+ 'hexValue': "20fffe",
+},
+{
+ 'name': "types.NInt8(0)",
+ 'value': canonicalize.reduce(new types.NInt8(0, true), new types.NInt8()._type),
+ 'typeString': "v.io/v23/vom/testdata/types.NInt8 int8",
+ 'hex': "815127000021762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e496e74380110e15200",
+ 'hexVersion': "81",
+ 'hexType': "5127000021762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e496e74380110e1",
+ 'hexValue': "5200",
+},
+{
+ 'name': "types.NInt8(-128)",
+ 'value': canonicalize.reduce(new types.NInt8(-128, true), new types.NInt8()._type),
+ 'typeString': "v.io/v23/vom/testdata/types.NInt8 int8",
+ 'hex': "815127000021762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e496e74380110e152ffff",
+ 'hexVersion': "81",
+ 'hexType': "5127000021762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e496e74380110e1",
+ 'hexValue': "52ffff",
+},
+{
+ 'name': "types.NInt8(127)",
+ 'value': canonicalize.reduce(new types.NInt8(127, true), new types.NInt8()._type),
+ 'typeString': "v.io/v23/vom/testdata/types.NInt8 int8",
+ 'hex': "815127000021762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e496e74380110e152fffe",
+ 'hexVersion': "81",
+ 'hexType': "5127000021762e696f2f7632332f766f6d2f74657374646174612f74797065732e4e496e74380110e1",
+ 'hexValue': "52fffe",
+},
+{
+ 'name': "int8(0)",
+ 'value': canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.INT8))(0, true), vdl.types.INT8),
+ 'typeString': "int8",
+ 'hex': "812000",
+ 'hexVersion': "81",
+ 'hexType': "",
+ 'hexValue': "2000",
+},
+{
+ 'name': "int8(1)",
+ 'value': canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.INT8))(1, true), vdl.types.INT8),
+ 'typeString': "int8",
+ 'hex': "812002",
+ 'hexVersion': "81",
+ 'hexType': "",
+ 'hexValue': "2002",
+},
+{
+ 'name': "typeobject(int8)",
+ 'value': vdl.types.INT8,
+ 'typeString': "typeobject",
+ 'hex': "811c011000",
+ 'hexVersion': "81",
+ 'hexType': "",
+ 'hexValue': "1c011000",
+},
+{
+ 'name': "types.MInt8Slice{-128, -1, 0, 127}",
+ 'value': canonicalize.reduce(new types.MInt8Slice([
+-128,
+-1,
+0,
+127,
+], true), new types.MInt8Slice()._type),
+ 'typeString': "v.io/v23/vom/testdata/types.MInt8Slice []int8",
+ 'hex': "81512c030026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4d496e7438536c6963650110e1520704ffff0100fffe",
+ 'hexVersion': "81",
+ 'hexType': "512c030026762e696f2f7632332f766f6d2f74657374646174612f74797065732e4d496e7438536c6963650110e1",
+ 'hexValue': "520704ffff0100fffe",
+},
+{
+ 'name': "types.StructAny{Any: int8(1)}",
+ 'value': canonicalize.reduce(new types.StructAny({
+ 'any': canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.INT8))(1, true), vdl.types.INT8),
+}, true), new types.StructAny()._type),
+ 'typeString': "v.io/v23/vom/testdata/types.StructAny struct{Any any}",
+ 'hex': "815133060025762e696f2f7632332f766f6d2f74657374646174612f74797065732e537472756374416e7901010003416e79010fe1e152011004000002e1",
+ 'hexVersion': "81",
+ 'hexType': "5133060025762e696f2f7632332f766f6d2f74657374646174612f74797065732e537472756374416e7901010003416e79010fe1e1",
+ 'hexValue': "52011004000002e1",
+},
], true), _type1);
module.exports.CompatTests = canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_type10))(new Map([
@@ -3793,7 +3899,7 @@
],
},
]],
- ["string, []byte, [n]byte, and enum", [
+ ["string and enum", [
{
'name': "enum (A)",
'primaryType': types.NEnum.A._type,
@@ -3801,9 +3907,6 @@
canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.STRING))("A", true), vdl.types.STRING),
canonicalize.reduce(new types.NString("A", true), new types.NString()._type),
types.NEnum.A,
-canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_type2))(new Uint8Array([
-65,
-]), true), _type2),
],
},
{
@@ -3814,40 +3917,6 @@
canonicalize.reduce(new types.NString("Brie", true), new types.NString()._type),
types.BrieEnum.BRIE,
types.FoodEnum.BRIE,
-canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_type2))(new Uint8Array([
-66,
-114,
-105,
-101,
-]), true), _type2),
-canonicalize.reduce(new types.NByteArray(new Uint8Array([
-66,
-114,
-105,
-101,
-]), true), new types.NByteArray()._type),
-],
-},
-{
- 'name': "[4]byte",
- 'primaryType': new types.NByteArray()._type,
- 'values': [
-canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.STRING))("Bean", true), vdl.types.STRING),
-canonicalize.reduce(new types.NString("Bean", true), new types.NString()._type),
-types.BeanEnum.BEAN,
-types.FoodEnum.BEAN,
-canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_type2))(new Uint8Array([
-66,
-101,
-97,
-110,
-]), true), _type2),
-canonicalize.reduce(new types.NByteArray(new Uint8Array([
-66,
-101,
-97,
-110,
-]), true), new types.NByteArray()._type),
],
},
{
@@ -3857,22 +3926,6 @@
canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.STRING))("Cherry", true), vdl.types.STRING),
canonicalize.reduce(new types.NString("Cherry", true), new types.NString()._type),
types.FoodEnum.CHERRY,
-canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(_type2))(new Uint8Array([
-67,
-104,
-101,
-114,
-114,
-121,
-]), true), _type2),
-canonicalize.reduce(new types.NByteSlice(new Uint8Array([
-67,
-104,
-101,
-114,
-114,
-121,
-]), true), new types.NByteSlice()._type),
],
},
]],
diff --git a/src/gen-vdl/v.io/v23/vom/testdata/types/index.js b/src/gen-vdl/v.io/v23/vom/testdata/types/index.js
index 50b6a2a..02a5ffa 100644
--- a/src/gen-vdl/v.io/v23/vom/testdata/types/index.js
+++ b/src/gen-vdl/v.io/v23/vom/testdata/types/index.js
@@ -19,6 +19,7 @@
var _type1 = new vdl.Type();
var _type10 = new vdl.Type();
var _type11 = new vdl.Type();
+var _type12 = new vdl.Type();
var _type2 = new vdl.Type();
var _type3 = new vdl.Type();
var _type4 = new vdl.Type();
@@ -42,6 +43,7 @@
var _typeListString = new vdl.Type();
var _typeMBool = new vdl.Type();
var _typeMByteSlice = new vdl.Type();
+var _typeMInt8Slice = new vdl.Type();
var _typeMList = new vdl.Type();
var _typeMMap = new vdl.Type();
var _typeMStruct = new vdl.Type();
@@ -66,6 +68,7 @@
var _typeNInt16 = new vdl.Type();
var _typeNInt32 = new vdl.Type();
var _typeNInt64 = new vdl.Type();
+var _typeNInt8 = new vdl.Type();
var _typeNListUint64 = new vdl.Type();
var _typeNMapUint64String = new vdl.Type();
var _typeNSetUint64 = new vdl.Type();
@@ -98,39 +101,43 @@
_type1.kind = vdl.kind.LIST;
_type1.name = "";
_type1.elem = vdl.types.ANY;
-_type10.kind = vdl.kind.OPTIONAL;
+_type10.kind = vdl.kind.LIST;
_type10.name = "";
-_type10.elem = _typeLargeMessageType;
+_type10.elem = vdl.types.BYTE;
_type11.kind = vdl.kind.OPTIONAL;
_type11.name = "";
-_type11.elem = _typeLargeAnyMessageType;
+_type11.elem = _typeLargeMessageType;
+_type12.kind = vdl.kind.OPTIONAL;
+_type12.name = "";
+_type12.elem = _typeLargeAnyMessageType;
_type2.kind = vdl.kind.MAP;
_type2.name = "";
-_type2.elem = _type3;
-_type2.key = vdl.types.STRING;
-_type3.kind = vdl.kind.LIST;
+_type2.elem = _type1;
+_type2.key = vdl.types.BYTE;
+_type3.kind = vdl.kind.MAP;
_type3.name = "";
-_type3.elem = vdl.types.TYPEOBJECT;
-_type4.kind = vdl.kind.MAP;
+_type3.elem = _type4;
+_type3.key = vdl.types.STRING;
+_type4.kind = vdl.kind.LIST;
_type4.name = "";
-_type4.elem = _type5;
-_type4.key = vdl.types.STRING;
-_type5.kind = vdl.kind.LIST;
+_type4.elem = vdl.types.TYPEOBJECT;
+_type5.kind = vdl.kind.MAP;
_type5.name = "";
-_type5.elem = _typeConvertGroup;
-_type6.kind = vdl.kind.OPTIONAL;
+_type5.elem = _type6;
+_type5.key = vdl.types.STRING;
+_type6.kind = vdl.kind.LIST;
_type6.name = "";
-_type6.elem = _typeNStruct;
+_type6.elem = _typeConvertGroup;
_type7.kind = vdl.kind.OPTIONAL;
_type7.name = "";
-_type7.elem = _typeRecStruct;
-_type8.kind = vdl.kind.MAP;
+_type7.elem = _typeNStruct;
+_type8.kind = vdl.kind.OPTIONAL;
_type8.name = "";
-_type8.elem = vdl.types.INT64;
-_type8.key = vdl.types.INT64;
-_type9.kind = vdl.kind.LIST;
+_type8.elem = _typeRecStruct;
+_type9.kind = vdl.kind.MAP;
_type9.name = "";
-_type9.elem = vdl.types.BYTE;
+_type9.elem = vdl.types.INT64;
+_type9.key = vdl.types.INT64;
_typeAbcStruct.kind = vdl.kind.STRUCT;
_typeAbcStruct.name = "v.io/v23/vom/testdata/types.AbcStruct";
_typeAbcStruct.fields = [{name: "A", type: vdl.types.BOOL}, {name: "B", type: vdl.types.STRING}, {name: "C", type: vdl.types.INT64}];
@@ -165,10 +172,10 @@
_typeFoodEnum.labels = ["Bean", "Brie", "Cherry"];
_typeLargeAnyMessageType.kind = vdl.kind.STRUCT;
_typeLargeAnyMessageType.name = "v.io/v23/vom/testdata/types.LargeAnyMessageType";
-_typeLargeAnyMessageType.fields = [{name: "Payload", type: vdl.types.ANY}, {name: "Next", type: _type11}];
+_typeLargeAnyMessageType.fields = [{name: "Payload", type: vdl.types.ANY}, {name: "Next", type: _type12}];
_typeLargeMessageType.kind = vdl.kind.STRUCT;
_typeLargeMessageType.name = "v.io/v23/vom/testdata/types.LargeMessageType";
-_typeLargeMessageType.fields = [{name: "Payload", type: _type9}, {name: "Next", type: _type10}];
+_typeLargeMessageType.fields = [{name: "Payload", type: _type10}, {name: "Next", type: _type11}];
_typeListString.kind = vdl.kind.LIST;
_typeListString.name = "v.io/v23/vom/testdata/types.ListString";
_typeListString.elem = vdl.types.STRING;
@@ -177,6 +184,9 @@
_typeMByteSlice.kind = vdl.kind.LIST;
_typeMByteSlice.name = "v.io/v23/vom/testdata/types.MByteSlice";
_typeMByteSlice.elem = vdl.types.BYTE;
+_typeMInt8Slice.kind = vdl.kind.LIST;
+_typeMInt8Slice.name = "v.io/v23/vom/testdata/types.MInt8Slice";
+_typeMInt8Slice.elem = vdl.types.INT8;
_typeMList.kind = vdl.kind.LIST;
_typeMList.name = "v.io/v23/vom/testdata/types.MList";
_typeMList.elem = _typeNListUint64;
@@ -186,7 +196,7 @@
_typeMMap.key = _typeNFloat32;
_typeMStruct.kind = vdl.kind.STRUCT;
_typeMStruct.name = "v.io/v23/vom/testdata/types.MStruct";
-_typeMStruct.fields = [{name: "A", type: vdl.types.BOOL}, {name: "B", type: _typeNBool}, {name: "C", type: _typeMBool}, {name: "D", type: _type6}, {name: "E", type: vdl.types.TYPEOBJECT}, {name: "F", type: vdl.types.ANY}];
+_typeMStruct.fields = [{name: "A", type: vdl.types.BOOL}, {name: "B", type: _typeNBool}, {name: "C", type: _typeMBool}, {name: "D", type: _type7}, {name: "E", type: vdl.types.TYPEOBJECT}, {name: "F", type: vdl.types.ANY}];
_typeMapOnlyA.kind = vdl.kind.MAP;
_typeMapOnlyA.name = "v.io/v23/vom/testdata/types.MapOnlyA";
_typeMapOnlyA.elem = vdl.types.UINT32;
@@ -247,6 +257,8 @@
_typeNInt32.name = "v.io/v23/vom/testdata/types.NInt32";
_typeNInt64.kind = vdl.kind.INT64;
_typeNInt64.name = "v.io/v23/vom/testdata/types.NInt64";
+_typeNInt8.kind = vdl.kind.INT8;
+_typeNInt8.name = "v.io/v23/vom/testdata/types.NInt8";
_typeNListUint64.kind = vdl.kind.LIST;
_typeNListUint64.name = "v.io/v23/vom/testdata/types.NListUint64";
_typeNListUint64.elem = vdl.types.UINT64;
@@ -276,7 +288,7 @@
_typeRecA.elem = _typeRecA;
_typeRecStruct.kind = vdl.kind.STRUCT;
_typeRecStruct.name = "v.io/v23/vom/testdata/types.RecStruct";
-_typeRecStruct.fields = [{name: "A", type: _type7}];
+_typeRecStruct.fields = [{name: "A", type: _type8}];
_typeRecX.kind = vdl.kind.LIST;
_typeRecX.name = "v.io/v23/vom/testdata/types.RecX";
_typeRecX.elem = _typeRecY;
@@ -312,10 +324,10 @@
_typeStructAny.fields = [{name: "Any", type: vdl.types.ANY}];
_typeStructManyTypes.kind = vdl.kind.STRUCT;
_typeStructManyTypes.name = "v.io/v23/vom/testdata/types.StructManyTypes";
-_typeStructManyTypes.fields = [{name: "Bool", type: vdl.types.BOOL}, {name: "AByte", type: vdl.types.BYTE}, {name: "Int16", type: vdl.types.INT16}, {name: "Int32", type: vdl.types.INT32}, {name: "Int64", type: vdl.types.INT64}, {name: "Uint16", type: vdl.types.UINT16}, {name: "Uint32", type: vdl.types.UINT32}, {name: "Uint64", type: vdl.types.UINT64}, {name: "String", type: vdl.types.STRING}, {name: "Bytes", type: _type9}, {name: "Float32", type: vdl.types.FLOAT32}, {name: "Float64", type: vdl.types.FLOAT64}, {name: "Complex64", type: vdl.types.COMPLEX64}, {name: "Complex128", type: vdl.types.COMPLEX128}, {name: "FoodEnum", type: _typeFoodEnum}, {name: "NEnum", type: _typeNEnum}, {name: "NListUint64", type: _typeNListUint64}, {name: "NByteArray", type: _typeNByteArray}, {name: "NArray2Uint64", type: _typeNArray2Uint64}, {name: "NSetUint64", type: _typeNSetUint64}, {name: "NMapUint64String", type: _typeNMapUint64String}, {name: "NStruct", type: _typeNStruct}, {name: "NUnion", type: _typeNUnion}, {name: "TypeObject", type: vdl.types.TYPEOBJECT}];
+_typeStructManyTypes.fields = [{name: "Bool", type: vdl.types.BOOL}, {name: "AByte", type: vdl.types.BYTE}, {name: "Int16", type: vdl.types.INT16}, {name: "Int32", type: vdl.types.INT32}, {name: "Int64", type: vdl.types.INT64}, {name: "Uint16", type: vdl.types.UINT16}, {name: "Uint32", type: vdl.types.UINT32}, {name: "Uint64", type: vdl.types.UINT64}, {name: "String", type: vdl.types.STRING}, {name: "Bytes", type: _type10}, {name: "Float32", type: vdl.types.FLOAT32}, {name: "Float64", type: vdl.types.FLOAT64}, {name: "Complex64", type: vdl.types.COMPLEX64}, {name: "Complex128", type: vdl.types.COMPLEX128}, {name: "FoodEnum", type: _typeFoodEnum}, {name: "NEnum", type: _typeNEnum}, {name: "NListUint64", type: _typeNListUint64}, {name: "NByteArray", type: _typeNByteArray}, {name: "NArray2Uint64", type: _typeNArray2Uint64}, {name: "NSetUint64", type: _typeNSetUint64}, {name: "NMapUint64String", type: _typeNMapUint64String}, {name: "NStruct", type: _typeNStruct}, {name: "NUnion", type: _typeNUnion}, {name: "TypeObject", type: vdl.types.TYPEOBJECT}];
_typeStructMap.kind = vdl.kind.STRUCT;
_typeStructMap.name = "v.io/v23/vom/testdata/types.StructMap";
-_typeStructMap.fields = [{name: "Map", type: _type8}];
+_typeStructMap.fields = [{name: "Map", type: _type9}];
_typeStructOnlyMap.kind = vdl.kind.MAP;
_typeStructOnlyMap.name = "v.io/v23/vom/testdata/types.StructOnlyMap";
_typeStructOnlyMap.elem = vdl.types.UINT64;
@@ -325,7 +337,7 @@
_typeTestCase.fields = [{name: "Name", type: vdl.types.STRING}, {name: "Value", type: vdl.types.ANY}, {name: "TypeString", type: vdl.types.STRING}, {name: "Hex", type: vdl.types.STRING}, {name: "HexVersion", type: vdl.types.STRING}, {name: "HexType", type: vdl.types.STRING}, {name: "HexValue", type: vdl.types.STRING}];
_typeVomdataStruct.kind = vdl.kind.STRUCT;
_typeVomdataStruct.name = "v.io/v23/vom/testdata/types.VomdataStruct";
-_typeVomdataStruct.fields = [{name: "EncodeDecodeData", type: _type1}, {name: "CompatData", type: _type2}, {name: "ConvertData", type: _type4}];
+_typeVomdataStruct.fields = [{name: "EncodeDecodeData", type: _type2}, {name: "CompatData", type: _type3}, {name: "ConvertData", type: _type5}];
_typeXyzStruct.kind = vdl.kind.STRUCT;
_typeXyzStruct.name = "v.io/v23/vom/testdata/types.XyzStruct";
_typeXyzStruct.fields = [{name: "X", type: vdl.types.BOOL}, {name: "Y", type: _typeMBool}, {name: "Z", type: vdl.types.STRING}];
@@ -338,6 +350,7 @@
_type1.freeze();
_type10.freeze();
_type11.freeze();
+_type12.freeze();
_type2.freeze();
_type3.freeze();
_type4.freeze();
@@ -361,6 +374,7 @@
_typeListString.freeze();
_typeMBool.freeze();
_typeMByteSlice.freeze();
+_typeMInt8Slice.freeze();
_typeMList.freeze();
_typeMMap.freeze();
_typeMStruct.freeze();
@@ -385,6 +399,7 @@
_typeNInt16.freeze();
_typeNInt32.freeze();
_typeNInt64.freeze();
+_typeNInt8.freeze();
_typeNListUint64.freeze();
_typeNMapUint64String.freeze();
_typeNSetUint64.freeze();
@@ -439,6 +454,7 @@
module.exports.ListString = (vdl.registry.lookupOrCreateConstructor(_typeListString));
module.exports.MBool = (vdl.registry.lookupOrCreateConstructor(_typeMBool));
module.exports.MByteSlice = (vdl.registry.lookupOrCreateConstructor(_typeMByteSlice));
+module.exports.MInt8Slice = (vdl.registry.lookupOrCreateConstructor(_typeMInt8Slice));
module.exports.MList = (vdl.registry.lookupOrCreateConstructor(_typeMList));
module.exports.MMap = (vdl.registry.lookupOrCreateConstructor(_typeMMap));
module.exports.MStruct = (vdl.registry.lookupOrCreateConstructor(_typeMStruct));
@@ -467,6 +483,7 @@
module.exports.NInt16 = (vdl.registry.lookupOrCreateConstructor(_typeNInt16));
module.exports.NInt32 = (vdl.registry.lookupOrCreateConstructor(_typeNInt32));
module.exports.NInt64 = (vdl.registry.lookupOrCreateConstructor(_typeNInt64));
+module.exports.NInt8 = (vdl.registry.lookupOrCreateConstructor(_typeNInt8));
module.exports.NListUint64 = (vdl.registry.lookupOrCreateConstructor(_typeNListUint64));
module.exports.NMapUint64String = (vdl.registry.lookupOrCreateConstructor(_typeNMapUint64String));
module.exports.NSetUint64 = (vdl.registry.lookupOrCreateConstructor(_typeNSetUint64));
diff --git a/src/gen-vdl/v.io/x/ref/lib/vdl/testdata/base/index.js b/src/gen-vdl/v.io/x/ref/lib/vdl/testdata/base/index.js
index addbb1d..0d1ad75 100644
--- a/src/gen-vdl/v.io/x/ref/lib/vdl/testdata/base/index.js
+++ b/src/gen-vdl/v.io/x/ref/lib/vdl/testdata/base/index.js
@@ -51,6 +51,7 @@
var _typeNamedInt16 = new vdl.Type();
var _typeNamedInt32 = new vdl.Type();
var _typeNamedInt64 = new vdl.Type();
+var _typeNamedInt8 = new vdl.Type();
var _typeNamedList = new vdl.Type();
var _typeNamedMap = new vdl.Type();
var _typeNamedSet = new vdl.Type();
@@ -136,7 +137,7 @@
_typeCompositesArray.elem = _typeComposites;
_typeKeyScalars.kind = vdl.kind.STRUCT;
_typeKeyScalars.name = "v.io/x/ref/lib/vdl/testdata/base.KeyScalars";
-_typeKeyScalars.fields = [{name: "A0", type: vdl.types.BOOL}, {name: "A1", type: vdl.types.BYTE}, {name: "A2", type: vdl.types.UINT16}, {name: "A3", type: vdl.types.UINT32}, {name: "A4", type: vdl.types.UINT64}, {name: "A5", type: vdl.types.INT16}, {name: "A6", type: vdl.types.INT32}, {name: "A7", type: vdl.types.INT64}, {name: "A8", type: vdl.types.FLOAT32}, {name: "A9", type: vdl.types.FLOAT64}, {name: "A10", type: vdl.types.COMPLEX64}, {name: "A11", type: vdl.types.COMPLEX128}, {name: "A12", type: vdl.types.STRING}, {name: "B0", type: _typeNamedBool}, {name: "B1", type: _typeNamedByte}, {name: "B2", type: _typeNamedUint16}, {name: "B3", type: _typeNamedUint32}, {name: "B4", type: _typeNamedUint64}, {name: "B5", type: _typeNamedInt16}, {name: "B6", type: _typeNamedInt32}, {name: "B7", type: _typeNamedInt64}, {name: "B8", type: _typeNamedFloat32}, {name: "B9", type: _typeNamedFloat64}, {name: "B10", type: _typeNamedComplex64}, {name: "B11", type: _typeNamedComplex128}, {name: "B12", type: _typeNamedString}];
+_typeKeyScalars.fields = [{name: "A0", type: vdl.types.BOOL}, {name: "A1", type: vdl.types.BYTE}, {name: "A2", type: vdl.types.UINT16}, {name: "A3", type: vdl.types.UINT32}, {name: "A4", type: vdl.types.UINT64}, {name: "A5", type: vdl.types.INT8}, {name: "A6", type: vdl.types.INT16}, {name: "A7", type: vdl.types.INT32}, {name: "A8", type: vdl.types.INT64}, {name: "A9", type: vdl.types.FLOAT32}, {name: "A10", type: vdl.types.FLOAT64}, {name: "A11", type: vdl.types.COMPLEX64}, {name: "A12", type: vdl.types.COMPLEX128}, {name: "A13", type: vdl.types.STRING}, {name: "B0", type: _typeNamedBool}, {name: "B1", type: _typeNamedByte}, {name: "B2", type: _typeNamedUint16}, {name: "B3", type: _typeNamedUint32}, {name: "B4", type: _typeNamedUint64}, {name: "B5", type: _typeNamedInt8}, {name: "B6", type: _typeNamedInt16}, {name: "B7", type: _typeNamedInt32}, {name: "B8", type: _typeNamedInt64}, {name: "B9", type: _typeNamedFloat32}, {name: "B10", type: _typeNamedFloat64}, {name: "B11", type: _typeNamedComplex64}, {name: "B12", type: _typeNamedComplex128}, {name: "B13", type: _typeNamedString}];
_typeNamedArray.kind = vdl.kind.ARRAY;
_typeNamedArray.name = "v.io/x/ref/lib/vdl/testdata/base.NamedArray";
_typeNamedArray.len = 2;
@@ -162,6 +163,8 @@
_typeNamedInt32.name = "v.io/x/ref/lib/vdl/testdata/base.NamedInt32";
_typeNamedInt64.kind = vdl.kind.INT64;
_typeNamedInt64.name = "v.io/x/ref/lib/vdl/testdata/base.NamedInt64";
+_typeNamedInt8.kind = vdl.kind.INT8;
+_typeNamedInt8.name = "v.io/x/ref/lib/vdl/testdata/base.NamedInt8";
_typeNamedList.kind = vdl.kind.LIST;
_typeNamedList.name = "v.io/x/ref/lib/vdl/testdata/base.NamedList";
_typeNamedList.elem = vdl.types.UINT32;
@@ -191,7 +194,7 @@
_typeNestedArgs.fields = [{name: "Args", type: _typeArgs}];
_typeScalars.kind = vdl.kind.STRUCT;
_typeScalars.name = "v.io/x/ref/lib/vdl/testdata/base.Scalars";
-_typeScalars.fields = [{name: "A0", type: vdl.types.BOOL}, {name: "A1", type: vdl.types.BYTE}, {name: "A2", type: vdl.types.UINT16}, {name: "A3", type: vdl.types.UINT32}, {name: "A4", type: vdl.types.UINT64}, {name: "A5", type: vdl.types.INT16}, {name: "A6", type: vdl.types.INT32}, {name: "A7", type: vdl.types.INT64}, {name: "A8", type: vdl.types.FLOAT32}, {name: "A9", type: vdl.types.FLOAT64}, {name: "A10", type: vdl.types.COMPLEX64}, {name: "A11", type: vdl.types.COMPLEX128}, {name: "A12", type: vdl.types.STRING}, {name: "A13", type: vdl.types.ERROR}, {name: "A14", type: vdl.types.ANY}, {name: "A15", type: vdl.types.TYPEOBJECT}, {name: "B0", type: _typeNamedBool}, {name: "B1", type: _typeNamedByte}, {name: "B2", type: _typeNamedUint16}, {name: "B3", type: _typeNamedUint32}, {name: "B4", type: _typeNamedUint64}, {name: "B5", type: _typeNamedInt16}, {name: "B6", type: _typeNamedInt32}, {name: "B7", type: _typeNamedInt64}, {name: "B8", type: _typeNamedFloat32}, {name: "B9", type: _typeNamedFloat64}, {name: "B10", type: _typeNamedComplex64}, {name: "B11", type: _typeNamedComplex128}, {name: "B12", type: _typeNamedString}, {name: "B13", type: _typeNamedEnum}, {name: "B14", type: _typeNamedUnion}];
+_typeScalars.fields = [{name: "A0", type: vdl.types.BOOL}, {name: "A1", type: vdl.types.BYTE}, {name: "A2", type: vdl.types.UINT16}, {name: "A3", type: vdl.types.UINT32}, {name: "A4", type: vdl.types.UINT64}, {name: "A5", type: vdl.types.INT8}, {name: "A6", type: vdl.types.INT16}, {name: "A7", type: vdl.types.INT32}, {name: "A8", type: vdl.types.INT64}, {name: "A9", type: vdl.types.FLOAT32}, {name: "A10", type: vdl.types.FLOAT64}, {name: "A11", type: vdl.types.COMPLEX64}, {name: "A12", type: vdl.types.COMPLEX128}, {name: "A13", type: vdl.types.STRING}, {name: "A14", type: vdl.types.ERROR}, {name: "A15", type: vdl.types.ANY}, {name: "A16", type: vdl.types.TYPEOBJECT}, {name: "B0", type: _typeNamedBool}, {name: "B1", type: _typeNamedByte}, {name: "B2", type: _typeNamedUint16}, {name: "B3", type: _typeNamedUint32}, {name: "B4", type: _typeNamedUint64}, {name: "B5", type: _typeNamedInt8}, {name: "B6", type: _typeNamedInt16}, {name: "B7", type: _typeNamedInt32}, {name: "B8", type: _typeNamedInt64}, {name: "B9", type: _typeNamedFloat32}, {name: "B10", type: _typeNamedFloat64}, {name: "B11", type: _typeNamedComplex64}, {name: "B12", type: _typeNamedComplex128}, {name: "B13", type: _typeNamedString}, {name: "B14", type: _typeNamedEnum}, {name: "B15", type: _typeNamedUnion}];
_typeScalarsArray.kind = vdl.kind.ARRAY;
_typeScalarsArray.name = "v.io/x/ref/lib/vdl/testdata/base.ScalarsArray";
_typeScalarsArray.len = 2;
@@ -229,6 +232,7 @@
_typeNamedInt16.freeze();
_typeNamedInt32.freeze();
_typeNamedInt64.freeze();
+_typeNamedInt8.freeze();
_typeNamedList.freeze();
_typeNamedMap.freeze();
_typeNamedSet.freeze();
@@ -261,6 +265,7 @@
module.exports.NamedInt16 = (vdl.registry.lookupOrCreateConstructor(_typeNamedInt16));
module.exports.NamedInt32 = (vdl.registry.lookupOrCreateConstructor(_typeNamedInt32));
module.exports.NamedInt64 = (vdl.registry.lookupOrCreateConstructor(_typeNamedInt64));
+module.exports.NamedInt8 = (vdl.registry.lookupOrCreateConstructor(_typeNamedInt8));
module.exports.NamedList = (vdl.registry.lookupOrCreateConstructor(_typeNamedList));
module.exports.NamedMap = (vdl.registry.lookupOrCreateConstructor(_typeNamedMap));
module.exports.NamedSet = (vdl.registry.lookupOrCreateConstructor(_typeNamedSet));
@@ -347,15 +352,16 @@
'a4': new vdl.BigInt(1, new Uint8Array([0x4])),
'a5': 5,
'a6': 6,
- 'a7': new vdl.BigInt(1, new Uint8Array([0x7])),
- 'a8': 8,
+ 'a7': 7,
+ 'a8': new vdl.BigInt(1, new Uint8Array([0x8])),
'a9': 9,
- 'a10': new vdl.Complex(10.000000, 0.000000),
+ 'a10': 10,
'a11': new vdl.Complex(11.000000, 0.000000),
- 'a12': "abc",
- 'a13': null,
- 'a14': canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.BOOL))(false, true), vdl.types.BOOL),
- 'a15': vdl.types.BOOL,
+ 'a12': new vdl.Complex(12.000000, 0.000000),
+ 'a13': "abc",
+ 'a14': null,
+ 'a15': canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.BOOL))(false, true), vdl.types.BOOL),
+ 'a16': vdl.types.BOOL,
'b0': true,
'b1': 1,
'b2': 2,
@@ -363,14 +369,15 @@
'b4': new vdl.BigInt(1, new Uint8Array([0x4])),
'b5': 5,
'b6': 6,
- 'b7': new vdl.BigInt(1, new Uint8Array([0x7])),
- 'b8': 8,
+ 'b7': 7,
+ 'b8': new vdl.BigInt(1, new Uint8Array([0x8])),
'b9': 9,
- 'b10': new vdl.Complex(10.000000, 0.000000),
+ 'b10': 10,
'b11': new vdl.Complex(11.000000, 0.000000),
- 'b12': "abc",
- 'b13': 'B',
- 'b14': { "c": 123 },
+ 'b12': new vdl.Complex(12.000000, 0.000000),
+ 'b13': "abc",
+ 'b14': 'B',
+ 'b15': { "c": 123 },
}, true), _typeScalars);
module.exports.True = canonicalize.reduce(new (vdl.registry.lookupOrCreateConstructor(vdl.types.BOOL))(true, true), vdl.types.BOOL);
@@ -395,6 +402,8 @@
module.exports.CTypeObject_uint16 = vdl.types.UINT16;
+ module.exports.CTypeObject_int8 = vdl.types.INT8;
+
module.exports.CTypeObject_int16 = vdl.types.INT16;
module.exports.CTypeObject_float32 = vdl.types.FLOAT32;
diff --git a/src/vdl/canonicalize.js b/src/vdl/canonicalize.js
index ae051f3..8474c73 100644
--- a/src/vdl/canonicalize.js
+++ b/src/vdl/canonicalize.js
@@ -329,6 +329,7 @@
case kind.BYTE:
case kind.UINT16:
case kind.UINT32:
+ case kind.INT8:
case kind.INT16:
case kind.INT32:
case kind.FLOAT32:
@@ -585,6 +586,7 @@
case kind.BYTE:
case kind.UINT16:
case kind.UINT32:
+ case kind.INT8:
case kind.INT16:
case kind.INT32:
case kind.FLOAT32:
@@ -957,6 +959,7 @@
case kind.UINT16:
case kind.UINT32:
case kind.UINT64:
+ case kind.INT8:
case kind.INT16:
case kind.INT32:
case kind.INT64:
diff --git a/src/vdl/create-constructor.js b/src/vdl/create-constructor.js
index 3385a3e..eeafb8c 100644
--- a/src/vdl/create-constructor.js
+++ b/src/vdl/create-constructor.js
@@ -25,6 +25,7 @@
case kind.UINT16:
case kind.UINT32:
case kind.UINT64:
+ case kind.INT8:
case kind.INT16:
case kind.INT32:
case kind.INT64:
diff --git a/src/vdl/kind.js b/src/vdl/kind.js
index 2277f2b..c9702a1 100644
--- a/src/vdl/kind.js
+++ b/src/vdl/kind.js
@@ -55,6 +55,11 @@
* @type {string}
* @const
*/
+ INT8: 'int8',
+ /**
+ * @type {string}
+ * @const
+ */
INT16: 'int16',
/**
* @type {string}
diff --git a/src/vdl/overflow.js b/src/vdl/overflow.js
index 9b4c195..ad1b5f4 100644
--- a/src/vdl/overflow.js
+++ b/src/vdl/overflow.js
@@ -17,6 +17,8 @@
return 0xffff;
case kind.UINT32:
return 0xffffffff;
+ case kind.INT8:
+ return 0x7f;
case kind.INT16:
return 0x7fff;
case kind.INT32:
@@ -38,6 +40,8 @@
return 0;
case kind.UINT32:
return 0;
+ case kind.INT8:
+ return -0x80;
case kind.INT16:
return -0x8000;
case kind.INT32:
diff --git a/src/vdl/type-compatible.js b/src/vdl/type-compatible.js
index 73e52b0..47d8838 100644
--- a/src/vdl/type-compatible.js
+++ b/src/vdl/type-compatible.js
@@ -235,6 +235,7 @@
case kind.UINT16:
case kind.UINT32:
case kind.UINT64:
+ case kind.INT8:
case kind.INT16:
case kind.INT32:
case kind.INT64:
diff --git a/src/vdl/type-object-from-kind.js b/src/vdl/type-object-from-kind.js
index 8ce6cc0..666d10d 100644
--- a/src/vdl/type-object-from-kind.js
+++ b/src/vdl/type-object-from-kind.js
@@ -236,6 +236,7 @@
case kind.UINT16:
case kind.UINT32:
case kind.UINT64:
+ case kind.INT8:
case kind.INT16:
case kind.INT32:
case kind.INT64:
diff --git a/src/vdl/types.js b/src/vdl/types.js
index 25eb07b..6d12b87 100644
--- a/src/vdl/types.js
+++ b/src/vdl/types.js
@@ -54,6 +54,11 @@
* @type {module:vanadium.vdl.Type}
* @const
*/
+ INT8: primitiveType(kind.INT8),
+ /**
+ * @type {module:vanadium.vdl.Type}
+ * @const
+ */
INT16: primitiveType(kind.INT16),
/**
* @type {module:vanadium.vdl.Type}
diff --git a/test/vdl/test-vdl-base.js b/test/vdl/test-vdl-base.js
index 7d4c5f6..47a7dea 100644
--- a/test/vdl/test-vdl-base.js
+++ b/test/vdl/test-vdl-base.js
@@ -48,6 +48,13 @@
});
assert.deepEqual(res.val, BigInt.fromNativeNumber(1));
+ res = new base.NamedInt8(1);
+ assert.deepEqual(res._type, {
+ kind: kind.INT8,
+ name: 'v.io/x/ref/lib/vdl/testdata/base.NamedInt8',
+ });
+ assert.equal(res.val, 1);
+
res = new base.NamedInt16(1);
assert.deepEqual(res._type, {
kind: kind.INT16,