Skip to content

Instantly share code, notes, and snippets.

@shanewholloway
Last active April 4, 2017 13:18
Show Gist options
  • Save shanewholloway/9764d810de8eaae68b68a47b8a89d767 to your computer and use it in GitHub Desktop.
Save shanewholloway/9764d810de8eaae68b68a47b8a89d767 to your computer and use it in GitHub Desktop.
2017-04-04--babel-plugin-offside-js--issues--5
class Rectangle ::
constructor(height, width) ::
this.height = height;
this.width = width;
toString() ::
return `(${this.height} ${this.width})`;
"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 Rectangle = function () {
function Rectangle(height, width) {
_classCallCheck(this, Rectangle);
this.height = height;
this.width = width;
}
_createClass(Rectangle, [{
key: "toString",
value: function toString() {
return "(" + this.height + " " + this.width + ")";
}
}]);
return Rectangle;
}();
{
"name": "2017-04-04--babel-plugin-offside-js--issues--5",
"license": "MIT",
"dependencies": {},
"devDependencies": {
"babel-cli": "^6.24.0",
"babel-plugin-offside-js": "^0.5.1",
"babel-preset-latest": "^6.24.0"
},
"babel": {
"presets": [
"latest"
],
"plugins": [
["offside-js", {"keyword_blocks": false}]
]
},
"scripts": {
"build": "babel 01_rectangle.js -o _01_rectangle.compiled.js",
"watch": "npm -s run build -- --watch"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment