From b7dd7795fb8e5b727f07ca578ca1fc930ed6c18b Mon Sep 17 00:00:00 2001 From: Josh Perez Date: Sun, 15 Feb 2015 14:08:09 -0800 Subject: [PATCH] Upgrade to babel 4.0 --- dist/alt-with-runtime.js | 26 +++++++++++++------------- package.json | 8 ++++---- test/index.js | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/dist/alt-with-runtime.js b/dist/alt-with-runtime.js index 2e845787..ac65256b 100644 --- a/dist/alt-with-runtime.js +++ b/dist/alt-with-runtime.js @@ -46,7 +46,7 @@ var getInternalMethods = function (obj, excluded) { var AltStore = (function () { function AltStore(dispatcher, state) { var _this5 = this; - to5Runtime.classCallCheck(this, AltStore); + babelHelpers.classCallCheck(this, AltStore); this[EE] = new EventEmitter(); this[LIFECYCLE] = {}; @@ -67,7 +67,7 @@ var AltStore = (function () { } } - to5Runtime.prototypeProperties(AltStore, null, { + babelHelpers.prototypeProperties(AltStore, null, { emitChange: { value: function emitChange() { this[EE].emit("change", this[STATE_CONTAINER]); @@ -104,7 +104,7 @@ var AltStore = (function () { var ActionCreator = (function () { function ActionCreator(alt, name, action, actions) { - to5Runtime.classCallCheck(this, ActionCreator); + babelHelpers.classCallCheck(this, ActionCreator); this[ACTION_UID] = name; this[ACTION_HANDLER] = action.bind(this); @@ -112,7 +112,7 @@ var ActionCreator = (function () { this.alt = alt; } - to5Runtime.prototypeProperties(ActionCreator, null, { + babelHelpers.prototypeProperties(ActionCreator, null, { dispatch: { value: function dispatch(data) { this.alt.dispatch(this[ACTION_UID], data); @@ -225,7 +225,7 @@ var filterSnapshotOfStores = function (snapshot, storeNames) { var Alt = (function () { function Alt() { - to5Runtime.classCallCheck(this, Alt); + babelHelpers.classCallCheck(this, Alt); this.dispatcher = new Dispatcher(); this.actions = {}; @@ -234,7 +234,7 @@ var Alt = (function () { this[INIT_SNAPSHOT] = "{}"; } - to5Runtime.prototypeProperties(Alt, null, { + babelHelpers.prototypeProperties(Alt, null, { dispatch: { value: function dispatch(action, data) { this.dispatcher.dispatch({ action: action, data: data }); @@ -251,14 +251,14 @@ var Alt = (function () { // so we can inherit any extensions from the provided store. var Store = (function (StoreModel) { function Store() { - to5Runtime.classCallCheck(this, Store); + babelHelpers.classCallCheck(this, Store); this[LIFECYCLE] = {}; this[LISTENERS] = {}; - to5Runtime.get(Object.getPrototypeOf(Store.prototype), "constructor", this).call(this); + babelHelpers.get(Object.getPrototypeOf(Store.prototype), "constructor", this).call(this); } - to5Runtime.inherits(Store, StoreModel); + babelHelpers.inherits(Store, StoreModel); return Store; })(StoreModel); @@ -296,14 +296,14 @@ var Alt = (function () { var ActionsGenerator = (function (ActionsClass) { function ActionsGenerator() { - to5Runtime.classCallCheck(this, ActionsGenerator); + babelHelpers.classCallCheck(this, ActionsGenerator); - to5Runtime.get(Object.getPrototypeOf(ActionsGenerator.prototype), "constructor", this).call(this); + babelHelpers.get(Object.getPrototypeOf(ActionsGenerator.prototype), "constructor", this).call(this); } - to5Runtime.inherits(ActionsGenerator, ActionsClass); + babelHelpers.inherits(ActionsGenerator, ActionsClass); - to5Runtime.prototypeProperties(ActionsGenerator, null, { + babelHelpers.prototypeProperties(ActionsGenerator, null, { generateActions: { value: function generateActions() { for (var _len = arguments.length, actionNames = Array(_len), _key = 0; _key < _len; _key++) { diff --git a/package.json b/package.json index 901dfee7..0c375bee 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "object-assign": "^2.0.0" }, "devDependencies": { - "6to5": "^3.5.3", + "babel": "^4.0.1", "coveralls": "^2.11.2", "istanbul": "^0.3.5", "mocha": "^2.1.0" @@ -21,9 +21,9 @@ }, "scripts": { "build": "npm run build-alt; npm run build-alt-runtime", - "build-alt": "6to5 ./src/alt.js > dist/alt.js", - "build-alt-runtime": "6to5 --runtime src/alt.js > dist/alt-with-runtime.js", - "build-test": "6to5 --runtime test/index.js > test/compiled.js", + "build-alt": "babel ./src/alt.js > dist/alt.js", + "build-alt-runtime": "babel --external-helpers src/alt.js > dist/alt-with-runtime.js", + "build-test": "babel --external-helpers test/index.js > test/compiled.js", "coverage": "istanbul cover _mocha -- -u exports -R list test/compiled.js", "prepublish": "npm test", "test": "npm run build; npm run build-test; npm run tests-all", diff --git a/test/index.js b/test/index.js index c9fc666e..7a6967ce 100644 --- a/test/index.js +++ b/test/index.js @@ -1,4 +1,4 @@ -require('6to5/runtime') +require('babel/external-helpers') let Alt = require('../dist/alt-with-runtime') let assert = require('assert')