mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 10:41:56 -05:00
Emit tests for computed properties
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
// @target: es6
|
||||
var v = {
|
||||
get [0 + 1]() { return 0 },
|
||||
set [0 + 1](v) { }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// @target: es6
|
||||
var methodName = "method";
|
||||
var accessorName = "accessor";
|
||||
class C {
|
||||
[methodName]() { }
|
||||
static [methodName]() { }
|
||||
get [accessorName]() { }
|
||||
set [accessorName](v) { }
|
||||
static get [accessorName]() { }
|
||||
static set [accessorName](v) { }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// @target: es6
|
||||
var id;
|
||||
class C {
|
||||
[0 + 1]() { }
|
||||
static [() => { }]() { }
|
||||
get [delete id]() { }
|
||||
set [[0, 1]](v) { }
|
||||
static get [<String>""]() { }
|
||||
static set [id.toString()](v) { }
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// @target: es6
|
||||
var methodName = "method";
|
||||
var accessorName = "accessor";
|
||||
class C {
|
||||
[methodName](v: string);
|
||||
[methodName]();
|
||||
[methodName](v?: string) { }
|
||||
}
|
||||
Reference in New Issue
Block a user