mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +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
37 lines
413 B
JavaScript
37 lines
413 B
JavaScript
class A {
|
|
constructor() {
|
|
console.log("Hi!");
|
|
}
|
|
}
|
|
|
|
class B {
|
|
constructor(x = console.log("Hi!")) {}
|
|
}
|
|
|
|
class C {
|
|
constructor({ x }) {}
|
|
}
|
|
|
|
class D {
|
|
constructor(x, y, z) {}
|
|
}
|
|
|
|
class E extends A {
|
|
constructor() {}
|
|
}
|
|
|
|
class F {
|
|
constructor() {
|
|
if (PDFJSDev.test('TRUE')) {
|
|
var a = 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
class G {
|
|
constructor() {
|
|
if (PDFJSDev.test('FALSE')) {
|
|
var a = 0;
|
|
}
|
|
}
|
|
}
|