You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2022/06/19 08:32:16 UTC

[GitHub] [netbeans] think-info opened a new issue, #4246: Javascript Promise syntax errors

think-info opened a new issue, #4246:
URL: https://github.com/apache/netbeans/issues/4246

   ### Apache NetBeans version
   
   Apache NetBeans 14
   
   ### What happened
   
   Working with Promise in JS, correct syntax is highlighted as errors and/or warnings.
   
   This occurs with `Promise.all()` and `Promise.then()`. I know it affects extensions of `Promise`, such as `fetch().then()`.
   
   Of special note: a single instance of the syntax being erroneously highlighted will result in all other instance of `Promise` (and `fetch`) within the same file being marked as errors even though they are correct and not highlighted without the triggering error being present.
   
   In the most basic version of the error, per first example below, every `Promise` is highlighted with the warning _Global variable "Promise" is not declared_. If the `Promise.resolve()` and `Promise.all()` are removed, the remaining `new Promise` is no longer highlighted.
   
   In the second example, the same error is shown on the `fetch()`, but if the `.then()` statements are removed, the supposed error goes away.
   
   ### How to reproduce
   
   Use sample `Promise.all()` code from MDN:
   
   ```
   const p1 = Promise.resolve(3);
   const p2 = 1337;
   const p3 = new Promise((resolve, reject) => {
     setTimeout(() => {
       resolve("foo");
     }, 100);
   });
   Promise.all([p1, p2, p3]).then(values => {
     console.log(values); // [3, 1337, "foo"]
   });
   ```
   
   Use sample `fetch()` code from MDN:
   
   ```
   fetch('http://example.com/movies.json')
     .then(response => response.json())
     .then(data => console.log(data));
   ```
   
   ### Did this work correctly in an earlier version?
   
   No
   
   ### Operating System
   
   Windows 11
   
   ### JDK
   
   18.0.1.1 Windows 64 bit
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   I say this didn't work in previous versions, but I don't know whether that is the case. New machine, new install, and first time I ever make a `Promise()`.
   
   ### Are you willing to submit a pull request?
   
   No
   
   ### Code of Conduct
   
   Yes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing closed issue #4246: Global JS functions from classpath/platform are reported as undeclared global variable

Posted by GitBox <gi...@apache.org>.
matthiasblaesing closed issue #4246: Global JS functions from classpath/platform are reported as undeclared global variable
URL: https://github.com/apache/netbeans/issues/4246


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] matthiasblaesing commented on issue #4246: Global JS functions from classpath/platform are reported as undeclared global variable

Posted by GitBox <gi...@apache.org>.
matthiasblaesing commented on issue #4246:
URL: https://github.com/apache/netbeans/issues/4246#issuecomment-1160739747

   Please test the referenced PR - a testbuild is referenced there.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists