Skip to content

Instantly share code, notes, and snippets.

@vincentdchan
Last active May 8, 2020 12:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vincentdchan/a67ee79011c9c1fbb699a137538dcbe7 to your computer and use it in GitHub Desktop.
Save vincentdchan/a67ee79011c9c1fbb699a137538dcbe7 to your computer and use it in GitHub Desktop.
Scope Analysis
// module scope start
// Block
{ // <- scope start
} // <- scope end
// Class
class Foo { // <- scope start
} // <- scope end
// If else
if (true) { // <- scope start
} /* <- scope end */ else { // <- scope start
} // <- scope end
// For
for (;;) { // <- scope start
} // <- scope end
// Catch
try {
} catch (e) { // <- scope start
} // <- scope end
// Function
function() { // <- scope start
} // <- scope end
// Scope
switch() { // <- scope start
} // <- scope end
// module scope end
@goodwin64
Copy link

How about separate scopes in "try", "finally", "case inside switch" and "default inside switch"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment