mnemonic101 / irony

A convention based web framework for TypeScript
MIT License
1 stars 1 forks source link

BodyParam() knows no "name" variable but is using one #1

Open datokrat opened 7 years ago

datokrat commented 7 years ago

I just tried to start the disco-node server after upgrading to the last commit of irony, encountering the following error:

[...]/irony/build/lib/system/router/decorators/decorators.js:102
        processDecoratedParameter(target, propertyKey, parameterIndex, enums_1.ParamType.body, name);
                                                                                               ^

ReferenceError: name is not defined
    at [...]/irony/build/lib/system/router/decorators/decorators.js:102:96

This seems logical to me, reviewing this snippet from the decorators.ts:

export function BodyParam() {
  return function (target: Object, propertyKey: string, parameterIndex: number) {
    processDecoratedParameter(target, propertyKey, parameterIndex, ParamType.body, name);
  };
}

In contrast to the other *Param decorators, BodyParam does not expect the "name" parameter but is passing one to processDecoratedParameter. TypeScript does not fail because the name property was defined in some DOM specific typing file...

Should we simply add a name parameter?

mnemonic101 commented 7 years ago

I think I just forgot to push the latest changes, sorry - please pull and try again...

mnemonic101 commented 7 years ago

ok, sorry again - another issue - I need to investigate more... please be patient...

datokrat commented 7 years ago

No problem :o)