xref: /Universal-ctags/Units/parser-javascript.r/js-computed-propname.d/input.js (revision c3f80c4aec9f88d9ba6090584676db49a1c40f22)
1//
2// "node --experimental-modules" accepts this input.
3//
4
5// Computed property names (ES2015)
6var prop = 'foo';
7var x = 'c';
8var y = ['d', 'e'];
9var o = {
10    ['a' + y [0]]: {},
11    ['a']: {},			// Tagging
12    ['a' + 'b']: {},		// Tagging whole    \
13    [x]: {},			// expressions with \
14    ['a' + x]: {},        	// `[' and `]'
15
16};
17
18class Model {
19}
20
21class User extends Model {
22  static get tableName() {
23    return "users"
24  }
25
26  static get ["json-schema"]() {
27    return {
28      type: "object",
29      optional: [
30        "passwordHash",
31        "passwordResetRequestedAt",
32        "passwordResetToken",
33        "verificationToken",
34        "verifiedAt",
35      ]
36    }
37  }
38}
39
40var p = {
41	[(1+2)*3]: {
42		subnum: function (){}
43	},
44};
45