A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/2379 below:

[javascript] Support for-of loop · Issue #2379 · pmd/pmd · GitHub

Affects PMD Version:

6.22.0

Description:

The for-of loop is recognised incorrectly as an "EmptyStatement".

That's an ES6 / ECMAScript 2015 feature.

It seems to be partially supported by Rhino: http://mozilla.github.io/rhino/compat/engines.html

Code Sample demonstrating the issue:

// Generates "ForInLoop" in AST
for (var item in items) {}

// Generate "EmptyStatement" in AST
for (var item of items) {}
for (let item of items) {}
for (const item of items) {}

Steps to reproduce:

  1. Start PMD Designer
  2. Set language to Ecmascript
  3. Copy-paste code sample from above
  4. Observe AST for incorrect "EmptyStatement"

Running PMD through: Designer

Related issues: #2305 #1235 #699


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4