Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
liuxingbaoyu committed Sep 26, 2022
1 parent e421bce commit 698ebce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
@@ -1,12 +1,13 @@
{
"plugins": [
["proposal-decorators", { "legacy": true }]
],
"plugins": [["proposal-decorators", { "version": "legacy" }]],
"presets": [
["env", {
"targets": {
"node": 8
[
"env",
{
"targets": {
"node": 8
}
}
}]
]
]
}
Expand Up @@ -7,16 +7,14 @@ exports.default = wrap;

var _coreDecorators = require("core-decorators");

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 wrap() {
return function () {
var _class;

let Foo = (_class = class Foo {
method() {}

}, (_applyDecoratedDescriptor(_class.prototype, "method", [_coreDecorators.autobind], Object.getOwnPropertyDescriptor(_class.prototype, "method"), _class.prototype)), _class);
}, (babelHelpers.applyDecoratedDescriptor(_class.prototype, "method", [_coreDecorators.autobind], Object.getOwnPropertyDescriptor(_class.prototype, "method"), _class.prototype)), _class);
return Foo;
};
}

0 comments on commit 698ebce

Please sign in to comment.