Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid error detection in Javascript syntax #7260

Open
grelf-net opened this issue Apr 11, 2024 · 4 comments
Open

Invalid error detection in Javascript syntax #7260

grelf-net opened this issue Apr 11, 2024 · 4 comments
Labels
JavaScript [ci] enable web job and extra JavaScript tests (webcommon/javascript2.editor) kind:bug Bug report or fix needs:triage Requires attention from one of the committers

Comments

@grelf-net
Copy link

grelf-net commented Apr 11, 2024

Apache NetBeans version

Apache NetBeans 21

What happened

for (let i = 0; i < cellsInRange.length; i++)
  { let ci = cellsInRange[i];
    if (!ci.cell.open)
    { let ims = ci.cell.getWallImages();
      let data = [
        {s:ci.sxydNW, i:ims[0]},//Bug in NetBeans!
        {s:ci.sxydNE, i:ims[1]},//It says ims is an undeclared global
        {s:ci.sxydSW, i:ims[2]},//OK in browser though
        {s:ci.sxydSE, i:ims[3]}];
      data.sort(function(a, b) {return b.s.d - a.s.d;}); // Descending distance
      this.drawWall(data[1].s, data[3].s, data[1].i, ci.fogNo);
      this.drawWall(data[2].s, data[3].s, data[2].i, ci.fogNo);
  } }

Language / Project Type / NetBeans Component

HTML5/Javascript project (vanilla, for browser use)

How to reproduce

Screenshot 2024-04-11 155614

Did this work correctly in an earlier version?

Apache NetBeans 18

Operating System

WIndows 11 latest

JDK

JDK 11

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

Every time. If I change the let ims to var ims it is OK. The error is in NetBeans syntax checker.

Are you willing to submit a pull request?

No

@grelf-net grelf-net added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Apr 11, 2024
@grelf-net
Copy link
Author

Sorry - it did NOT work correctly in NB 18. That's what I was using when I found the problem. That prompted me to upgrade to 21 and the problem was still there. I have used NetBeans for many years without any such problems.

@matthiasblaesing
Copy link
Contributor

Lets reopen - I'll see what to do about this.

@mbien mbien added the JavaScript [ci] enable web job and extra JavaScript tests (webcommon/javascript2.editor) label Apr 11, 2024
@grelf-net
Copy link
Author

I should perhaps add that there is no other variable or property called ims that might be confusing things. Also that I have tested the code in FireFox, Edge, and the built-in WebKit browser and they all work fine, finding the variable ims as required.

@matthiasblaesing
Copy link
Contributor

This is not reproducible in current build:

image

Please check with the nightly build available here:

https://ci-builds.apache.org/job/Netbeans/job/netbeans-linux/lastSuccessfulBuild/artifact/nbbuild/

Please note:

  1. The ZIP in the referenced folder holds the ZIP Distribution of NetBeans. Expand it and you find a netbeans folder with the full installation.
  2. You need at least JDK 17 to run NetBeans 22 (on my main machine and @work I'm on Amazon Corretto 21)
  3. If the JDK can't be automatically found, uncomment the line with the variable netbeans_jdkhome in the file netbeans/etc/netbeans.conf and set the a path to the JDK there. On my windows test system for example it currently reads (with Amazon Corretto 17):
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JavaScript [ci] enable web job and extra JavaScript tests (webcommon/javascript2.editor) kind:bug Bug report or fix needs:triage Requires attention from one of the committers
Projects
None yet
Development

No branches or pull requests

3 participants