Mark class prototype as read-only (#12115)
* initial code 2 fix the issue #2025 * Mark class prototype as read-only * Update fixtures * Fix failure * Update Babel 8 fixtures * Disable in loose mode * Update fixtures Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
var _createClass = require("<CWD>/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/subfolder/node_modules/@babel/runtime/helpers/createClass.js");
|
||||
|
||||
var _classCallCheck = require("<CWD>/packages/babel-plugin-transform-runtime/test/fixtures/absoluteRuntime/relative/subfolder/node_modules/@babel/runtime/helpers/classCallCheck.js");
|
||||
|
||||
let Foo = function Foo() {
|
||||
let Foo = /*#__PURE__*/_createClass(function Foo() {
|
||||
"use strict";
|
||||
|
||||
_classCallCheck(this, Foo);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
// empty
|
||||
@@ -1,7 +1,9 @@
|
||||
var _createClass = require("<CWD>/packages/babel-runtime/helpers/createClass.js");
|
||||
|
||||
var _classCallCheck = require("<CWD>/packages/babel-runtime/helpers/classCallCheck.js");
|
||||
|
||||
let Foo = function Foo() {
|
||||
let Foo = /*#__PURE__*/_createClass(function Foo() {
|
||||
"use strict";
|
||||
|
||||
_classCallCheck(this, Foo);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
var _createClass = require("<CWD>/packages/babel-runtime/helpers/createClass.js");
|
||||
|
||||
var _classCallCheck = require("<CWD>/packages/babel-runtime/helpers/classCallCheck.js");
|
||||
|
||||
let Foo = function Foo() {
|
||||
let Foo = /*#__PURE__*/_createClass(function Foo() {
|
||||
"use strict";
|
||||
|
||||
_classCallCheck(this, Foo);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
|
||||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
||||
|
||||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
||||
|
||||
let A = function A() {
|
||||
let A = /*#__PURE__*/(0, _createClass2.default)(function A() {
|
||||
(0, _classCallCheck2.default)(this, A);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
||||
|
||||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
||||
|
||||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
||||
|
||||
let A = function A() {
|
||||
let A = /*#__PURE__*/(0, _createClass2.default)(function A() {
|
||||
(0, _classCallCheck2.default)(this, A);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import _createClass from "@babel/runtime/helpers/createClass";
|
||||
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
||||
|
||||
let A = function A() {
|
||||
let A = /*#__PURE__*/_createClass(function A() {
|
||||
_classCallCheck(this, A);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import _createClass from "@babel/runtime/helpers/createClass";
|
||||
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
||||
|
||||
let A = function A() {
|
||||
let A = /*#__PURE__*/_createClass(function A() {
|
||||
_classCallCheck(this, A);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
var _createClass = require("@babel/runtime/helpers/createClass").default;
|
||||
|
||||
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck").default;
|
||||
|
||||
let A = function A() {
|
||||
let A = /*#__PURE__*/_createClass(function A() {
|
||||
"use strict";
|
||||
|
||||
_classCallCheck(this, A);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
var _createClass = require("@babel/runtime/helpers/createClass");
|
||||
|
||||
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
||||
|
||||
let A = function A() {
|
||||
let A = /*#__PURE__*/_createClass(function A() {
|
||||
"use strict";
|
||||
|
||||
_classCallCheck(this, A);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
||||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
||||
|
||||
let A = function A() {
|
||||
let A = /*#__PURE__*/_createClass(function A() {
|
||||
_classCallCheck(this, A);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
||||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
||||
|
||||
let A = function A() {
|
||||
let A = /*#__PURE__*/_createClass(function A() {
|
||||
_classCallCheck(this, A);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import _Reflect$construct from "@babel/runtime-corejs3/core-js-stable/reflect/construct";
|
||||
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
|
||||
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
|
||||
import _assertThisInitialized from "@babel/runtime-corejs3/helpers/assertThisInitialized";
|
||||
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
|
||||
@@ -30,5 +31,5 @@ let B = /*#__PURE__*/function (_A) {
|
||||
return _this;
|
||||
}
|
||||
|
||||
return B;
|
||||
return _createClass(B);
|
||||
}(A);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
var _createClass = require("@babel/runtime-corejs2/helpers/createClass");
|
||||
|
||||
var _classCallCheck = require("@babel/runtime-corejs2/helpers/classCallCheck");
|
||||
|
||||
let Foo = function Foo() {
|
||||
let Foo = /*#__PURE__*/_createClass(function Foo() {
|
||||
"use strict";
|
||||
|
||||
_classCallCheck(this, Foo);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
||||
|
||||
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); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); _Object$defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
let Foo = function Foo() {
|
||||
let Foo = /*#__PURE__*/_createClass(function Foo() {
|
||||
"use strict";
|
||||
|
||||
_classCallCheck(this, Foo);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
var _createClass = require("@babel/runtime-corejs3/helpers/createClass");
|
||||
|
||||
var _classCallCheck = require("@babel/runtime-corejs3/helpers/classCallCheck");
|
||||
|
||||
let Foo = function Foo() {
|
||||
let Foo = /*#__PURE__*/_createClass(function Foo() {
|
||||
"use strict";
|
||||
|
||||
_classCallCheck(this, Foo);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
||||
|
||||
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); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); _Object$defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
let Foo = function Foo() {
|
||||
let Foo = /*#__PURE__*/_createClass(function Foo() {
|
||||
"use strict";
|
||||
|
||||
_classCallCheck(this, Foo);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
var _createClass = require("@babel/runtime/helpers/createClass");
|
||||
|
||||
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
||||
|
||||
let Foo = function Foo() {
|
||||
let Foo = /*#__PURE__*/_createClass(function Foo() {
|
||||
"use strict";
|
||||
|
||||
_classCallCheck(this, Foo);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
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); } }
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
let Foo = function Foo() {
|
||||
let Foo = /*#__PURE__*/_createClass(function Foo() {
|
||||
"use strict";
|
||||
|
||||
_classCallCheck(this, Foo);
|
||||
};
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import _Reflect$construct from "@babel/runtime-corejs2/core-js/reflect/construct";
|
||||
import _createClass from "@babel/runtime-corejs2/helpers/esm/createClass";
|
||||
import _classCallCheck from "@babel/runtime-corejs2/helpers/esm/classCallCheck";
|
||||
import _inherits from "@babel/runtime-corejs2/helpers/esm/inherits";
|
||||
import _possibleConstructorReturn from "@babel/runtime-corejs2/helpers/esm/possibleConstructorReturn";
|
||||
@@ -19,5 +20,5 @@ let Foo = /*#__PURE__*/function (_Bar) {
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return Foo;
|
||||
return _createClass(Foo);
|
||||
}(Bar);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import _Reflect$construct from "@babel/runtime-corejs2/core-js/reflect/construct";
|
||||
import _createClass from "@babel/runtime-corejs2/helpers/createClass";
|
||||
import _classCallCheck from "@babel/runtime-corejs2/helpers/classCallCheck";
|
||||
import _inherits from "@babel/runtime-corejs2/helpers/inherits";
|
||||
import _possibleConstructorReturn from "@babel/runtime-corejs2/helpers/possibleConstructorReturn";
|
||||
@@ -19,5 +20,5 @@ let Foo = /*#__PURE__*/function (_Bar) {
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return Foo;
|
||||
return _createClass(Foo);
|
||||
}(Bar);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
var _createClass = require("@babel/runtime/helpers/createClass");
|
||||
|
||||
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
||||
|
||||
var _inherits = require("@babel/runtime/helpers/inherits");
|
||||
@@ -23,5 +25,5 @@ let Foo = /*#__PURE__*/function (_Bar) {
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return Foo;
|
||||
return _createClass(Foo);
|
||||
}(Bar);
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
var _createClass = require("@babel/runtime/helpers/createClass");
|
||||
|
||||
var _classCallCheck = require("@babel/runtime/helpers/classCallCheck");
|
||||
|
||||
var _inherits = require("@babel/runtime/helpers/inherits");
|
||||
@@ -23,5 +25,5 @@ let Foo = /*#__PURE__*/function (_Bar) {
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return Foo;
|
||||
return _createClass(Foo);
|
||||
}(Bar);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
||||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
||||
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
||||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
||||
@@ -18,5 +19,5 @@ let Foo = /*#__PURE__*/function (_Bar) {
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return Foo;
|
||||
return _createClass(Foo);
|
||||
}(Bar);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
||||
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
||||
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
||||
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
|
||||
@@ -18,5 +19,5 @@ let Foo = /*#__PURE__*/function (_Bar) {
|
||||
return _super.apply(this, arguments);
|
||||
}
|
||||
|
||||
return Foo;
|
||||
return _createClass(Foo);
|
||||
}(Bar);
|
||||
|
||||
Reference in New Issue
Block a user