You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
223 lines
7.2 KiB
223 lines
7.2 KiB
/******/ (function(modules) { // webpackBootstrap
|
|
/******/ // The module cache
|
|
/******/ var installedModules = {};
|
|
|
|
/******/ // The require function
|
|
/******/ function __webpack_require__(moduleId) {
|
|
|
|
/******/ // Check if module is in cache
|
|
/******/ if(installedModules[moduleId])
|
|
/******/ return installedModules[moduleId].exports;
|
|
|
|
/******/ // Create a new module (and put it into the cache)
|
|
/******/ var module = installedModules[moduleId] = {
|
|
/******/ exports: {},
|
|
/******/ id: moduleId,
|
|
/******/ loaded: false
|
|
/******/ };
|
|
|
|
/******/ // Execute the module function
|
|
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
|
|
/******/ // Flag the module as loaded
|
|
/******/ module.loaded = true;
|
|
|
|
/******/ // Return the exports of the module
|
|
/******/ return module.exports;
|
|
/******/ }
|
|
|
|
|
|
/******/ // expose the modules object (__webpack_modules__)
|
|
/******/ __webpack_require__.m = modules;
|
|
|
|
/******/ // expose the module cache
|
|
/******/ __webpack_require__.c = installedModules;
|
|
|
|
/******/ // __webpack_public_path__
|
|
/******/ __webpack_require__.p = "";
|
|
|
|
/******/ // Load entry module and return exports
|
|
/******/ return __webpack_require__(0);
|
|
/******/ })
|
|
/************************************************************************/
|
|
/******/ ([
|
|
/* 0 */
|
|
/***/ function(module, exports, __webpack_require__) {
|
|
|
|
'use strict';
|
|
|
|
var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
|
|
|
|
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;
|
|
};
|
|
}();
|
|
|
|
var _desc, _value, _class;
|
|
|
|
var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) {
|
|
return typeof obj === "undefined" ? "undefined" : _typeof2(obj);
|
|
} : function (obj) {
|
|
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof2(obj);
|
|
};
|
|
|
|
function _classCallCheck(instance, Constructor) {
|
|
if (!(instance instanceof Constructor)) {
|
|
throw new TypeError("Cannot call a class as a function");
|
|
}
|
|
}
|
|
|
|
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
|
|
var desc = {};
|
|
Object['ke' + 'ys'](descriptor).forEach(function (key) {
|
|
desc[key] = descriptor[key];
|
|
});
|
|
desc.enumerable = !!desc.enumerable;
|
|
desc.configurable = !!desc.configurable;
|
|
|
|
if ('value' in desc || desc.initializer) {
|
|
desc.writable = true;
|
|
}
|
|
|
|
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
|
|
return decorator(target, property, desc) || desc;
|
|
}, desc);
|
|
|
|
if (context && desc.initializer !== void 0) {
|
|
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
|
|
desc.initializer = undefined;
|
|
}
|
|
|
|
if (desc.initializer === void 0) {
|
|
Object['define' + 'Property'](target, property, desc);
|
|
desc = null;
|
|
}
|
|
|
|
return desc;
|
|
}
|
|
|
|
function onBind(target, name, descriptor) {
|
|
var method = descriptor.value;
|
|
|
|
descriptor.value = function () {
|
|
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
args[_key] = arguments[_key];
|
|
}
|
|
|
|
var binds = [];
|
|
args = Array.from(args);
|
|
var _iteratorNormalCompletion = true;
|
|
var _didIteratorError = false;
|
|
var _iteratorError = undefined;
|
|
|
|
try {
|
|
for (var _iterator = args.slice()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
var arg = _step.value;
|
|
|
|
if ((typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object') {
|
|
binds.push(arg);
|
|
args.splice(args.indexOf(arg), 1);
|
|
}
|
|
}
|
|
} catch (err) {
|
|
_didIteratorError = true;
|
|
_iteratorError = err;
|
|
} finally {
|
|
try {
|
|
if (!_iteratorNormalCompletion && _iterator.return) {
|
|
_iterator.return();
|
|
}
|
|
} finally {
|
|
if (_didIteratorError) {
|
|
throw _iteratorError;
|
|
}
|
|
}
|
|
}
|
|
|
|
method.apply(this, args);
|
|
var _iteratorNormalCompletion2 = true;
|
|
var _didIteratorError2 = false;
|
|
var _iteratorError2 = undefined;
|
|
|
|
try {
|
|
for (var _iterator2 = binds[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
var bind = _step2.value;
|
|
|
|
bind.func.bind(this)();
|
|
}
|
|
} catch (err) {
|
|
_didIteratorError2 = true;
|
|
_iteratorError2 = err;
|
|
} finally {
|
|
try {
|
|
if (!_iteratorNormalCompletion2 && _iterator2.return) {
|
|
_iterator2.return();
|
|
}
|
|
} finally {
|
|
if (_didIteratorError2) {
|
|
throw _iteratorError2;
|
|
}
|
|
}
|
|
}
|
|
|
|
return this;
|
|
};
|
|
}
|
|
|
|
var Base = (_class = function () {
|
|
function Base() {
|
|
_classCallCheck(this, Base);
|
|
|
|
this.attr1 = 'attr1';
|
|
console.log("Constructor");
|
|
}
|
|
|
|
_createClass(Base, [{
|
|
key: 'method1',
|
|
value: function method1() {
|
|
var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
|
|
console.log("this.attr1 = ", this.attr1);
|
|
console.log("a = ", a, "b = ", b);
|
|
}
|
|
}, {
|
|
key: 'on',
|
|
value: function on(methodName, func) {
|
|
this[methodName] = this[methodName].bind(this, { func: func });
|
|
}
|
|
}]);
|
|
|
|
return Base;
|
|
}(), _applyDecoratedDescriptor(_class.prototype, 'method1', [onBind], Object.getOwnPropertyDescriptor(_class.prototype, 'method1'), _class.prototype), _class);
|
|
|
|
var b = new Base();
|
|
|
|
b.on("method1", function () {
|
|
return console.log("Another message...");
|
|
});
|
|
b.on("method1", function () {
|
|
console.log("bind this.attr1 =", this.attr1);
|
|
});
|
|
|
|
b.method1("one", 2);
|
|
b.method1("bbb");
|
|
|
|
if (true) {
|
|
console.log("Dev mode message");
|
|
}
|
|
|
|
function a(_ref) {
|
|
var _ref$a = _ref.a,
|
|
a = _ref$a === undefined ? 2 : _ref$a,
|
|
_ref$b = _ref.b,
|
|
b = _ref$b === undefined ? a + 4 : _ref$b;
|
|
}
|
|
|
|
/***/ }
|
|
/******/ ]); |