Skip to content

Move from Javascript scoping rules to C99/C++ scoping rules #1679

@axic

Description

@axic

I think it counters the general aim of safety to retain the scoping rules from Javascript. While historically the language might have been much closer to it, today it provides less resemblance.

The sheer amout of guidance in the documentation to warn about the scoping rules is also an indication that it is not neccesarily providing a safe behaviour.

The two main changes:

  • variables must be defined before the first reference
  • conditionals and loops have their own scope (can access upvalues of course)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions