also visit ClassProperty's for rest param deopt check, fixes #T7311 (#3481)

This commit is contained in:
Jay Phelps
2016-05-13 14:18:14 -07:00
committed by Henry Zhu
parent dc1f40540d
commit 330071e59d
4 changed files with 22 additions and 2 deletions

View File

@@ -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;

View File

@@ -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"]
}

View File

@@ -27,3 +27,10 @@ var x = (...rest) => {
if (noNeedToWork) return 0;
return rest;
};
var innerclassproperties = (...args) => (
class {
static args = args;
args = args;
}
);

View File

@@ -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;
};