You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "matthiasblaesing (via GitHub)" <gi...@apache.org> on 2023/07/24 17:01:06 UTC

[GitHub] [netbeans] matthiasblaesing opened a new pull request, #6249: JS: Fix handling of classes declared in anonymous functions

matthiasblaesing opened a new pull request, #6249:
URL: https://github.com/apache/netbeans/pull/6249

   Consider this construct:
   
   ```javascript
     (function () {
         class Directory {
             constructor(displayName) {
                 this.displayName = displayName;
             }
         }
   
         class ImageFile{
             constructor(displayName){
               this.displayName = displayName;
             }
         }
     })();
   ```
   
   Before this change this construct was not correctly parsed and the constructor was not cleanly recognised, leading to missing usage marks (i.e. the displayName above was marked as unused).
   
   A different fallout of that problem is visible with this:
   
   ```javascript
     (function () {
         class Directory {
             constructor(displayName) {
                 this.displayName = displayName;
             }
         }
   
         class ImageFile{
             constructor(displayName){
                 this.displayName = displayName;
             }
         }
   
         function getJsonData(folderURL) {
             const body = folderURL;
         }
     })();
   ```
   
   Fixed Problems:
   
   - `constructor` from `ImageFile` is shown as a toplevel function
   - `ImageFile` is listed without its constructor and without its `displayName` property
   


-- 
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 pull request #6249: JS: Fix handling of classes declared in anonymous functions

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on PR #6249:
URL: https://github.com/apache/netbeans/pull/6249#issuecomment-1673689012

   @junichi11 thanks for review. Pushed an update.


-- 
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] junichi11 commented on pull request #6249: JS: Fix handling of classes declared in anonymous functions

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on PR #6249:
URL: https://github.com/apache/netbeans/pull/6249#issuecomment-1672432135

   It would be nice if we can also add unit tests to `JsStructureScannerTest` of `javascript2.editor`.


-- 
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 merged pull request #6249: JS: Fix handling of classes declared in anonymous functions

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing merged PR #6249:
URL: https://github.com/apache/netbeans/pull/6249


-- 
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] junichi11 commented on a diff in pull request #6249: JS: Fix handling of classes declared in anonymous functions

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on code in PR #6249:
URL: https://github.com/apache/netbeans/pull/6249#discussion_r1289337143


##########
webcommon/javascript2.model/src/org/netbeans/modules/javascript2/model/ModelVisitor.java:
##########
@@ -2747,6 +2755,9 @@ public Node leaveVarNode(VarNode varNode) {
 
 
             }
+        }
+        if(varNodeScopes.containsKey(modelBuilder.getCurrentObject())) {

Review Comment:
   Nitpick: formatting



-- 
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] junichi11 commented on pull request #6249: JS: Fix handling of classes declared in anonymous functions

Posted by "junichi11 (via GitHub)" <gi...@apache.org>.
junichi11 commented on PR #6249:
URL: https://github.com/apache/netbeans/pull/6249#issuecomment-1674036257

   @matthiasblaesing Perfect. Thanks!


-- 
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 pull request #6249: JS: Fix handling of classes declared in anonymous functions

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on PR #6249:
URL: https://github.com/apache/netbeans/pull/6249#issuecomment-1671803923

   If noone objects, I'll merge this by the end of the week.


-- 
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 pull request #6249: JS: Fix handling of classes declared in anonymous functions

Posted by "matthiasblaesing (via GitHub)" <gi...@apache.org>.
matthiasblaesing commented on PR #6249:
URL: https://github.com/apache/netbeans/pull/6249#issuecomment-1675953627

   @junichi11 thanks again for checking. Squashed, tests are still green, I'll get this merged.


-- 
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