function dec(set, context) {
  context.addInitializer((instance) => {
    instance[context.name + 'Context'] = context;
  });

  return function (v) {
    return set.call(this, v + 1);
  }
}

class Foo {
  static value = 1;

  @dec
  static set a(v) {
    return this.value = v;
  }

  @dec
  static set ['b'](v) {
    return this.value = v;
  }
}

const aContext = Foo['aContext'];
const bContext = Foo['bContext'];


expect(Foo.value).toBe(1);
Foo.a = 123;
expect(Foo.value).toBe(124);
Foo.a = 456;
expect(Foo.value).toBe(457);

expect(aContext.name).toBe('a');
expect(aContext.kind).toBe('setter');
expect(aContext.isStatic).toBe(true);
expect(aContext.isPrivate).toBe(false);
expect(typeof aContext.addInitializer).toBe('function');
expect(typeof aContext.setMetadata).toBe('function');
expect(typeof aContext.getMetadata).toBe('function');

expect(bContext.name).toBe('b');
expect(bContext.kind).toBe('setter');
expect(bContext.isStatic).toBe(true);
expect(bContext.isPrivate).toBe(false);
expect(typeof bContext.addInitializer).toBe('function');
expect(typeof bContext.setMetadata).toBe('function');
expect(typeof bContext.getMetadata).toBe('function');
