mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-28 23:28:16 +02:00
This only happens when it's safe to do so. The exceptions are: - when the class extends another subclass: removing the constructor would remove the error about the missing super() call - when there are default parameters, that could have side effects - when there are destructured prameters, that could have side effects
23 lines
265 B
JavaScript
23 lines
265 B
JavaScript
class A {
|
|
constructor() {
|
|
console.log("Hi!");
|
|
}
|
|
}
|
|
class B {
|
|
constructor(x = console.log("Hi!")) {}
|
|
}
|
|
class C {
|
|
constructor({
|
|
x
|
|
}) {}
|
|
}
|
|
class D {}
|
|
class E extends A {
|
|
constructor() {}
|
|
}
|
|
class F {
|
|
constructor() {
|
|
var a = 0;
|
|
}
|
|
}
|
|
class G {}
|