TypeScript/tests/baselines/reference/argumentsReferenceInConstructor4_Js.errors.txt
Nathan Shively-Sanders 868c275fdf
Plain JS binder errors (#46816)
* Plain JS binder errors

Issue select errors from the binder in JS files that do not have checkJS
explicitly turned on or off. These errors mirror runtime checks done by
Javascript.

* Rest of plain JS binder errors

* address PR comments

* Only issue binder errors in plain JS.

Checker errors require requesting diagnostics, which stll needs to be
peformance tested.

This commit removes one cross-file duplicate declaration error in the tests.

* fix const lint
2021-11-18 17:13:06 -08:00

46 lines
1.2 KiB
Plaintext

/a.js(18,9): error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
==== /a.js (1 errors) ====
class A {
/**
* Constructor
*
* @param {object} [foo={}]
*/
constructor(foo = {}) {
const key = "bar";
/**
* @type object
*/
this.foo = foo;
/**
* @type object
*/
const arguments = this.arguments;
~~~~~~~~~
!!! error TS1210: Code contained in a class is evaluated in JavaScript's strict mode which does not allow this use of 'arguments'. For more information, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode.
/**
* @type object
*/
this.bar = arguments.bar;
/**
* @type object
*/
this.baz = arguments[key];
/**
* @type object
*/
this.options = arguments;
}
get arguments() {
return { bar: {} };
}
}