mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
34 lines
664 B
TypeScript
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
|