Skip to content

Inclusion should create a new scope #2027

Open
@smaili

Description

@smaili
//- includer.jade
- for ( var i = 0; i < 2; i++ ) {
-   console.log( 'includer' + i );
include /includee
- }
//- includee.jade
-
  for ( var i = 0; i < 5; i++ ) {
    console.log( 'includee' + i );
  }

Output:

includer0
includee0
includee1
includee2
includee3
includee4

As you can see, includer never gets past the first iteration due to the includee overwriting the value of i, which should not happen since includee's var i = 0 should create a new scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions