Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9178a5
commit 2315694
Showing
9 changed files
with
292 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
tests/baselines/reference/checkGrammarStaticMemberName_es5.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
tests/cases/compiler/checkGrammarStaticMemberName_es5.ts(3,5): error TS2696: 'length' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es5.ts(4,5): error TS2696: 'name' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es5.ts(5,5): error TS2696: 'arguments' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es5.ts(6,5): error TS2696: 'caller' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es5.ts(8,9): error TS2696: 'length' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es5.ts(9,9): error TS2696: 'name' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es5.ts(10,9): error TS2696: 'arguments' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es5.ts(11,9): error TS2696: 'caller' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es5.ts(16,12): error TS2696: 'length' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es5.ts(17,12): error TS2696: 'name' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es5.ts(18,12): error TS2696: 'arguments' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es5.ts(19,12): error TS2696: 'caller' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
|
||
|
||
==== tests/cases/compiler/checkGrammarStaticMemberName_es5.ts (12 errors) ==== | ||
|
||
class static_property { | ||
static length = 1; | ||
~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2696: 'length' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
static name = 1; | ||
~~~~~~~~~~~~~~~~ | ||
!!! error TS2696: 'name' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
static arguments = 1; | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2696: 'arguments' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
static caller = 1; | ||
~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2696: 'caller' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
static foo = { | ||
["length"]: 1, | ||
~~~~~~~~~~ | ||
!!! error TS2696: 'length' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
["name"]: 1, | ||
~~~~~~~~ | ||
!!! error TS2696: 'name' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
["arguments"]: 1, | ||
~~~~~~~~~~~~~ | ||
!!! error TS2696: 'arguments' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
["caller"]: 1, | ||
~~~~~~~~~~ | ||
!!! error TS2696: 'caller' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
}; | ||
} | ||
|
||
class static_method { | ||
static length() { return 1; } | ||
~~~~~~ | ||
!!! error TS2696: 'length' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
static name() { return 1; } | ||
~~~~ | ||
!!! error TS2696: 'name' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
static arguments() { return 1; } | ||
~~~~~~~~~ | ||
!!! error TS2696: 'arguments' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
static caller() { return 1; } | ||
~~~~~~ | ||
!!! error TS2696: 'caller' is not allowed to be used as a name of a static property or method in a class for target ES5. | ||
} | ||
|
50 changes: 50 additions & 0 deletions
50
tests/baselines/reference/checkGrammarStaticMemberName_es5.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//// [checkGrammarStaticMemberName_es5.ts] | ||
|
||
class static_property { | ||
static length = 1; | ||
static name = 1; | ||
static arguments = 1; | ||
static caller = 1; | ||
static foo = { | ||
["length"]: 1, | ||
["name"]: 1, | ||
["arguments"]: 1, | ||
["caller"]: 1, | ||
}; | ||
} | ||
|
||
class static_method { | ||
static length() { return 1; } | ||
static name() { return 1; } | ||
static arguments() { return 1; } | ||
static caller() { return 1; } | ||
} | ||
|
||
|
||
//// [checkGrammarStaticMemberName_es5.js] | ||
var static_property = (function () { | ||
function static_property() { | ||
} | ||
static_property.length = 1; | ||
static_property.name = 1; | ||
static_property.arguments = 1; | ||
static_property.caller = 1; | ||
static_property.foo = (_a = {}, | ||
_a["length"] = 1, | ||
_a["name"] = 1, | ||
_a["arguments"] = 1, | ||
_a["caller"] = 1, | ||
_a | ||
); | ||
return static_property; | ||
var _a; | ||
}()); | ||
var static_method = (function () { | ||
function static_method() { | ||
} | ||
static_method.length = function () { return 1; }; | ||
static_method.name = function () { return 1; }; | ||
static_method.arguments = function () { return 1; }; | ||
static_method.caller = function () { return 1; }; | ||
return static_method; | ||
}()); |
48 changes: 48 additions & 0 deletions
48
tests/baselines/reference/checkGrammarStaticMemberName_es6.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
tests/cases/compiler/checkGrammarStaticMemberName_es6.ts(3,5): error TS2697: 'length' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es6.ts(4,5): error TS2697: 'name' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es6.ts(5,5): error TS2697: 'arguments' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es6.ts(6,5): error TS2697: 'caller' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es6.ts(8,9): error TS2697: 'length' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es6.ts(9,9): error TS2697: 'name' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es6.ts(10,9): error TS2697: 'arguments' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
tests/cases/compiler/checkGrammarStaticMemberName_es6.ts(11,9): error TS2697: 'caller' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
|
||
|
||
==== tests/cases/compiler/checkGrammarStaticMemberName_es6.ts (8 errors) ==== | ||
|
||
class static_property { | ||
static length = 1; | ||
~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2697: 'length' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
static name = 1; | ||
~~~~~~~~~~~~~~~~ | ||
!!! error TS2697: 'name' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
static arguments = 1; | ||
~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2697: 'arguments' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
static caller = 1; | ||
~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2697: 'caller' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
static foo = { | ||
["length"]: 1, | ||
~~~~~~~~~~ | ||
!!! error TS2697: 'length' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
["name"]: 1, | ||
~~~~~~~~ | ||
!!! error TS2697: 'name' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
["arguments"]: 1, | ||
~~~~~~~~~~~~~ | ||
!!! error TS2697: 'arguments' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
["caller"]: 1, | ||
~~~~~~~~~~ | ||
!!! error TS2697: 'caller' is not allowed to be used as a name of a static property in a class for target ES6 and higher. | ||
}; | ||
} | ||
|
||
class static_method { | ||
static length() { return 1; } | ||
static name() { return 1; } | ||
static arguments() { return 1; } | ||
static caller() { return 1; } | ||
} | ||
|
42 changes: 42 additions & 0 deletions
42
tests/baselines/reference/checkGrammarStaticMemberName_es6.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//// [checkGrammarStaticMemberName_es6.ts] | ||
|
||
class static_property { | ||
static length = 1; | ||
static name = 1; | ||
static arguments = 1; | ||
static caller = 1; | ||
static foo = { | ||
["length"]: 1, | ||
["name"]: 1, | ||
["arguments"]: 1, | ||
["caller"]: 1, | ||
}; | ||
} | ||
|
||
class static_method { | ||
static length() { return 1; } | ||
static name() { return 1; } | ||
static arguments() { return 1; } | ||
static caller() { return 1; } | ||
} | ||
|
||
|
||
//// [checkGrammarStaticMemberName_es6.js] | ||
class static_property { | ||
} | ||
static_property.length = 1; | ||
static_property.name = 1; | ||
static_property.arguments = 1; | ||
static_property.caller = 1; | ||
static_property.foo = { | ||
["length"]: 1, | ||
["name"]: 1, | ||
["arguments"]: 1, | ||
["caller"]: 1, | ||
}; | ||
class static_method { | ||
static length() { return 1; } | ||
static name() { return 1; } | ||
static arguments() { return 1; } | ||
static caller() { return 1; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// @target: es5 | ||
|
||
class static_property { | ||
static length = 1; | ||
static name = 1; | ||
static arguments = 1; | ||
static caller = 1; | ||
static foo = { | ||
["length"]: 1, | ||
["name"]: 1, | ||
["arguments"]: 1, | ||
["caller"]: 1, | ||
}; | ||
} | ||
|
||
class static_method { | ||
static length() { return 1; } | ||
static name() { return 1; } | ||
static arguments() { return 1; } | ||
static caller() { return 1; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// @target: es6 | ||
|
||
class static_property { | ||
static length = 1; | ||
static name = 1; | ||
static arguments = 1; | ||
static caller = 1; | ||
static foo = { | ||
["length"]: 1, | ||
["name"]: 1, | ||
["arguments"]: 1, | ||
["caller"]: 1, | ||
}; | ||
} | ||
|
||
class static_method { | ||
static length() { return 1; } | ||
static name() { return 1; } | ||
static arguments() { return 1; } | ||
static caller() { return 1; } | ||
} |