Przeglądaj źródła

Update protoc.js

Lutz Roeder 8 miesięcy temu
rodzic
commit
99d5599a2e
3 zmienionych plików z 81 dodań i 81 usunięć
  1. 26 26
      source/caffe2-proto.js
  2. 54 54
      source/paddle-proto.js
  3. 1 1
      tools/protoc.js

+ 26 - 26
source/caffe2-proto.js

@@ -170,10 +170,10 @@ caffe2.TensorProto.Segment = class Segment {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'begin')) {
-            throw new Error("Excepted 'begin'.");
+            throw new Error("Expected 'begin'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'end')) {
-            throw new Error("Excepted 'end'.");
+            throw new Error("Expected 'end'.");
         }
         return message;
     }
@@ -196,10 +196,10 @@ caffe2.TensorProto.Segment = class Segment {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "begin")) {
-            throw new Error("Excepted 'begin'.");
+            throw new Error("Expected 'begin'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "end")) {
-            throw new Error("Excepted 'end'.");
+            throw new Error("Expected 'end'.");
         }
         return message;
     }
@@ -265,16 +265,16 @@ caffe2.QTensorProto = class QTensorProto {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'precision')) {
-            throw new Error("Excepted 'precision'.");
+            throw new Error("Expected 'precision'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'scale')) {
-            throw new Error("Excepted 'scale'.");
+            throw new Error("Expected 'scale'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'bias')) {
-            throw new Error("Excepted 'bias'.");
+            throw new Error("Expected 'bias'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'is_signed')) {
-            throw new Error("Excepted 'is_signed'.");
+            throw new Error("Expected 'is_signed'.");
         }
         return message;
     }
@@ -327,16 +327,16 @@ caffe2.QTensorProto = class QTensorProto {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "precision")) {
-            throw new Error("Excepted 'precision'.");
+            throw new Error("Expected 'precision'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "scale")) {
-            throw new Error("Excepted 'scale'.");
+            throw new Error("Expected 'scale'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "bias")) {
-            throw new Error("Excepted 'bias'.");
+            throw new Error("Expected 'bias'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "is_signed")) {
-            throw new Error("Excepted 'is_signed'.");
+            throw new Error("Expected 'is_signed'.");
         }
         return message;
     }
@@ -661,13 +661,13 @@ caffe2.AOTConfig = class AOTConfig {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'max_batch_size')) {
-            throw new Error("Excepted 'max_batch_size'.");
+            throw new Error("Expected 'max_batch_size'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'max_seq_size')) {
-            throw new Error("Excepted 'max_seq_size'.");
+            throw new Error("Expected 'max_seq_size'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'in_batch_broadcast')) {
-            throw new Error("Excepted 'in_batch_broadcast'.");
+            throw new Error("Expected 'in_batch_broadcast'.");
         }
         return message;
     }
@@ -699,13 +699,13 @@ caffe2.AOTConfig = class AOTConfig {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "max_batch_size")) {
-            throw new Error("Excepted 'max_batch_size'.");
+            throw new Error("Expected 'max_batch_size'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "max_seq_size")) {
-            throw new Error("Excepted 'max_seq_size'.");
+            throw new Error("Expected 'max_seq_size'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "in_batch_broadcast")) {
-            throw new Error("Excepted 'in_batch_broadcast'.");
+            throw new Error("Expected 'in_batch_broadcast'.");
         }
         return message;
     }
@@ -1067,10 +1067,10 @@ caffe2.MapFieldEntry = class MapFieldEntry {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'key')) {
-            throw new Error("Excepted 'key'.");
+            throw new Error("Expected 'key'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'val')) {
-            throw new Error("Excepted 'val'.");
+            throw new Error("Expected 'val'.");
         }
         return message;
     }
@@ -1093,10 +1093,10 @@ caffe2.MapFieldEntry = class MapFieldEntry {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "key")) {
-            throw new Error("Excepted 'key'.");
+            throw new Error("Expected 'key'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "val")) {
-            throw new Error("Excepted 'val'.");
+            throw new Error("Expected 'val'.");
         }
         return message;
     }
@@ -1129,7 +1129,7 @@ caffe2.BackendOptions = class BackendOptions {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'backend_name')) {
-            throw new Error("Excepted 'backend_name'.");
+            throw new Error("Expected 'backend_name'.");
         }
         return message;
     }
@@ -1152,7 +1152,7 @@ caffe2.BackendOptions = class BackendOptions {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "backend_name")) {
-            throw new Error("Excepted 'backend_name'.");
+            throw new Error("Expected 'backend_name'.");
         }
         return message;
     }
@@ -1191,7 +1191,7 @@ caffe2.PartitionInfo = class PartitionInfo {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'name')) {
-            throw new Error("Excepted 'name'.");
+            throw new Error("Expected 'name'.");
         }
         return message;
     }
@@ -1220,7 +1220,7 @@ caffe2.PartitionInfo = class PartitionInfo {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "name")) {
-            throw new Error("Excepted 'name'.");
+            throw new Error("Expected 'name'.");
         }
         return message;
     }

+ 54 - 54
source/paddle-proto.js

@@ -85,10 +85,10 @@ paddle.framework.proto.Complex = class Complex {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'r')) {
-            throw new Error("Excepted 'r'.");
+            throw new Error("Expected 'r'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'i')) {
-            throw new Error("Excepted 'i'.");
+            throw new Error("Expected 'i'.");
         }
         return message;
     }
@@ -111,10 +111,10 @@ paddle.framework.proto.Complex = class Complex {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "r")) {
-            throw new Error("Excepted 'r'.");
+            throw new Error("Expected 'r'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "i")) {
-            throw new Error("Excepted 'i'.");
+            throw new Error("Expected 'i'.");
         }
         return message;
     }
@@ -152,7 +152,7 @@ paddle.framework.proto.Scalar = class Scalar {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'type')) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         return message;
     }
@@ -184,7 +184,7 @@ paddle.framework.proto.Scalar = class Scalar {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "type")) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         return message;
     }
@@ -238,7 +238,7 @@ paddle.framework.proto.OpDesc = class OpDesc {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'type')) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         return message;
     }
@@ -270,7 +270,7 @@ paddle.framework.proto.OpDesc = class OpDesc {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "type")) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         return message;
     }
@@ -365,10 +365,10 @@ paddle.framework.proto.OpDesc.Attr = class Attr {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'name')) {
-            throw new Error("Excepted 'name'.");
+            throw new Error("Expected 'name'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'type')) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         return message;
     }
@@ -445,10 +445,10 @@ paddle.framework.proto.OpDesc.Attr = class Attr {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "name")) {
-            throw new Error("Excepted 'name'.");
+            throw new Error("Expected 'name'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "type")) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         return message;
     }
@@ -490,7 +490,7 @@ paddle.framework.proto.OpDesc.Var = class Var {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'parameter')) {
-            throw new Error("Excepted 'parameter'.");
+            throw new Error("Expected 'parameter'.");
         }
         return message;
     }
@@ -513,7 +513,7 @@ paddle.framework.proto.OpDesc.Var = class Var {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "parameter")) {
-            throw new Error("Excepted 'parameter'.");
+            throw new Error("Expected 'parameter'.");
         }
         return message;
     }
@@ -556,10 +556,10 @@ paddle.framework.proto.OpProto = class OpProto {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'type')) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'comment')) {
-            throw new Error("Excepted 'comment'.");
+            throw new Error("Expected 'comment'.");
         }
         return message;
     }
@@ -591,10 +591,10 @@ paddle.framework.proto.OpProto = class OpProto {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "type")) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "comment")) {
-            throw new Error("Excepted 'comment'.");
+            throw new Error("Expected 'comment'.");
         }
         return message;
     }
@@ -638,10 +638,10 @@ paddle.framework.proto.OpProto.Var = class Var {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'name')) {
-            throw new Error("Excepted 'name'.");
+            throw new Error("Expected 'name'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'comment')) {
-            throw new Error("Excepted 'comment'.");
+            throw new Error("Expected 'comment'.");
         }
         return message;
     }
@@ -679,10 +679,10 @@ paddle.framework.proto.OpProto.Var = class Var {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "name")) {
-            throw new Error("Excepted 'name'.");
+            throw new Error("Expected 'name'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "comment")) {
-            throw new Error("Excepted 'comment'.");
+            throw new Error("Expected 'comment'.");
         }
         return message;
     }
@@ -731,13 +731,13 @@ paddle.framework.proto.OpProto.Attr = class Attr {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'name')) {
-            throw new Error("Excepted 'name'.");
+            throw new Error("Expected 'name'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'type')) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'comment')) {
-            throw new Error("Excepted 'comment'.");
+            throw new Error("Expected 'comment'.");
         }
         return message;
     }
@@ -775,13 +775,13 @@ paddle.framework.proto.OpProto.Attr = class Attr {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "name")) {
-            throw new Error("Excepted 'name'.");
+            throw new Error("Expected 'name'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "type")) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "comment")) {
-            throw new Error("Excepted 'comment'.");
+            throw new Error("Expected 'comment'.");
         }
         return message;
     }
@@ -842,7 +842,7 @@ paddle.framework.proto.VarType = class VarType {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'type')) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         return message;
     }
@@ -892,7 +892,7 @@ paddle.framework.proto.VarType = class VarType {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "type")) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         return message;
     }
@@ -970,7 +970,7 @@ paddle.framework.proto.VarType.TensorDesc = class TensorDesc {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'data_type')) {
-            throw new Error("Excepted 'data_type'.");
+            throw new Error("Expected 'data_type'.");
         }
         return message;
     }
@@ -993,7 +993,7 @@ paddle.framework.proto.VarType.TensorDesc = class TensorDesc {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "data_type")) {
-            throw new Error("Excepted 'data_type'.");
+            throw new Error("Expected 'data_type'.");
         }
         return message;
     }
@@ -1021,7 +1021,7 @@ paddle.framework.proto.VarType.DenseTensorDesc = class DenseTensorDesc {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'tensor')) {
-            throw new Error("Excepted 'tensor'.");
+            throw new Error("Expected 'tensor'.");
         }
         return message;
     }
@@ -1044,7 +1044,7 @@ paddle.framework.proto.VarType.DenseTensorDesc = class DenseTensorDesc {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "tensor")) {
-            throw new Error("Excepted 'tensor'.");
+            throw new Error("Expected 'tensor'.");
         }
         return message;
     }
@@ -1073,7 +1073,7 @@ paddle.framework.proto.VarType.DenseTensorArrayDesc = class DenseTensorArrayDesc
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'tensor')) {
-            throw new Error("Excepted 'tensor'.");
+            throw new Error("Expected 'tensor'.");
         }
         return message;
     }
@@ -1096,7 +1096,7 @@ paddle.framework.proto.VarType.DenseTensorArrayDesc = class DenseTensorArrayDesc
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "tensor")) {
-            throw new Error("Excepted 'tensor'.");
+            throw new Error("Expected 'tensor'.");
         }
         return message;
     }
@@ -1226,10 +1226,10 @@ paddle.framework.proto.VarDesc = class VarDesc {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'name')) {
-            throw new Error("Excepted 'name'.");
+            throw new Error("Expected 'name'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'type')) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         return message;
     }
@@ -1267,10 +1267,10 @@ paddle.framework.proto.VarDesc = class VarDesc {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "name")) {
-            throw new Error("Excepted 'name'.");
+            throw new Error("Expected 'name'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "type")) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         return message;
     }
@@ -1316,10 +1316,10 @@ paddle.framework.proto.VarDesc.Attr = class Attr {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'name')) {
-            throw new Error("Excepted 'name'.");
+            throw new Error("Expected 'name'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'type')) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         return message;
     }
@@ -1351,10 +1351,10 @@ paddle.framework.proto.VarDesc.Attr = class Attr {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "name")) {
-            throw new Error("Excepted 'name'.");
+            throw new Error("Expected 'name'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "type")) {
-            throw new Error("Excepted 'type'.");
+            throw new Error("Expected 'type'.");
         }
         return message;
     }
@@ -1399,10 +1399,10 @@ paddle.framework.proto.BlockDesc = class BlockDesc {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'idx')) {
-            throw new Error("Excepted 'idx'.");
+            throw new Error("Expected 'idx'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'parent_idx')) {
-            throw new Error("Excepted 'parent_idx'.");
+            throw new Error("Expected 'parent_idx'.");
         }
         return message;
     }
@@ -1434,10 +1434,10 @@ paddle.framework.proto.BlockDesc = class BlockDesc {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "idx")) {
-            throw new Error("Excepted 'idx'.");
+            throw new Error("Expected 'idx'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "parent_idx")) {
-            throw new Error("Excepted 'parent_idx'.");
+            throw new Error("Expected 'parent_idx'.");
         }
         return message;
     }
@@ -1464,7 +1464,7 @@ paddle.framework.proto.OpVersion = class OpVersion {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'version')) {
-            throw new Error("Excepted 'version'.");
+            throw new Error("Expected 'version'.");
         }
         return message;
     }
@@ -1484,7 +1484,7 @@ paddle.framework.proto.OpVersion = class OpVersion {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "version")) {
-            throw new Error("Excepted 'version'.");
+            throw new Error("Expected 'version'.");
         }
         return message;
     }
@@ -1553,10 +1553,10 @@ paddle.framework.proto.OpVersionMap.OpVersionPair = class OpVersionPair {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'op_name')) {
-            throw new Error("Excepted 'op_name'.");
+            throw new Error("Expected 'op_name'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, 'op_version')) {
-            throw new Error("Excepted 'op_version'.");
+            throw new Error("Expected 'op_version'.");
         }
         return message;
     }
@@ -1579,10 +1579,10 @@ paddle.framework.proto.OpVersionMap.OpVersionPair = class OpVersionPair {
             }
         }
         if (!Object.prototype.hasOwnProperty.call(message, "op_name")) {
-            throw new Error("Excepted 'op_name'.");
+            throw new Error("Expected 'op_name'.");
         }
         if (!Object.prototype.hasOwnProperty.call(message, "op_version")) {
-            throw new Error("Excepted 'op_version'.");
+            throw new Error("Expected 'op_version'.");
         }
         return message;
     }

+ 1 - 1
tools/protoc.js

@@ -1340,7 +1340,7 @@ protoc.Generator = class {
             for (const field of Array.from(type.fields.values()).filter((field) => field.required)) {
                 this._builder.add(`if (!Object.prototype.hasOwnProperty.call(message, '${field.name}')) {`);
                 this._builder.indent();
-                    this._builder.add(`throw new Error("Excepted '${field.name}'.");`);
+                    this._builder.add(`throw new Error("Expected '${field.name}'.");`);
                 this._builder.outdent();
                 this._builder.add('}');
             }