Enable external-helpers by default in tests (#12911)

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Babel Bot <babel-bot@users.noreply.github.com>
This commit is contained in:
Nicolò Ribaudo
2021-02-26 23:33:26 +01:00
committed by GitHub
parent bfd30b9445
commit ea6a438315
591 changed files with 1859 additions and 4233 deletions

View File

@@ -1,7 +1,5 @@
function _readOnlyError(name) { throw new TypeError("\"" + name + "\" is read-only"); }
(function () {
var a = "foo";
if (false) a = (_readOnlyError("a"), "false");
if (false) a = (babelHelpers.readOnlyError("a"), "false");
return a;
})();

View File

@@ -1,5 +1,3 @@
function _readOnlyError(name) { throw new TypeError("\"" + name + "\" is read-only"); }
var a = 1,
b = 2;
a = (_readOnlyError("a"), 3);
a = (babelHelpers.readOnlyError("a"), 3);

View File

@@ -1,5 +1,3 @@
function _readOnlyError(name) { throw new TypeError("\"" + name + "\" is read-only"); }
for (var i = 0; i < 3; i = (_readOnlyError("i"), i + 1)) {
for (var i = 0; i < 3; i = (babelHelpers.readOnlyError("i"), i + 1)) {
console.log(i);
}

View File

@@ -1,8 +1,6 @@
function _readOnlyError(name) { throw new TypeError("\"" + name + "\" is read-only"); }
var c = 17;
var a = 0;
function f() {
return (_readOnlyError("c"), ++c) + --a;
return (babelHelpers.readOnlyError("c"), ++c) + --a;
}

View File

@@ -1,4 +1,2 @@
function _readOnlyError(name) { throw new TypeError("\"" + name + "\" is read-only"); }
var MULTIPLIER = 5;
MULTIPLIER = (_readOnlyError("MULTIPLIER"), "overwrite");
MULTIPLIER = (babelHelpers.readOnlyError("MULTIPLIER"), "overwrite");

View File

@@ -1,9 +1,6 @@
function _readOnlyError(name) { throw new TypeError("\"" + name + "\" is read-only"); }
var MULTIPLIER = 5;
for (MULTIPLIER in arr) {
_readOnlyError("MULTIPLIER");
babelHelpers.readOnlyError("MULTIPLIER");
;
}

View File

@@ -1,4 +1,2 @@
function _readOnlyError(name) { throw new TypeError("\"" + name + "\" is read-only"); }
var a = "str";
_readOnlyError("a"), --a;
babelHelpers.readOnlyError("a"), --a;

View File

@@ -1,4 +1,2 @@
function _readOnlyError(name) { throw new TypeError("\"" + name + "\" is read-only"); }
var foo = 1;
_readOnlyError("foo"), foo++;
babelHelpers.readOnlyError("foo"), foo++;

View File

@@ -4,7 +4,6 @@
"syntax-jsx",
"transform-react-jsx",
"transform-block-scoped-functions",
"transform-for-of",
["external-helpers", { "helperVersion": "7.100.0" }]
"transform-for-of"
]
}

View File

@@ -1,10 +1,6 @@
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
if (true) {
var _run = /*#__PURE__*/function () {
var _ref = _asyncToGenerator(function* () {
var _ref = babelHelpers.asyncToGenerator(function* () {
return true;
});

View File

@@ -1,5 +1,3 @@
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
var _loop = function (foo, bar) {
() => foo;
@@ -14,7 +12,7 @@ for (var _ref of {}) {
var {
foo
} = _ref,
bar = _objectWithoutPropertiesLoose(_ref, ["foo"]);
bar = babelHelpers.objectWithoutPropertiesLoose(_ref, ["foo"]);
_loop(foo, bar);
}

View File

@@ -1,6 +1,3 @@
{
"plugins": [
["transform-block-scoping", { "tdz": true }],
["external-helpers", { "helperVersion": "7.1000.0" }]
]
"plugins": [["transform-block-scoping", { "tdz": true }]]
}