Replies: 3 comments
-
Without digging into the details and checking it myself, bun by default initialises the project in strict mode in which the global this is undefined. Could that be a difference between your bun and node setup? |
Beta Was this translation helpful? Give feedback.
-
Hi, @KilianB thanks for the feedback, by looking at the code and the comments in, there is another raised question regarding deno and bun: since both implement I am glad to hear more from you. I really appreciate any help you can provide. |
Beta Was this translation helpful? Give feedback.
-
I think the top level this is another story... from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this
so the problem here is, bun run code in module mode by default, but still follow the commonjs's behavior, I guess it is for compatible |
Beta Was this translation helpful? Give feedback.
-
What version of Bun is running?
1.1.20
What platform is your computer?
Darwin 23.5.0 x86_64 i386
What steps can reproduce the bug?
Hi,
By considering the code snippet below, bun gives different values of
this
object in different scopes compared with node.js and deno.I am wondering if it is not a bug, and why it is different.
AH
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions