microsoft / microsoft/TypeScript
super reference in private method throws
Aperta
@rbuckton ci sta già lavorando.
Dal 9/6/2021.
Bug
Domain: classes
Rescheduled
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
Bug Report
🔎 Search Terms
private, super
🕗 Version & Regression Information
v4.3.2, also tested with nightly in playground
works with ESNext setting (which just strips out the types), Babel, V8
⏯ Playground Link
💻 Code
class A {
test() {
return 'test'
}
}
class B extends A {
#foo() {
return super.test()
}
bar() {
return this.#foo()
}
}
const b = new B().bar()
console.log(b)
// [ERR]: "Executed JavaScript Failed:"
// [ERR]: 'super' keyword unexpected here
🙁 Actual behavior
throws error
🙂 Expected behavior
prints 'test'
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Valutazione
Questa issue non è ancora stata valutata.