Skip to content

Commit cb98823

Browse files
authored
Merge pull request #170 from Rzial/bugfix/missing-semicolons
Added missing semicolons on generated code
2 parents d96d004 + 931fc39 commit cb98823

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/binary_parser.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -691,9 +691,9 @@ export class Parser {
691691
`var vars = ${this.constructorFn ? 'new constructorFn()' : '{}'};`
692692
);
693693
ctx.pushCode(
694-
`var ctx = Object.assign({$parent: null, $root: vars}, context || {})`
694+
`var ctx = Object.assign({$parent: null, $root: vars}, context || {});`
695695
);
696-
ctx.pushCode(`vars = Object.assign(vars, ctx)`);
696+
ctx.pushCode(`vars = Object.assign(vars, ctx);`);
697697

698698
this.generate(ctx);
699699

@@ -1118,9 +1118,9 @@ export class Parser {
11181118
ctx.pushCode(`${item}.$index = ${length} - ${counter},`);
11191119
}
11201120
type.generate(ctx);
1121-
ctx.pushCode(`delete ${item}.$parent`);
1122-
ctx.pushCode(`delete ${item}.$root`);
1123-
ctx.pushCode(`delete ${item}.$index`);
1121+
ctx.pushCode(`delete ${item}.$parent;`);
1122+
ctx.pushCode(`delete ${item}.$root;`);
1123+
ctx.pushCode(`delete ${item}.$index;`);
11241124
ctx.popScope();
11251125
}
11261126

@@ -1201,8 +1201,8 @@ export class Parser {
12011201
ctx.pushCode('}');
12021202

12031203
if (this.varName) {
1204-
ctx.pushCode(`delete ${nestVar}.$parent`);
1205-
ctx.pushCode(`delete ${nestVar}.$root`);
1204+
ctx.pushCode(`delete ${nestVar}.$parent;`);
1205+
ctx.pushCode(`delete ${nestVar}.$root;`);
12061206
}
12071207
}
12081208

@@ -1220,8 +1220,8 @@ export class Parser {
12201220
this.options.type.generate(ctx);
12211221
ctx.popPath(this.varName);
12221222
if (this.varName) {
1223-
ctx.pushCode(`delete ${nestVar}.$parent`);
1224-
ctx.pushCode(`delete ${nestVar}.$root`);
1223+
ctx.pushCode(`delete ${nestVar}.$parent;`);
1224+
ctx.pushCode(`delete ${nestVar}.$root;`);
12251225
}
12261226
} else if (aliasRegistry[this.options.type]) {
12271227
const parentVar = ctx.generateVariable();
@@ -1338,8 +1338,8 @@ export class Parser {
13381338
ctx.pushPath(this.varName);
13391339
this.options.type.generate(ctx);
13401340
ctx.popPath(this.varName);
1341-
ctx.pushCode(`delete ${nestVar}.$parent`);
1342-
ctx.pushCode(`delete ${nestVar}.$root`);
1341+
ctx.pushCode(`delete ${nestVar}.$parent;`);
1342+
ctx.pushCode(`delete ${nestVar}.$root;`);
13431343
} else if (aliasRegistry[this.options.type]) {
13441344
const parentVar = ctx.generateVariable();
13451345
const tempVar = ctx.generateTmpVariable();

0 commit comments

Comments
 (0)