diff --git a/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt b/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt index f648f52bb58..d90e6d506ff 100644 --- a/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt +++ b/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt @@ -1,42 +1,29 @@ tests/cases/compiler/weird.js(1,1): error TS2304: Cannot find name 'someFunction'. tests/cases/compiler/weird.js(1,23): error TS7006: Parameter 'BaseClass' implicitly has an 'any' type. -tests/cases/compiler/weird.js(4,17): error TS8009: 'const' can only be used in a .ts file. -tests/cases/compiler/weird.js(4,17): error TS1248: A class member cannot have the 'const' keyword. -tests/cases/compiler/weird.js(5,3): error TS2377: Constructors for derived classes must contain a 'super' call. -tests/cases/compiler/weird.js(6,4): error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. -tests/cases/compiler/weird.js(8,25): error TS7006: Parameter 'error' implicitly has an 'any' type. -tests/cases/compiler/weird.js(9,54): error TS2663: Cannot find name 'DEFAULT_MESSAGE'. Did you mean the instance member 'this.DEFAULT_MESSAGE'? +tests/cases/compiler/weird.js(6,13): error TS2346: Supplied parameters do not match any signature of call target. +tests/cases/compiler/weird.js(9,17): error TS7006: Parameter 'error' implicitly has an 'any' type. -==== tests/cases/compiler/weird.js (8 errors) ==== +==== tests/cases/compiler/weird.js (4 errors) ==== someFunction(function(BaseClass) { ~~~~~~~~~~~~ !!! error TS2304: Cannot find name 'someFunction'. ~~~~~~~~~ !!! error TS7006: Parameter 'BaseClass' implicitly has an 'any' type. - 'use strict'; - class Hello extends BaseClass { - const DEFAULT_MESSAGE = "nop!"; + 'use strict'; + const DEFAULT_MESSAGE = "nop!"; + class Hello extends BaseClass { + constructor() { + super(); + ~~~~~~~ +!!! error TS2346: Supplied parameters do not match any signature of call target. + this.foo = "bar"; + } + _render(error) { ~~~~~ -!!! error TS8009: 'const' can only be used in a .ts file. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1248: A class member cannot have the 'const' keyword. - constructor() { - ~~~~~~~~~~~~~~~ - this.foo = "bar"; - ~~~~~~~~~~~~~~~~~~~~ - ~~~~ -!!! error TS17009: 'super' must be called before accessing 'this' in the constructor of a derived class. - } - ~~~ -!!! error TS2377: Constructors for derived classes must contain a 'super' call. - _render(error) { - ~~~~~ !!! error TS7006: Parameter 'error' implicitly has an 'any' type. - const message = error.message || DEFAULT_MESSAGE; - ~~~~~~~~~~~~~~~ -!!! error TS2663: Cannot find name 'DEFAULT_MESSAGE'. Did you mean the instance member 'this.DEFAULT_MESSAGE'? - } - } + const message = error.message || DEFAULT_MESSAGE; + } + } }); \ No newline at end of file diff --git a/tests/cases/compiler/checkIndexConstraintOfJavascriptClassExpression.ts b/tests/cases/compiler/checkIndexConstraintOfJavascriptClassExpression.ts index 51af2b276a2..58844d98fd8 100644 --- a/tests/cases/compiler/checkIndexConstraintOfJavascriptClassExpression.ts +++ b/tests/cases/compiler/checkIndexConstraintOfJavascriptClassExpression.ts @@ -5,14 +5,15 @@ // @noEmit: true // @out: foo.js someFunction(function(BaseClass) { - 'use strict'; - class Hello extends BaseClass { - const DEFAULT_MESSAGE = "nop!"; - constructor() { - this.foo = "bar"; - } - _render(error) { - const message = error.message || DEFAULT_MESSAGE; - } - } + 'use strict'; + const DEFAULT_MESSAGE = "nop!"; + class Hello extends BaseClass { + constructor() { + super(); + this.foo = "bar"; + } + _render(error) { + const message = error.message || DEFAULT_MESSAGE; + } + } });