Skip to content

Commit

Permalink
Syntax sugar for function using ->. Makes nice lambdas using JS 1.8 '…
Browse files Browse the repository at this point in the history
…expression closures'.
  • Loading branch information
Matthieu Riou committed Aug 2, 2009
1 parent 7408c3b commit 7bbbc35
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/org/mozilla/javascript/TokenStream.java
Expand Up @@ -845,6 +845,9 @@ final int getToken() throws IOException
}
}
c = Token.DEC;
} else if (matchChar('>')) {
// -> syntax sugar for functions
c = Token.FUNCTION;
} else {
c = Token.SUB;
}
Expand Down

0 comments on commit 7bbbc35

Please sign in to comment.