-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Object
variable declaration conflicts on commonjs
#35478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm pretty sure |
Avoiding reference to global variables such as But the current behavior prevents this tuning. |
As an aside, I'm not sure why you wrote the same thing twice. Do you need a coffee? |
At a minimum we should issue an error when we detect that the emit won't work |
However, developers would feel that error strange. And the error would be enabled only with the few module types (any other similar errors dependent on module types?). Basically other (mainly native) module types don't have this limitation. Therefore this is incompatibility of module types with a very common namespace. Compilers should hide such incompatibility as much as possible. I can find no reason to avoid an easy solution that just surrounding code by curly brackets. |
Node.js is a user of this technique too. https://github.com/nodejs/node/search?l=JavaScript&q=primordials+Object |
Note that you must not make |
TypeScript Version: 3.7.x-dev.20191203
Search Terms:
Code
Expected behavior:
no error
Actual behavior:
Playground Link: http://www.typescriptlang.org/play/index.html?module=1#code/KYDwDg9gTgLgBAE2AMwIYFcA28DeBfAKAGMIA7AZ3gHkAjAK2CPgF458BuIA
Related Issues:
The text was updated successfully, but these errors were encountered: