ts-node
ts-node copied to clipboard
Bug with Function.prototype.toString method
Code:
class A {}
console.log(Function.prototype.toString.call(A))
should be: 'class A {}'
have now: 'function A() {\r\n }'
ts-node version 8.9.1
You omitted your tsconfig.json so I'll assume you're compiling with default TypeScript compiler options, which downlevel to ES3. (docs: https://www.typescriptlang.org/docs/handbook/compiler-options.html) You can verify this by compiling your code with tsc and inspecting the output .js. ts-node is doing the same thing, just in-memory.
You might be asking for something like #973. If so, you can share your use-case and requirements over there.
Closing for now because I'm pretty sure this answers it. If I have misunderstood, please let me know and we'll happily reopen the ticket.