Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stefanpenner/compiled_class
https://github.com/stefanpenner/compiled_class
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/stefanpenner/compiled_class
- Owner: stefanpenner
- Created: 2014-05-11T14:54:09.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-05-12T02:54:30.000Z (over 10 years ago)
- Last Synced: 2024-10-17T18:10:59.438Z (20 days ago)
- Language: JavaScript
- Size: 363 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
compiled_class
==============still a spike, still WIP, don't use this or expect it to work
input:
------```js
class Controller extends Foo {
constructor(options) {this.fullName = 'stefan';
this.lastName = 'penner';super(options);
}update(camera) {
super.update(camera, foo);
super.orange(camera, foo);
}apple(camera) {
super.apple.apply(this, [camera, foo]);
}orange () {
super.orange.apply(this, arguments);
}foo () {
super.orange.bar(arguments);
}//+property('fullName', 'lastName');
fullName() {
return [
this.fullName,
this.lastName
].compact().join(' ');
}
};```
output:
-------```js
function Controller(options) {
this.fullName = 'stefan';
this.lastName = 'penner';
super(options); // wrong still, should be Foo.call(this, options);
super.apply(this, arguments); // wrong still, should be Foo.apply(this, arguments);
}Controller.prototype = Object.create(Foo);
Controller.prototype.constructor = Controller;
Controller.prototype.update = function (camera) {
this.constructor.prototype.update.call(this, camera, foo);
this.constructor.prototype.orange.call(this, camera, foo);
};
Controller.prototype.apple = function (camera) {
this.constructor.prototype.apple.apply(this, [
camera,
foo
]);
};
Controller.prototype.orange = function () {
this.constructor.prototype.orange.apply(this, arguments);
};
Controller.prototype.foo = function () {
this.constructor.prototype.orange.bar(arguments);
};
Controller.prototype.fullName = function () {
return [
this.fullName,
this.lastName
].compact().join(' ');
};
```