-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CS2] Compile all super calls to ES2015 super #4424
Commits on Feb 4, 2017
-
Compile all super calls to ES2015 super
This breaks using `super` in non-methods, meaning several tests are failing. Self-compilation still works.
Chris Connelly committedFeb 4, 2017 Configuration menu - View commit details
-
Copy full SHA for 8254bf4 - Browse repository at this point
Copy the full SHA 8254bf4View commit details -
Use bound functions for IIFEs containing
super
`super` can only be called directly in a method, or in an arrow function.
Chris Connelly committedFeb 4, 2017 Configuration menu - View commit details
-
Copy full SHA for 56aa57b - Browse repository at this point
Copy the full SHA 56aa57bView commit details -
Fix handling of
class @A extends A
This behaviour worked 'for free' when the parent reference was being cached by the executable class body wrapper. There now needs to be special handling in place to check if the parent name matches the class name, and if so to cache the parent reference.
Chris Connelly committedFeb 4, 2017 Configuration menu - View commit details
-
Copy full SHA for b5f5904 - Browse repository at this point
Copy the full SHA b5f5904View commit details -
Fix tests broken by compiling ES2015
super
Chris Connelly committedFeb 4, 2017 Configuration menu - View commit details
-
Copy full SHA for b261534 - Browse repository at this point
Copy the full SHA b261534View commit details -
This removes syntax support for 'bare' super calls, e.g.: class B extends A constructor: -> super `super` must now always be followed with arguments like a regular function call. This also removes the capability of implicitly forwarding arguments. The above can be equivalently be written as: class B extends A constructor: -> super arguments...
Chris Connelly committedFeb 4, 2017 Configuration menu - View commit details
-
Copy full SHA for 32651bf - Browse repository at this point
Copy the full SHA 32651bfView commit details -
`super` with following accessor(s) is now compiled to ES2015 equivalents. In particular, expressions such as `super.name`, `super[name]`, and also `super.name.prop` are all now valid, and can be used as expected as calls (i.e. `super.name()`) or in expressions (i.e. `if super.name? ...`). `super` without accessors is compiled to a constructor super call in a constructor, and otherwise, as before, to a super call to the method of the same name, i.e. speak: -> super() ...is equivalent to speak: -> super.speak() A neat side-effect of the changes is that existential calls now work properly with super, meaning `super?()` will only call if the super property exists (and is a function). This is not valid for super in constructors.
Chris Connelly committedFeb 4, 2017 Configuration menu - View commit details
-
Copy full SHA for 61a9b5f - Browse repository at this point
Copy the full SHA 61a9b5fView commit details -
Prevent calling
super
methods withnew
This fixes a bug in the previous super handling whereby using the `new` operator with a `super` call would silently drop the `new`. This is now an explicit compiler error, as it is invalid JS at runtime.
Chris Connelly committedFeb 4, 2017 Configuration menu - View commit details
-
Copy full SHA for 299dab5 - Browse repository at this point
Copy the full SHA 299dab5View commit details -
Clean up some old super handling code
This was mostly code for tracking the source classes and variables for methods, which were needed to build the old lookups on `__super__`.
Chris Connelly committedFeb 4, 2017 Configuration menu - View commit details
-
Copy full SHA for bd0285f - Browse repository at this point
Copy the full SHA bd0285fView commit details -
Add TODO to improve bare super parse error
Chris Connelly committedFeb 4, 2017 Configuration menu - View commit details
-
Copy full SHA for 5ea2427 - Browse repository at this point
Copy the full SHA 5ea2427View commit details -
Add some TODOs to improve some of the class tests
Chris Connelly committedFeb 4, 2017 Configuration menu - View commit details
-
Copy full SHA for 32ca5f3 - Browse repository at this point
Copy the full SHA 32ca5f3View commit details