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
exportinterfaceIValidationError{message: string;}exportdefaultclassOperation{validateParameters(parameterValues: any) : IValidationError[]|null{letresult: IValidationError[]|null=null;for(constparameterLocationofObject.keys(parameterValues)){constparameter: any=(thisasany).getParameter();;constvalues=(thisasany).getValues();constinnerResult=parameter.validate(values[parameter.oaParameter.name]);if(innerResult&&innerResult.length>0){// Commenting out this line will fix the problem.result=(result||[]).concat(innerResult);}}returnresult;}}```tsconfig.json:```json{"compilerOptions": {"target": "es5","module": "commonjs","lib": ["es6"],"allowJs": false,"declaration": true,"declarationDir": "./types","sourceMap": true,"outDir": "./lib","stripInternal": true,"strict": true,"noImplicitAny": true,"noImplicitThis": true,"alwaysStrict": true,"forceConsistentCasingInFileNames": true,"noUnusedLocals": true,"noUnusedParameters": true,"noImplicitReturns": true,"noFallthroughCasesInSwitch": true,"typeRoots": ["./node_modules/@types","./@types"],"esModuleInterop": true},"include": ["./src/**/*"],"compileOnSave": true}
Expected behavior:
Compile this into JS.
Actual behavior:
RangeError: Maximum call stack size exceeded
at /Users/jwalton/.nvm/versions/node/v8.11.1/lib/node_modules/typescript/lib/tsc.js:31413:53
at Object.findAncestor (/Users/jwalton/.nvm/versions/node/v8.11.1/lib/node_modules/typescript/lib/tsc.js:343:26)
at isInsideFunction (/Users/jwalton/.nvm/versions/node/v8.11.1/lib/node_modules/typescript/lib/tsc.js:31413:25)
at checkNestedBlockScopedBinding (/Users/jwalton/.nvm/versions/node/v8.11.1/lib/node_modules/typescript/lib/tsc.js:31422:34)
at checkIdentifier (/Users/jwalton/.nvm/versions/node/v8.11.1/lib/node_modules/typescript/lib/tsc.js:31349:13)
at checkExpressionWorker (/Users/jwalton/.nvm/versions/node/v8.11.1/lib/node_modules/typescript/lib/tsc.js:35793:28)
at checkExpression (/Users/jwalton/.nvm/versions/node/v8.11.1/lib/node_modules/typescript/lib/tsc.js:35769:42)
at checkExpressionCached (/Users/jwalton/.nvm/versions/node/v8.11.1/lib/node_modules/typescript/lib/tsc.js:35672:38)
at getTypeOfExpression (/Users/jwalton/.nvm/versions/node/v8.11.1/lib/node_modules/typescript/lib/tsc.js:35754:28)
at getContextualTypeForBinaryOperand (/Users/jwalton/.nvm/versions/node/v8.11.1/lib/node_modules/typescript/lib/tsc.js:31916:25)
TypeScript Version: 2.8.3
Code
Expected behavior:
Compile this into JS.
Actual behavior:
Playground Link: https://www.typescriptlang.org/play/#src=export%20interface%20IValidationError%20%7B%0D%0A%20%20%20%20message%3A%20string%3B%0D%0A%7D%0D%0A%0D%0Aexport%20default%20class%20Operation%20%7B%0D%0A%20%20%20%20validateParameters(parameterValues%3A%20any)%20%3A%20IValidationError%5B%5D%20%7C%20null%20%7B%0D%0A%20%20%20%20%20%20%20%20let%20result%3A%20IValidationError%5B%5D%20%7C%20null%20%3D%20null%3B%0D%0A%20%20%20%20%20%20%20%20for(const%20parameterLocation%20of%20Object.keys(parameterValues))%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20const%20parameter%3A%20any%20%3D%20(this%20as%20any).getParameter()%3B%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20const%20values%20%3D%20(this%20as%20any).getValues()%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20const%20innerResult%20%3D%20parameter.validate(values%5Bparameter.oaParameter.name%5D)%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if(innerResult%20%26%26%20innerResult.length%20%3E%200)%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20result%20%3D%20(result%20%7C%7C%20%5B%5D).concat(innerResult)%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20return%20result%3B%0D%0A%20%20%20%20%7D%0D%0A%7D
This passes in playground.
Related Issues:
The text was updated successfully, but these errors were encountered: