Removing es6 method/property distinction.
Adding tests with default export and anonymous class expressions.
This commit is contained in:
parent
66263b3782
commit
4718efd181
293
tests/baselines/reference/staticPropertyNameConflicts.errors.txt
Normal file
293
tests/baselines/reference/staticPropertyNameConflicts.errors.txt
Normal file
|
@ -0,0 +1,293 @@
|
|||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(3,12): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticName'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(8,12): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticNameFn'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(14,12): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLength'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(19,12): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLengthFn'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(25,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototype'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(30,12): error TS2300: Duplicate identifier 'prototype'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(30,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototypeFn'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(36,12): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCaller'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(41,12): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCallerFn'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(47,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArguments'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(52,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArgumentsFn'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(62,12): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function '(Anonymous class)'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(67,12): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function '(Anonymous class)'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(73,12): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function '(Anonymous class)'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(78,12): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function '(Anonymous class)'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(84,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function '(Anonymous class)'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(89,12): error TS2300: Duplicate identifier 'prototype'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(89,12): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function '(Anonymous class)'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(95,12): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function '(Anonymous class)'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(100,12): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function '(Anonymous class)'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(106,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function '(Anonymous class)'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(111,12): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function '(Anonymous class)'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(121,16): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticName'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(128,16): error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticNameFn'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(136,16): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLength'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(143,16): error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLengthFn'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(151,16): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototype'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(158,16): error TS2300: Duplicate identifier 'prototype'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(158,16): error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototypeFn'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(166,16): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCaller'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(173,16): error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCallerFn'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(181,16): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArguments'.
|
||||
tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts(188,16): error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArgumentsFn'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflicts.ts (33 errors) ====
|
||||
// name
|
||||
class StaticName {
|
||||
static name: number; // error
|
||||
~~~~
|
||||
!!! error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticName'.
|
||||
name: string; // ok
|
||||
}
|
||||
|
||||
class StaticNameFn {
|
||||
static name() {} // error
|
||||
~~~~
|
||||
!!! error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticNameFn'.
|
||||
name() {} // ok
|
||||
}
|
||||
|
||||
// length
|
||||
class StaticLength {
|
||||
static length: number; // error
|
||||
~~~~~~
|
||||
!!! error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLength'.
|
||||
length: string; // ok
|
||||
}
|
||||
|
||||
class StaticLengthFn {
|
||||
static length() {} // error
|
||||
~~~~~~
|
||||
!!! error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLengthFn'.
|
||||
length() {} // ok
|
||||
}
|
||||
|
||||
// prototype
|
||||
class StaticPrototype {
|
||||
static prototype: number; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototype'.
|
||||
prototype: string; // ok
|
||||
}
|
||||
|
||||
class StaticPrototypeFn {
|
||||
static prototype() {} // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'prototype'.
|
||||
~~~~~~~~~
|
||||
!!! error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototypeFn'.
|
||||
prototype() {} // ok
|
||||
}
|
||||
|
||||
// caller
|
||||
class StaticCaller {
|
||||
static caller: number; // error
|
||||
~~~~~~
|
||||
!!! error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCaller'.
|
||||
caller: string; // ok
|
||||
}
|
||||
|
||||
class StaticCallerFn {
|
||||
static caller() {} // error
|
||||
~~~~~~
|
||||
!!! error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCallerFn'.
|
||||
caller() {} // ok
|
||||
}
|
||||
|
||||
// arguments
|
||||
class StaticArguments {
|
||||
static arguments: number; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArguments'.
|
||||
arguments: string; // ok
|
||||
}
|
||||
|
||||
class StaticArgumentsFn {
|
||||
static arguments() {} // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArgumentsFn'.
|
||||
arguments() {} // ok
|
||||
}
|
||||
|
||||
|
||||
|
||||
// === Static properties on anonymous classes ===
|
||||
|
||||
// name
|
||||
var StaticName_Anonymous = class {
|
||||
static name: number; // error
|
||||
~~~~
|
||||
!!! error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function '(Anonymous class)'.
|
||||
name: string; // ok
|
||||
}
|
||||
|
||||
var StaticNameFn_Anonymous = class {
|
||||
static name() {} // error
|
||||
~~~~
|
||||
!!! error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function '(Anonymous class)'.
|
||||
name() {} // ok
|
||||
}
|
||||
|
||||
// length
|
||||
var StaticLength_Anonymous = class {
|
||||
static length: number; // error
|
||||
~~~~~~
|
||||
!!! error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function '(Anonymous class)'.
|
||||
length: string; // ok
|
||||
}
|
||||
|
||||
var StaticLengthFn_Anonymous = class {
|
||||
static length() {} // error
|
||||
~~~~~~
|
||||
!!! error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function '(Anonymous class)'.
|
||||
length() {} // ok
|
||||
}
|
||||
|
||||
// prototype
|
||||
var StaticPrototype_Anonymous = class {
|
||||
static prototype: number; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function '(Anonymous class)'.
|
||||
prototype: string; // ok
|
||||
}
|
||||
|
||||
var StaticPrototypeFn_Anonymous = class {
|
||||
static prototype() {} // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'prototype'.
|
||||
~~~~~~~~~
|
||||
!!! error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function '(Anonymous class)'.
|
||||
prototype() {} // ok
|
||||
}
|
||||
|
||||
// caller
|
||||
var StaticCaller_Anonymous = class {
|
||||
static caller: number; // error
|
||||
~~~~~~
|
||||
!!! error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function '(Anonymous class)'.
|
||||
caller: string; // ok
|
||||
}
|
||||
|
||||
var StaticCallerFn_Anonymous = class {
|
||||
static caller() {} // error
|
||||
~~~~~~
|
||||
!!! error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function '(Anonymous class)'.
|
||||
caller() {} // ok
|
||||
}
|
||||
|
||||
// arguments
|
||||
var StaticArguments_Anonymous = class {
|
||||
static arguments: number; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function '(Anonymous class)'.
|
||||
arguments: string; // ok
|
||||
}
|
||||
|
||||
var StaticArgumentsFn_Anonymous = class {
|
||||
static arguments() {} // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function '(Anonymous class)'.
|
||||
arguments() {} // ok
|
||||
}
|
||||
|
||||
|
||||
// === Static properties on default exported classes ===
|
||||
|
||||
// name
|
||||
module TestOnDefaultExportedClass_1 {
|
||||
class StaticName {
|
||||
static name: number; // error
|
||||
~~~~
|
||||
!!! error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticName'.
|
||||
name: string; // ok
|
||||
}
|
||||
}
|
||||
|
||||
module TestOnDefaultExportedClass_2 {
|
||||
class StaticNameFn {
|
||||
static name() {} // error
|
||||
~~~~
|
||||
!!! error TS2699: Static property 'name' conflicts with built-in property 'Function.name' of constructor function 'StaticNameFn'.
|
||||
name() {} // ok
|
||||
}
|
||||
}
|
||||
|
||||
// length
|
||||
module TestOnDefaultExportedClass_3 {
|
||||
export default class StaticLength {
|
||||
static length: number; // error
|
||||
~~~~~~
|
||||
!!! error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLength'.
|
||||
length: string; // ok
|
||||
}
|
||||
}
|
||||
|
||||
module TestOnDefaultExportedClass_4 {
|
||||
export default class StaticLengthFn {
|
||||
static length() {} // error
|
||||
~~~~~~
|
||||
!!! error TS2699: Static property 'length' conflicts with built-in property 'Function.length' of constructor function 'StaticLengthFn'.
|
||||
length() {} // ok
|
||||
}
|
||||
}
|
||||
|
||||
// prototype
|
||||
module TestOnDefaultExportedClass_5 {
|
||||
export default class StaticPrototype {
|
||||
static prototype: number; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototype'.
|
||||
prototype: string; // ok
|
||||
}
|
||||
}
|
||||
|
||||
module TestOnDefaultExportedClass_6 {
|
||||
export default class StaticPrototypeFn {
|
||||
static prototype() {} // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'prototype'.
|
||||
~~~~~~~~~
|
||||
!!! error TS2699: Static property 'prototype' conflicts with built-in property 'Function.prototype' of constructor function 'StaticPrototypeFn'.
|
||||
prototype() {} // ok
|
||||
}
|
||||
}
|
||||
|
||||
// caller
|
||||
module TestOnDefaultExportedClass_7 {
|
||||
export default class StaticCaller {
|
||||
static caller: number; // error
|
||||
~~~~~~
|
||||
!!! error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCaller'.
|
||||
caller: string; // ok
|
||||
}
|
||||
}
|
||||
|
||||
module TestOnDefaultExportedClass_8 {
|
||||
export default class StaticCallerFn {
|
||||
static caller() {} // error
|
||||
~~~~~~
|
||||
!!! error TS2699: Static property 'caller' conflicts with built-in property 'Function.caller' of constructor function 'StaticCallerFn'.
|
||||
caller() {} // ok
|
||||
}
|
||||
}
|
||||
|
||||
// arguments
|
||||
module TestOnDefaultExportedClass_9 {
|
||||
export default class StaticArguments {
|
||||
static arguments: number; // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArguments'.
|
||||
arguments: string; // ok
|
||||
}
|
||||
}
|
||||
|
||||
module TestOnDefaultExportedClass_10 {
|
||||
export default class StaticArgumentsFn {
|
||||
static arguments() {} // error
|
||||
~~~~~~~~~
|
||||
!!! error TS2699: Static property 'arguments' conflicts with built-in property 'Function.arguments' of constructor function 'StaticArgumentsFn'.
|
||||
arguments() {} // ok
|
||||
}
|
||||
}
|
429
tests/baselines/reference/staticPropertyNameConflicts.js
Normal file
429
tests/baselines/reference/staticPropertyNameConflicts.js
Normal file
|
@ -0,0 +1,429 @@
|
|||
//// [staticPropertyNameConflicts.ts]
|
||||
// name
|
||||
class StaticName {
|
||||
static name: number; // error
|
||||
name: string; // ok
|
||||
}
|
||||
|
||||
class StaticNameFn {
|
||||
static name() {} // error
|
||||
name() {} // ok
|
||||
}
|
||||
|
||||
// length
|
||||
class StaticLength {
|
||||
static length: number; // error
|
||||
length: string; // ok
|
||||
}
|
||||
|
||||
class StaticLengthFn {
|
||||
static length() {} // error
|
||||
length() {} // ok
|
||||
}
|
||||
|
||||
// prototype
|
||||
class StaticPrototype {
|
||||
static prototype: number; // error
|
||||
prototype: string; // ok
|
||||
}
|
||||
|
||||
class StaticPrototypeFn {
|
||||
static prototype() {} // error
|
||||
prototype() {} // ok
|
||||
}
|
||||
|
||||
// caller
|
||||
class StaticCaller {
|
||||
static caller: number; // error
|
||||
caller: string; // ok
|
||||
}
|
||||
|
||||
class StaticCallerFn {
|
||||
static caller() {} // error
|
||||
caller() {} // ok
|
||||
}
|
||||
|
||||
// arguments
|
||||
class StaticArguments {
|
||||
static arguments: number; // error
|
||||
arguments: string; // ok
|
||||
}
|
||||
|
||||
class StaticArgumentsFn {
|
||||
static arguments() {} // error
|
||||
arguments() {} // ok
|
||||
}
|
||||
|
||||
|
||||
|
||||
// === Static properties on anonymous classes ===
|
||||
|
||||
// name
|
||||
var StaticName_Anonymous = class {
|
||||
static name: number; // error
|
||||
name: string; // ok
|
||||
}
|
||||
|
||||
var StaticNameFn_Anonymous = class {
|
||||
static name() {} // error
|
||||
name() {} // ok
|
||||
}
|
||||
|
||||
// length
|
||||
var StaticLength_Anonymous = class {
|
||||
static length: number; // error
|
||||
length: string; // ok
|
||||
}
|
||||
|
||||
var StaticLengthFn_Anonymous = class {
|
||||
static length() {} // error
|
||||
length() {} // ok
|
||||
}
|
||||
|
||||
// prototype
|
||||
var StaticPrototype_Anonymous = class {
|
||||
static prototype: number; // error
|
||||
prototype: string; // ok
|
||||
}
|
||||
|
||||
var StaticPrototypeFn_Anonymous = class {
|
||||
static prototype() {} // error
|
||||
prototype() {} // ok
|
||||
}
|
||||
|
||||
// caller
|
||||
var StaticCaller_Anonymous = class {
|
||||
static caller: number; // error
|
||||
caller: string; // ok
|
||||
}
|
||||
|
||||
var StaticCallerFn_Anonymous = class {
|
||||
static caller() {} // error
|
||||
caller() {} // ok
|
||||
}
|
||||
|
||||
// arguments
|
||||
var StaticArguments_Anonymous = class {
|
||||
static arguments: number; // error
|
||||
arguments: string; // ok
|
||||
}
|
||||
|
||||
var StaticArgumentsFn_Anonymous = class {
|
||||
static arguments() {} // error
|
||||
arguments() {} // ok
|
||||
}
|
||||
|
||||
|
||||
// === Static properties on default exported classes ===
|
||||
|
||||
// name
|
||||
module TestOnDefaultExportedClass_1 {
|
||||
class StaticName {
|
||||
static name: number; // error
|
||||
name: string; // ok
|
||||
}
|
||||
}
|
||||
|
||||
module TestOnDefaultExportedClass_2 {
|
||||
class StaticNameFn {
|
||||
static name() {} // error
|
||||
name() {} // ok
|
||||
}
|
||||
}
|
||||
|
||||
// length
|
||||
module TestOnDefaultExportedClass_3 {
|
||||
export default class StaticLength {
|
||||
static length: number; // error
|
||||
length: string; // ok
|
||||
}
|
||||
}
|
||||
|
||||
module TestOnDefaultExportedClass_4 {
|
||||
export default class StaticLengthFn {
|
||||
static length() {} // error
|
||||
length() {} // ok
|
||||
}
|
||||
}
|
||||
|
||||
// prototype
|
||||
module TestOnDefaultExportedClass_5 {
|
||||
export default class StaticPrototype {
|
||||
static prototype: number; // error
|
||||
prototype: string; // ok
|
||||
}
|
||||
}
|
||||
|
||||
module TestOnDefaultExportedClass_6 {
|
||||
export default class StaticPrototypeFn {
|
||||
static prototype() {} // error
|
||||
prototype() {} // ok
|
||||
}
|
||||
}
|
||||
|
||||
// caller
|
||||
module TestOnDefaultExportedClass_7 {
|
||||
export default class StaticCaller {
|
||||
static caller: number; // error
|
||||
caller: string; // ok
|
||||
}
|
||||
}
|
||||
|
||||
module TestOnDefaultExportedClass_8 {
|
||||
export default class StaticCallerFn {
|
||||
static caller() {} // error
|
||||
caller() {} // ok
|
||||
}
|
||||
}
|
||||
|
||||
// arguments
|
||||
module TestOnDefaultExportedClass_9 {
|
||||
export default class StaticArguments {
|
||||
static arguments: number; // error
|
||||
arguments: string; // ok
|
||||
}
|
||||
}
|
||||
|
||||
module TestOnDefaultExportedClass_10 {
|
||||
export default class StaticArgumentsFn {
|
||||
static arguments() {} // error
|
||||
arguments() {} // ok
|
||||
}
|
||||
}
|
||||
|
||||
//// [staticPropertyNameConflicts.js]
|
||||
// name
|
||||
var StaticName = (function () {
|
||||
function StaticName() {
|
||||
}
|
||||
return StaticName;
|
||||
}());
|
||||
var StaticNameFn = (function () {
|
||||
function StaticNameFn() {
|
||||
}
|
||||
StaticNameFn.name = function () { }; // error
|
||||
StaticNameFn.prototype.name = function () { }; // ok
|
||||
return StaticNameFn;
|
||||
}());
|
||||
// length
|
||||
var StaticLength = (function () {
|
||||
function StaticLength() {
|
||||
}
|
||||
return StaticLength;
|
||||
}());
|
||||
var StaticLengthFn = (function () {
|
||||
function StaticLengthFn() {
|
||||
}
|
||||
StaticLengthFn.length = function () { }; // error
|
||||
StaticLengthFn.prototype.length = function () { }; // ok
|
||||
return StaticLengthFn;
|
||||
}());
|
||||
// prototype
|
||||
var StaticPrototype = (function () {
|
||||
function StaticPrototype() {
|
||||
}
|
||||
return StaticPrototype;
|
||||
}());
|
||||
var StaticPrototypeFn = (function () {
|
||||
function StaticPrototypeFn() {
|
||||
}
|
||||
StaticPrototypeFn.prototype = function () { }; // error
|
||||
StaticPrototypeFn.prototype.prototype = function () { }; // ok
|
||||
return StaticPrototypeFn;
|
||||
}());
|
||||
// caller
|
||||
var StaticCaller = (function () {
|
||||
function StaticCaller() {
|
||||
}
|
||||
return StaticCaller;
|
||||
}());
|
||||
var StaticCallerFn = (function () {
|
||||
function StaticCallerFn() {
|
||||
}
|
||||
StaticCallerFn.caller = function () { }; // error
|
||||
StaticCallerFn.prototype.caller = function () { }; // ok
|
||||
return StaticCallerFn;
|
||||
}());
|
||||
// arguments
|
||||
var StaticArguments = (function () {
|
||||
function StaticArguments() {
|
||||
}
|
||||
return StaticArguments;
|
||||
}());
|
||||
var StaticArgumentsFn = (function () {
|
||||
function StaticArgumentsFn() {
|
||||
}
|
||||
StaticArgumentsFn.arguments = function () { }; // error
|
||||
StaticArgumentsFn.prototype.arguments = function () { }; // ok
|
||||
return StaticArgumentsFn;
|
||||
}());
|
||||
// === Static properties on anonymous classes ===
|
||||
// name
|
||||
var StaticName_Anonymous = (function () {
|
||||
function class_1() {
|
||||
}
|
||||
return class_1;
|
||||
}());
|
||||
var StaticNameFn_Anonymous = (function () {
|
||||
function class_2() {
|
||||
}
|
||||
class_2.name = function () { }; // error
|
||||
class_2.prototype.name = function () { }; // ok
|
||||
return class_2;
|
||||
}());
|
||||
// length
|
||||
var StaticLength_Anonymous = (function () {
|
||||
function class_3() {
|
||||
}
|
||||
return class_3;
|
||||
}());
|
||||
var StaticLengthFn_Anonymous = (function () {
|
||||
function class_4() {
|
||||
}
|
||||
class_4.length = function () { }; // error
|
||||
class_4.prototype.length = function () { }; // ok
|
||||
return class_4;
|
||||
}());
|
||||
// prototype
|
||||
var StaticPrototype_Anonymous = (function () {
|
||||
function class_5() {
|
||||
}
|
||||
return class_5;
|
||||
}());
|
||||
var StaticPrototypeFn_Anonymous = (function () {
|
||||
function class_6() {
|
||||
}
|
||||
class_6.prototype = function () { }; // error
|
||||
class_6.prototype.prototype = function () { }; // ok
|
||||
return class_6;
|
||||
}());
|
||||
// caller
|
||||
var StaticCaller_Anonymous = (function () {
|
||||
function class_7() {
|
||||
}
|
||||
return class_7;
|
||||
}());
|
||||
var StaticCallerFn_Anonymous = (function () {
|
||||
function class_8() {
|
||||
}
|
||||
class_8.caller = function () { }; // error
|
||||
class_8.prototype.caller = function () { }; // ok
|
||||
return class_8;
|
||||
}());
|
||||
// arguments
|
||||
var StaticArguments_Anonymous = (function () {
|
||||
function class_9() {
|
||||
}
|
||||
return class_9;
|
||||
}());
|
||||
var StaticArgumentsFn_Anonymous = (function () {
|
||||
function class_10() {
|
||||
}
|
||||
class_10.arguments = function () { }; // error
|
||||
class_10.prototype.arguments = function () { }; // ok
|
||||
return class_10;
|
||||
}());
|
||||
// === Static properties on default exported classes ===
|
||||
// name
|
||||
var TestOnDefaultExportedClass_1;
|
||||
(function (TestOnDefaultExportedClass_1) {
|
||||
var StaticName = (function () {
|
||||
function StaticName() {
|
||||
}
|
||||
return StaticName;
|
||||
}());
|
||||
})(TestOnDefaultExportedClass_1 || (TestOnDefaultExportedClass_1 = {}));
|
||||
var TestOnDefaultExportedClass_2;
|
||||
(function (TestOnDefaultExportedClass_2) {
|
||||
var StaticNameFn = (function () {
|
||||
function StaticNameFn() {
|
||||
}
|
||||
StaticNameFn.name = function () { }; // error
|
||||
StaticNameFn.prototype.name = function () { }; // ok
|
||||
return StaticNameFn;
|
||||
}());
|
||||
})(TestOnDefaultExportedClass_2 || (TestOnDefaultExportedClass_2 = {}));
|
||||
// length
|
||||
var TestOnDefaultExportedClass_3;
|
||||
(function (TestOnDefaultExportedClass_3) {
|
||||
var StaticLength = (function () {
|
||||
function StaticLength() {
|
||||
}
|
||||
return StaticLength;
|
||||
}());
|
||||
TestOnDefaultExportedClass_3.StaticLength = StaticLength;
|
||||
})(TestOnDefaultExportedClass_3 || (TestOnDefaultExportedClass_3 = {}));
|
||||
var TestOnDefaultExportedClass_4;
|
||||
(function (TestOnDefaultExportedClass_4) {
|
||||
var StaticLengthFn = (function () {
|
||||
function StaticLengthFn() {
|
||||
}
|
||||
StaticLengthFn.length = function () { }; // error
|
||||
StaticLengthFn.prototype.length = function () { }; // ok
|
||||
return StaticLengthFn;
|
||||
}());
|
||||
TestOnDefaultExportedClass_4.StaticLengthFn = StaticLengthFn;
|
||||
})(TestOnDefaultExportedClass_4 || (TestOnDefaultExportedClass_4 = {}));
|
||||
// prototype
|
||||
var TestOnDefaultExportedClass_5;
|
||||
(function (TestOnDefaultExportedClass_5) {
|
||||
var StaticPrototype = (function () {
|
||||
function StaticPrototype() {
|
||||
}
|
||||
return StaticPrototype;
|
||||
}());
|
||||
TestOnDefaultExportedClass_5.StaticPrototype = StaticPrototype;
|
||||
})(TestOnDefaultExportedClass_5 || (TestOnDefaultExportedClass_5 = {}));
|
||||
var TestOnDefaultExportedClass_6;
|
||||
(function (TestOnDefaultExportedClass_6) {
|
||||
var StaticPrototypeFn = (function () {
|
||||
function StaticPrototypeFn() {
|
||||
}
|
||||
StaticPrototypeFn.prototype = function () { }; // error
|
||||
StaticPrototypeFn.prototype.prototype = function () { }; // ok
|
||||
return StaticPrototypeFn;
|
||||
}());
|
||||
TestOnDefaultExportedClass_6.StaticPrototypeFn = StaticPrototypeFn;
|
||||
})(TestOnDefaultExportedClass_6 || (TestOnDefaultExportedClass_6 = {}));
|
||||
// caller
|
||||
var TestOnDefaultExportedClass_7;
|
||||
(function (TestOnDefaultExportedClass_7) {
|
||||
var StaticCaller = (function () {
|
||||
function StaticCaller() {
|
||||
}
|
||||
return StaticCaller;
|
||||
}());
|
||||
TestOnDefaultExportedClass_7.StaticCaller = StaticCaller;
|
||||
})(TestOnDefaultExportedClass_7 || (TestOnDefaultExportedClass_7 = {}));
|
||||
var TestOnDefaultExportedClass_8;
|
||||
(function (TestOnDefaultExportedClass_8) {
|
||||
var StaticCallerFn = (function () {
|
||||
function StaticCallerFn() {
|
||||
}
|
||||
StaticCallerFn.caller = function () { }; // error
|
||||
StaticCallerFn.prototype.caller = function () { }; // ok
|
||||
return StaticCallerFn;
|
||||
}());
|
||||
TestOnDefaultExportedClass_8.StaticCallerFn = StaticCallerFn;
|
||||
})(TestOnDefaultExportedClass_8 || (TestOnDefaultExportedClass_8 = {}));
|
||||
// arguments
|
||||
var TestOnDefaultExportedClass_9;
|
||||
(function (TestOnDefaultExportedClass_9) {
|
||||
var StaticArguments = (function () {
|
||||
function StaticArguments() {
|
||||
}
|
||||
return StaticArguments;
|
||||
}());
|
||||
TestOnDefaultExportedClass_9.StaticArguments = StaticArguments;
|
||||
})(TestOnDefaultExportedClass_9 || (TestOnDefaultExportedClass_9 = {}));
|
||||
var TestOnDefaultExportedClass_10;
|
||||
(function (TestOnDefaultExportedClass_10) {
|
||||
var StaticArgumentsFn = (function () {
|
||||
function StaticArgumentsFn() {
|
||||
}
|
||||
StaticArgumentsFn.arguments = function () { }; // error
|
||||
StaticArgumentsFn.prototype.arguments = function () { }; // ok
|
||||
return StaticArgumentsFn;
|
||||
}());
|
||||
TestOnDefaultExportedClass_10.StaticArgumentsFn = StaticArgumentsFn;
|
||||
})(TestOnDefaultExportedClass_10 || (TestOnDefaultExportedClass_10 = {}));
|
|
@ -1,56 +0,0 @@
|
|||
// @target: es6
|
||||
|
||||
|
||||
class StaticName {
|
||||
static name: number; // error
|
||||
name: string; // ok
|
||||
}
|
||||
|
||||
class StaticNameFn {
|
||||
static name() {} // ok
|
||||
name() {} // ok
|
||||
}
|
||||
|
||||
|
||||
class StaticLength {
|
||||
static length: number; // error
|
||||
length: string; // ok
|
||||
}
|
||||
|
||||
class StaticLengthFn {
|
||||
static length() {} // ok
|
||||
length() {} // ok
|
||||
}
|
||||
|
||||
|
||||
class StaticPrototype {
|
||||
static prototype: number; // error
|
||||
prototype: string; // ok
|
||||
}
|
||||
|
||||
class StaticPrototypeFn {
|
||||
static prototype() {} // error
|
||||
prototype() {} // ok
|
||||
}
|
||||
|
||||
|
||||
class StaticCaller {
|
||||
static caller: number; // error
|
||||
caller: string; // ok
|
||||
}
|
||||
|
||||
class StaticCallerFn {
|
||||
static caller() {} // ok
|
||||
caller() {} // ok
|
||||
}
|
||||
|
||||
|
||||
class StaticArguments {
|
||||
static arguments: number; // error
|
||||
arguments: string; // ok
|
||||
}
|
||||
|
||||
class StaticArgumentsFn {
|
||||
static arguments() {} // ok
|
||||
arguments() {} // ok
|
||||
}
|
Loading…
Reference in a new issue