jskinner / DefaultPackages

Old bug tracker for Sublime Text's "Default Packages", e.g. bad syntax highlighting
http://web.archive.org/web/20150524043750/https://www.sublimetext.com/forum/viewtopic.php?f=2&t=12095
26 stars 2 forks source link

JS syntax highlighting bug when property of prototype points to IIFE #171

Closed Daniel-Hug closed 8 years ago

Daniel-Hug commented 8 years ago

Reproduce

  1. Paste this JS into sublime (it is good JS):

    Person.prototype.age = (function() {
       return 5;
    })();
  2. Notice the poor syntax highlighting of function( which it treats like a parameter:

    syntax-highlight-bug

  3. Removing .prototype fixes the issue:

    syntax-highlight-non-bug

    Environment

    • Windows 8.1 64 bit
    • Sublime Text build 3083
FichteFoll commented 8 years ago

Fixed in dev (3095).

Daniel-Hug commented 8 years ago

I haven't upgraded my sublime to 3095+ yet so this may have been fixed, but I'll just post here that I see similar results for this code (the comment is highlighted orange like the other parameters instead of being gray like other comments):

function splice(start, deleteCount /*[, newNode1, newNode2]*/) {

}
FichteFoll commented 8 years ago

Works in 3099 (and 3095 too, likely).