the Fibonacci code is not tail recursive but I've tested this even with big numbers and works ok, I never get an error related to the call stack when use it...
when I run this code I get this
Exception in PromiseRejectCallback:
/Users/Admin/Downloads/proj/js/typescript/vertex_rpc/src/prueba.ts:4
return new (P || (P = Promise))(function (resolve, reject) {
^
RangeError: Maximum call stack size exceeded
Exception in PromiseRejectCallback:
/Users/Admin/Downloads/proj/js/typescript/vertex_rpc/src/prueba.ts:7
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
^
RangeError: Maximum call stack size exceeded
(node:39229) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded
at /Users/Admin/Downloads/proj/js/typescript/vertex_rpc/src/prueba.ts:1:1
at /Users/Admin/Downloads/proj/js/typescript/vertex_rpc/src/prueba.ts:8:37
at new Promise (<anonymous>)
at __awaiter (/Users/Admin/Downloads/proj/js/typescript/vertex_rpc/src/prueba.ts:4:12)
at fibonacci (/Users/Admin/Downloads/proj/js/typescript/vertex_rpc/src/prueba.ts:14:12)
at /Users/Admin/Downloads/proj/js/typescript/vertex_rpc/src/prueba.ts:5:76
at Generator.next (<anonymous>)
at /Users/Admin/Downloads/proj/js/typescript/vertex_rpc/src/prueba.ts:8:71
at new Promise (<anonymous>)
at __awaiter (/Users/Admin/Downloads/proj/js/typescript/vertex_rpc/src/prueba.ts:4:12)
(node:39229) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:39229) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
do you know what could be the issue here?...thank you so much
Hi, I'm trying to transform some code from amqp to nats, I start with the basic Fibonacci request/reply
server
client
the Fibonacci code is not tail recursive but I've tested this even with big numbers and works ok, I never get an error related to the call stack when use it...
when I run this code I get this
do you know what could be the issue here?...thank you so much