Skip to content

Instantly share code, notes, and snippets.

@deepak
Created January 30, 2015 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepak/09929148538f2f85f87a to your computer and use it in GitHub Desktop.
Save deepak/09929148538f2f85f87a to your computer and use it in GitHub Desktop.
ES6 classes
// Generated by CoffeeScript 1.7.1
(function() {
var Employee;
Employee = (function() {
function Employee() {}
Employee.prototype.doWork = function() {
return console.log("done");
};
return Employee;
})();
}).call(this);
class Employee
doWork: ->
console.log("done")
// ES6 class
class Employee {
doWork() {
console.log("done");
}
}
"use strict";
var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };
var Employee = (function () {
function Employee() {}
_prototypeProperties(Employee, null, {
doWork: {
value: function doWork() {
console.log("done");
},
writable: true,
configurable: true
}
});
return Employee;
})();
$traceurRuntime.ModuleStore.getAnonymousModule(function() {
"use strict";
var Employee = function Employee() {};
($traceurRuntime.createClass)(Employee, {doWork: function() {
console.log("done");
}}, {});
return {};
});
//# sourceURL=traceured.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment