Files
tsgo/testdata/baselines/reference/submodule/conformance/classConstructorParametersAccessibility3.js

34 lines
664 B
TypeScript

//// [tests/cases/conformance/classes/constructorDeclarations/classConstructorParametersAccessibility3.ts] ////
//// [classConstructorParametersAccessibility3.ts]
class Base {
constructor(protected p: number) { }
}
class Derived extends Base {
constructor(public p: number) {
super(p);
this.p; // OK
}
}
var d: Derived;
d.p; // public, OK
//// [classConstructorParametersAccessibility3.js]
"use strict";
class Base {
constructor(p) {
this.p = p;
}
}
class Derived extends Base {
constructor(p) {
super(p);
this.p = p;
this.p; // OK
}
}
var d;
d.p; // public, OK