Skip to content

Commit bc7f01e

Browse files
Remove validation from compiler
1 parent 056ef1f commit bc7f01e

1 file changed

Lines changed: 0 additions & 32 deletions

File tree

src/compiler.ts

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,6 @@ export class Compiler extends DiagnosticEmitter {
536536

537537
// initialize lookup maps, built-ins, imports, exports, etc.
538538
this.program.initialize();
539-
this.validateParameterDecorators();
540539

541540
// Binaryen treats all function references as being leaked to the outside world when
542541
// the module isn't marked as closed-world (see WebAssembly/binaryen#7135). Therefore,
@@ -10626,37 +10625,6 @@ export class Compiler extends DiagnosticEmitter {
1062610625
this.currentType = toType;
1062710626
return expr;
1062810627
}
10629-
10630-
/** Rejects any parameter decorators not consumed by transforms. Runs once, after transforms have had their chance. */
10631-
private validateParameterDecorators(): void {
10632-
let program = this.program;
10633-
if (program.parameterDecoratorsValidated) return;
10634-
program.parameterDecoratorsValidated = true;
10635-
for (let source of program.sources) {
10636-
let fts = source.decoratedFunctionTypes;
10637-
if (!fts) continue;
10638-
for (let i = 0, k = fts.length; i < k; ++i) {
10639-
let ft = fts[i];
10640-
let thisDecorators = ft.explicitThisDecorators;
10641-
if (thisDecorators && thisDecorators.length > 0) {
10642-
this.error(
10643-
DiagnosticCode.Decorators_are_not_valid_here,
10644-
Range.join(thisDecorators[0].range, thisDecorators[thisDecorators.length - 1].range)
10645-
);
10646-
}
10647-
let params = ft.parameters;
10648-
for (let j = 0, m = params.length; j < m; ++j) {
10649-
let decorators = params[j].decorators;
10650-
if (decorators && decorators.length > 0) {
10651-
this.error(
10652-
DiagnosticCode.Decorators_are_not_valid_here,
10653-
Range.join(decorators[0].range, decorators[decorators.length - 1].range)
10654-
);
10655-
}
10656-
}
10657-
}
10658-
}
10659-
}
1066010628
}
1066110629

1066210630
// helpers

0 commit comments

Comments
 (0)