Skip to content

"exception" vs "new feature" ? #2430

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

Merged
merged 1 commit into from
Jan 16, 2021

Conversation

joaquinelio
Copy link
Member

@joaquinelio joaquinelio commented Jan 12, 2021

I think it is not an exception but a feature.

But there is another problem
you define "module" as "just a file" and it was ok until now,

but as I understand await won't work outside functions in the "main" script, so the change is not enough
should we add "inside imported modules" ?

edit;
just realized I dont know shit
How do you access "top level code" inside modules?

@iliakan
Copy link
Member

iliakan commented Jan 13, 2021

The "main" script can be <script type="module">, then top-level async/await should work there.

What's the issue with accessing "top level code"?

@joaquinelio
Copy link
Member Author

mm
When I read your line "work in modules" I figured it all wrong, so forget it.

The suggestion "new way" instead "exception" stands (not that important)
the rest is just me voicing my ignorance too soon.

TLDR,
I thought the improvement was more flexibility inside (imported) modules
and still not working on "main" module, it seemed ok to me. Then I realized the conceptual error.

I don't feel comfortable with it anyway.
Can't say way. It doesnt sound "js way".
Like the thread you never block in other languajes. Keep forking, never let it die.

@iliakan iliakan merged commit 3a0b3f4 into javascript-tutorial:master Jan 16, 2021
@joaquinelio joaquinelio deleted the patch-1 branch January 16, 2021 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants