←back to thread

517 points bkolobara | 1 comments | | HN request time: 0.2s | source
Show context
merdaverse ◴[] No.45043051[source]
Code written below your line gets executed if you don't return early. More breaking news at 8.

Seriously, why would you think that assigning a value would stop your script from executing? Maybe the Typescript example is missing some context, but it seems like such a weird case to present as a "data race".

replies(8): >>45043245 #>>45043339 #>>45043398 #>>45043537 #>>45043876 #>>45046033 #>>45046975 #>>45049155 #
drdrey ◴[] No.45043876[source]
OP thought the redirect was synchronous, not that it would stop the script from executing
replies(1): >>45044099 #
jibal ◴[] No.45044099[source]
No, you're mistaken. Read the other comments under the parent. If it were synchronous then it would have stopped the script from executing, much the way POSIX exec() works. If the OP didn't think that the script would stop, then why would he let execution fall through to code that should not execute ... which he fixed by not letting it fall through?
replies(1): >>45045513 #
1. drdrey ◴[] No.45045513[source]
I see, thanks