You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if this is a bug, or I'm missing something.
I am compiling my TypeScript to ES6 and then using the babel preprocessor to run my tests in Karma. The class is as follows
import{BaseModel,notEmpty}from'../main';exportclassTestModelextendsBaseModel{
@notEmpty('Test property can not be empty')publictestProperty: string;}
The above class compiles to
if(typeof__decorate!=="function")__decorate=function(decorators,target,key,desc){if(typeofReflect==="object"&&typeofReflect.decorate==="function")returnReflect.decorate(decorators,target,key,desc);switch(arguments.length){case2: returndecorators.reduceRight(function(o,d){return(d&&d(o))||o;},target);case3: returndecorators.reduceRight(function(o,d){return(d&&d(target,key)),void0;},void0);case4: returndecorators.reduceRight(function(o,d){return(d&&d(target,key,o))||o;},desc);}};import{BaseModel,notEmpty}from'../main';exportclassTestModelextendsBaseModel{}__decorate([notEmpty('Test property can not be empty')],TestModel.prototype,"testProperty");
This compiled code doesn't run. Unfortunately I don't get a helpful error either so I'm not exactly sure the problem. However if I mess with the compiled JavaScript a bit
// changing the first line from ...if(typeof__decorate!=="function")__decorate=function(decorators,target,key,desc){// code here}// to thisif(typeof__decorate!=="function")window.__decorate=function(decorators,target,key,desc){// code here}// or to this, which would work in both browser and server environmentsif(typeof__decorate!=="function")var__decorate=function(decorators,target,key,desc){// code here}
with either of those changes everything seems to work fine. Like I said though, I'm not sure if its a bug or I'm missing some small thing.
The text was updated successfully, but these errors were encountered:
I'm not sure if this is a bug, or I'm missing something.
I am compiling my TypeScript to ES6 and then using the babel preprocessor to run my tests in Karma. The class is as follows
The above class compiles to
This compiled code doesn't run. Unfortunately I don't get a helpful error either so I'm not exactly sure the problem. However if I mess with the compiled JavaScript a bit
with either of those changes everything seems to work fine. Like I said though, I'm not sure if its a bug or I'm missing some small thing.
The text was updated successfully, but these errors were encountered: