Skip to content

Instantly share code, notes, and snippets.

@SerafimArts
Last active October 7, 2015 10:03
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 SerafimArts/9e24db3ad5e71e0b3431 to your computer and use it in GitHub Desktop.
Save SerafimArts/9e24db3ad5e71e0b3431 to your computer and use it in GitHub Desktop.
class Test
constructor: (a, b) ->
console.log(a, b);
method: ->
# method
@method: ->
# static
class Test {
constructor(a, b) {
console.log(a, b);
}
method() {
// method
}
static method() {
// static
}
}
var Test;
Test = (function() {
function Test(a, b) {
console.log(a, b);
}
Test.prototype.method = function() {};
Test.method = function() {};
return Test;
})();
"use strict";
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Test = (function () {
function Test(a, b) {
_classCallCheck(this, Test);
console.log(a, b);
}
_createClass(Test, [{
key: "method",
value: function method() {
// method
}
}], [{
key: "method",
value: function method() {
// static
}
}]);
return Test;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment