Commit d298adc4 authored by Michael Paulson's avatar Michael Paulson Committed by Wouter van Oortmerssen

chore(lint) (#4079)

* chore(lint)

I accidentally let 2 pieces of lint in with my generated code.

* fix(generate-code): I did not generate all the required code for tests.
parent c2050aa0
...@@ -65,3 +65,4 @@ build/VS2010/FlatBuffers.sdf ...@@ -65,3 +65,4 @@ build/VS2010/FlatBuffers.sdf
build/VS2010/FlatBuffers.opensdf build/VS2010/FlatBuffers.opensdf
build/VS2010/ipch/**/*.ipch build/VS2010/ipch/**/*.ipch
*.so *.so
Testing/Temporary
...@@ -557,13 +557,13 @@ void GenStruct(const Parser &parser, StructDef &struct_def, std::string *code_pt ...@@ -557,13 +557,13 @@ void GenStruct(const Parser &parser, StructDef &struct_def, std::string *code_pt
"@returns {boolean}"); "@returns {boolean}");
code += object_name + ".prototype.mutate_" + field.name + " = function(value) {\n"; code += object_name + ".prototype.mutate_" + field.name + " = function(value) {\n";
code += " var offset = this.bb.__offset(this.bb_pos, " + NumToString(field.value.offset) + ")\n\n"; code += " var offset = this.bb.__offset(this.bb_pos, " + NumToString(field.value.offset) + ");\n\n";
code += " if (offset === 0) {\n"; code += " if (offset === 0) {\n";
code += " return false;\n"; code += " return false;\n";
code += " }\n\n"; code += " }\n\n";
code += " this.bb.write" + MakeCamel(GenType(field.value.type)) + "(this.bb_pos + offset, value);\n"; code += " this.bb.write" + MakeCamel(GenType(field.value.type)) + "(this.bb_pos + offset, value);\n";
code += " return true;\n"; code += " return true;\n";
code += "}\n\n"; code += "};\n\n";
} }
// Emit vector helpers // Emit vector helpers
......
No preview for this file type
This diff is collapsed.
...@@ -69,7 +69,7 @@ NamespaceA.NamespaceB.TableInNestedNS.prototype.foo = function() { ...@@ -69,7 +69,7 @@ NamespaceA.NamespaceB.TableInNestedNS.prototype.foo = function() {
* @returns {boolean} * @returns {boolean}
*/ */
NamespaceA.NamespaceB.TableInNestedNS.prototype.mutate_foo = function(value) { NamespaceA.NamespaceB.TableInNestedNS.prototype.mutate_foo = function(value) {
var offset = this.bb.__offset(this.bb_pos, 4) var offset = this.bb.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
...@@ -77,7 +77,7 @@ NamespaceA.NamespaceB.TableInNestedNS.prototype.mutate_foo = function(value) { ...@@ -77,7 +77,7 @@ NamespaceA.NamespaceB.TableInNestedNS.prototype.mutate_foo = function(value) {
this.bb.writeInt32(this.bb_pos + offset, value); this.bb.writeInt32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {flatbuffers.Builder} builder * @param {flatbuffers.Builder} builder
...@@ -141,7 +141,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.a = function() { ...@@ -141,7 +141,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.a = function() {
* @returns {boolean} * @returns {boolean}
*/ */
NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_a = function(value) { NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_a = function(value) {
var offset = this.bb.__offset(this.bb_pos, 0) var offset = this.bb.__offset(this.bb_pos, 0);
if (offset === 0) { if (offset === 0) {
return false; return false;
...@@ -149,7 +149,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_a = function(value) { ...@@ -149,7 +149,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_a = function(value) {
this.bb.writeInt32(this.bb_pos + offset, value); this.bb.writeInt32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @returns {number} * @returns {number}
...@@ -163,7 +163,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.b = function() { ...@@ -163,7 +163,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.b = function() {
* @returns {boolean} * @returns {boolean}
*/ */
NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_b = function(value) { NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_b = function(value) {
var offset = this.bb.__offset(this.bb_pos, 4) var offset = this.bb.__offset(this.bb_pos, 4);
if (offset === 0) { if (offset === 0) {
return false; return false;
...@@ -171,7 +171,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_b = function(value) { ...@@ -171,7 +171,7 @@ NamespaceA.NamespaceB.StructInNestedNS.prototype.mutate_b = function(value) {
this.bb.writeInt32(this.bb_pos + offset, value); this.bb.writeInt32(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {flatbuffers.Builder} builder * @param {flatbuffers.Builder} builder
......
...@@ -75,7 +75,7 @@ NamespaceA.TableInFirstNS.prototype.fooEnum = function() { ...@@ -75,7 +75,7 @@ NamespaceA.TableInFirstNS.prototype.fooEnum = function() {
* @returns {boolean} * @returns {boolean}
*/ */
NamespaceA.TableInFirstNS.prototype.mutate_foo_enum = function(value) { NamespaceA.TableInFirstNS.prototype.mutate_foo_enum = function(value) {
var offset = this.bb.__offset(this.bb_pos, 6) var offset = this.bb.__offset(this.bb_pos, 6);
if (offset === 0) { if (offset === 0) {
return false; return false;
...@@ -83,7 +83,7 @@ NamespaceA.TableInFirstNS.prototype.mutate_foo_enum = function(value) { ...@@ -83,7 +83,7 @@ NamespaceA.TableInFirstNS.prototype.mutate_foo_enum = function(value) {
this.bb.writeInt8(this.bb_pos + offset, value); this.bb.writeInt8(this.bb_pos + offset, value);
return true; return true;
} };
/** /**
* @param {NamespaceA.NamespaceB.StructInNestedNS=} obj * @param {NamespaceA.NamespaceB.StructInNestedNS=} obj
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment