Files
codeql/javascript/ql/test/query-tests/LanguageFeatures/SpuriousArguments/es2015.js
2018-08-02 17:53:23 +01:00

21 lines
364 B
JavaScript

class Class1 {
constructor(x) { this.x = x; }
}
new Class1(42, 23); // NOT OK: `23` is ignored
class Sup {
constructor(x) { this.x = x; }
}
class Sub extends Sup {
}
new Sub(42); // OK: synthetic constructor delegates to super constructor
class Other {}
new Other(42); // NOT OK: `42` is ignored
var args = [];
f(...args); // OK
f(42, ...args); // NOT OK