also visit ClassProperty's for rest param deopt check, fixes #T7311 (#3481)
This commit is contained in:
@@ -30,7 +30,7 @@ let memberExpressionOptimisationVisitor = {
|
||||
path.skip();
|
||||
},
|
||||
|
||||
Function(path, state) {
|
||||
"Function|ClassProperty": function (path, state) {
|
||||
// Detect whether any reference to rest is contained in nested functions to
|
||||
// determine if deopt is necessary.
|
||||
let oldNoOptimise = state.noOptimise;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"plugins": ["external-helpers", "syntax-flow", "transform-es2015-parameters", "transform-es2015-block-scoping", "transform-es2015-spread", "transform-es2015-classes", "transform-es2015-destructuring", "transform-es2015-arrow-functions", "syntax-async-functions", "transform-es2015-for-of"]
|
||||
"plugins": ["transform-class-properties", "external-helpers", "syntax-flow", "transform-es2015-parameters", "transform-es2015-block-scoping", "transform-es2015-spread", "transform-es2015-classes", "transform-es2015-destructuring", "transform-es2015-arrow-functions", "syntax-async-functions", "transform-es2015-for-of"]
|
||||
}
|
||||
|
||||
@@ -27,3 +27,10 @@ var x = (...rest) => {
|
||||
if (noNeedToWork) return 0;
|
||||
return rest;
|
||||
};
|
||||
|
||||
var innerclassproperties = (...args) => (
|
||||
class {
|
||||
static args = args;
|
||||
args = args;
|
||||
}
|
||||
);
|
||||
@@ -37,3 +37,16 @@ var x = function () {
|
||||
if (noNeedToWork) return 0;
|
||||
return rest;
|
||||
};
|
||||
|
||||
var innerclassproperties = function () {
|
||||
var _class, _temp;
|
||||
|
||||
for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
||||
args[_key3] = arguments[_key3];
|
||||
}
|
||||
|
||||
return _temp = _class = function _class() {
|
||||
babelHelpers.classCallCheck(this, _class);
|
||||
this.args = args;
|
||||
}, _class.args = args, _temp;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user