Skip to content
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

Non-standard namespaces other than Deno declared in lib.deno_runtime.d.ts #2888

Closed
nayeemrmn opened this issue Sep 8, 2019 · 3 comments · Fixed by #3400
Closed

Non-standard namespaces other than Deno declared in lib.deno_runtime.d.ts #2888

nayeemrmn opened this issue Sep 8, 2019 · 3 comments · Fixed by #3400
Labels
bug Something isn't working correctly

Comments

@nayeemrmn
Copy link
Collaborator

nayeemrmn commented Sep 8, 2019

As you can see, lib.deno_runtime.d.ts publicly declares namespaces domTypes, blob, consoleTypes, event, customEvent, eventTarget, io, fetchTypes, textEncoding, timers, urlSearchParams, url, workers, and performanceUtil which should all be internal.

You can't declare them as variables in typescript - let url; throws during compilation:

error TS2451: Cannot redeclare block-scoped variable 'url'.

► $asset$/lib.deno_runtime.d.ts:2514:19

2514 declare namespace url {
                       ~~~

  'url' was also declared here.
...
@ry
Copy link
Member

ry commented Sep 8, 2019

Oops! Declaration files are hard.
Fixes to lib.deno_runtime.d.ts with tests are welcome.

@kitsonk
Copy link
Contributor

kitsonk commented Sep 8, 2019

Personal opinion, let's address this as part of #2868. Library files work differently, they need to follow the pattern of other lib files. I understand the problem and we should be able to address it as part of #2868. For now, if the collision is a real problem, let's just rename url to something like __url or _deno_url here.

@hayd
Copy link
Contributor

hayd commented Oct 27, 2019

Looks like I broke the curl example because of this:

const url = Deno.args[1];

Note: This must mean we're not executing, or even compiling, the examples as part of testing.

@ry ry added the bug Something isn't working correctly label Oct 28, 2019
@ry ry mentioned this issue Oct 28, 2019
43 tasks
@ry ry closed this as completed in #3400 Nov 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
4 participants