forked from anko/eslisp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use "method" atom to denote method properties
Consider an ES6 object literal with a method that has empty arguments and an empty body: { d() { } } Before this commit, that would intuitively have been written as (object ('d ())) which failed because the ('d ()) list has 2 elements, which the logic attempted to compile to an ordinary property instead of a method. It's ambiguous with { d: null } if () were to compile to null. It currently compiles to nothing (anko#32), but the argument stands. This change hence introduces this syntax (object (method 'd ())) similarly to how getters and setters already allow empty bodies with (object (get 'd ()) (set 'd ())) I also moved the check for the initial "get" / "set" / "method" atom above the args.length==2 check, to ensure it takes precedence.
- Loading branch information
Showing
3 changed files
with
31 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters