Node: Node v4 not respect const scope in while block

Created on 24 Dec 2016  路  5Comments  路  Source: nodejs/node

  • Version: 4.7.0
  • Platform: Linux, Mac, Windows

Demo code: https://github.com/lijunle/bug-node-v4-while-const/blob/master/index.js

The build output: Travis, AppVeyor. It is causing a dead loop in the while block.

This bug only happens in v4 and not v6 or v7. I understand that, v4 is in maintain status, but I think this is a critical bug.

V8 Engine confirmed-bug

All 5 comments

/cc @nodejs/v8

Note that the bug only exists in sloppy mode. You can work around it with a 'use strict'; at the beginning of your file.

This has been a known issue for a year.

Going to close as this is a known issue and v4.x is in maintenance mode now. If you want correct functionality for const in v4, make sure you 'use strict'

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loretoparisi picture loretoparisi  路  3Comments

danialkhansari picture danialkhansari  路  3Comments

vsemozhetbyt picture vsemozhetbyt  路  3Comments

fanjunzhi picture fanjunzhi  路  3Comments

willnwhite picture willnwhite  路  3Comments