Skip to content

Commit a362138

Browse files
author
Gleb Ivanov
committed
fixed codestyle in test.ts and reflect.ts to match project codestyle
1 parent 614b008 commit a362138

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/reflect.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ export type ReflectionMap = {
1010
static: StringToArrayMap
1111
}
1212

13-
export function reflectionIsSupported() {
13+
export function reflectionIsSupported () {
1414
return (Reflect && Reflect.defineMetadata) !== undefined
1515
}
1616

17-
export function copyReflectionMetadata(
17+
export function copyReflectionMetadata (
1818
from: VueConstructor,
1919
to: VueConstructor,
2020
reflectionMap: ReflectionMap
@@ -24,7 +24,7 @@ export function copyReflectionMetadata(
2424
shallowCopy(from, to, {'constructor': reflectionMap.constructor})
2525
}
2626

27-
function shallowCopy(from: VueConstructor, to: VueConstructor, propertyKeys: StringToArrayMap) {
27+
function shallowCopy (from: VueConstructor, to: VueConstructor, propertyKeys: StringToArrayMap) {
2828
for (const propertyKey in propertyKeys) {
2929
propertyKeys[propertyKey].forEach((metadataKey) => {
3030
if (propertyKey == 'constructor') {

test/test.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -372,23 +372,27 @@ describe('vue-class-component', () => {
372372
})
373373

374374
it('copies reflection metadata', function () {
375-
const trickyDecorator = (proto: Vue, _: string) =>
376-
Reflect.defineMetadata('worksConstructor', true, proto.constructor)
377-
378375
@Component
376+
@Reflect.metadata('worksConstructor', true)
379377
class Test extends Vue {
380-
@trickyDecorator
381-
trickyCase: string = 'trickyCase'
382-
383378
@Reflect.metadata('worksStatic', true)
384379
static staticValue: string = 'staticValue'
385380

381+
private _test: boolean = false;
382+
386383
@Reflect.metadata('worksMethod', true)
387-
test(): void { }
384+
test (): void {
385+
void 0
386+
}
388387

389388
@Reflect.metadata('worksAccessor', true)
390-
get testAccessor(): boolean { return true }
391-
set testAccessor(value: boolean) { void(value) }
389+
get testAccessor (): boolean {
390+
return this._test
391+
}
392+
393+
set testAccessor (value: boolean) {
394+
this._test = value
395+
}
392396
}
393397

394398
expect(Reflect.getOwnMetadata('worksConstructor', Test)).to.equal(true)

0 commit comments

Comments
 (0)