Renamed files
This commit is contained in:
parent
07e69c009b
commit
0f42accb87
@ -0,0 +1,5 @@
|
||||
try {
|
||||
throw 0;
|
||||
} catch ([message]) {
|
||||
console.log("it failed, but this code executes");
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
try {
|
||||
throw 0;
|
||||
} catch {
|
||||
console.log("it failed, but this code executes");
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
try {
|
||||
throw 0;
|
||||
} catch ({
|
||||
message
|
||||
}) {
|
||||
console.log("it failed, but this code executes");
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
try {
|
||||
throw 0;
|
||||
} catch ([message]) {
|
||||
console.log(message);
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
try {
|
||||
throw 0;
|
||||
} catch (e) {
|
||||
e = new TypeError('A new variable is not being declared or initialized; the catch binding is being referenced and cannot be removed.');
|
||||
}
|
||||
@ -0,0 +1,5 @@
|
||||
try {
|
||||
throw 0;
|
||||
} catch (err) {
|
||||
console.log(err, "it failed, but this code executes");
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
try {
|
||||
throw 0;
|
||||
} catch ({
|
||||
message
|
||||
}) {
|
||||
console.log(message);
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
try {
|
||||
throw 0;
|
||||
} catch (err) {
|
||||
console.log(err, "it failed, but this code executes");
|
||||
} finally {
|
||||
console.log("this code also executes");
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
class A {
|
||||
prop1 = () => this;
|
||||
static prop2 = () => this;
|
||||
prop3 = () => arguments;
|
||||
static prop4 = () => arguments;
|
||||
prop5 = this;
|
||||
static prop6 = this;
|
||||
prop7 = arguments;
|
||||
static prop8 = arguments;
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
export function foo() {}
|
||||
export function bar() {}
|
||||
7
packages/babel-core/test/fixtures/transformation/misc/regression-1130/output.js
vendored
Normal file
7
packages/babel-core/test/fixtures/transformation/misc/regression-1130/output.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
function A() {
|
||||
var a;
|
||||
}
|
||||
|
||||
function B() {
|
||||
var a;
|
||||
}
|
||||
3
packages/babel-core/test/fixtures/transformation/misc/regression-1149/output.js
vendored
Normal file
3
packages/babel-core/test/fixtures/transformation/misc/regression-1149/output.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
function foo(bar) {
|
||||
var bar = bar[0];
|
||||
}
|
||||
18
packages/babel-core/test/fixtures/transformation/misc/regression-1155/output.js
vendored
Normal file
18
packages/babel-core/test/fixtures/transformation/misc/regression-1155/output.js
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
var Foo =
|
||||
/*#__PURE__*/
|
||||
function (_Bar) {
|
||||
babelHelpers.inherits(Foo, _Bar);
|
||||
|
||||
function Foo(options) {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
var parentOptions = {};
|
||||
|
||||
parentOptions.init = function () {
|
||||
this;
|
||||
};
|
||||
|
||||
return babelHelpers.possibleConstructorReturn(this, (Foo.__proto__ || Object.getPrototypeOf(Foo)).call(this, parentOptions));
|
||||
}
|
||||
|
||||
return Foo;
|
||||
}(Bar);
|
||||
4
packages/babel-core/test/fixtures/transformation/misc/regression-1168/output.js
vendored
Normal file
4
packages/babel-core/test/fixtures/transformation/misc/regression-1168/output.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
function test() {
|
||||
var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "hi";
|
||||
return x;
|
||||
}
|
||||
12
packages/babel-core/test/fixtures/transformation/misc/regression-1169/output.js
vendored
Normal file
12
packages/babel-core/test/fixtures/transformation/misc/regression-1169/output.js
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
function foo() {
|
||||
var input = ['a', 'b', 'c'];
|
||||
var output = {};
|
||||
|
||||
for (var _i = 0; _i < input.length; _i++) {
|
||||
var c = input[_i];
|
||||
var name = c;
|
||||
output[name] = name;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
8
packages/babel-core/test/fixtures/transformation/misc/regression-1199/output.js
vendored
Normal file
8
packages/babel-core/test/fixtures/transformation/misc/regression-1199/output.js
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
const bug = 1;
|
||||
|
||||
function foo() {}
|
||||
|
||||
function bar() {
|
||||
var bug;
|
||||
bug = 2;
|
||||
}
|
||||
20
packages/babel-core/test/fixtures/transformation/misc/regression-2364/output.js
vendored
Normal file
20
packages/babel-core/test/fixtures/transformation/misc/regression-2364/output.js
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
function wrapper(fn) {
|
||||
return function () {
|
||||
var _arguments = arguments;
|
||||
|
||||
var _loop = function () {
|
||||
var val = fn(..._arguments);
|
||||
return {
|
||||
v: val.test(function () {
|
||||
console.log(val);
|
||||
})
|
||||
};
|
||||
};
|
||||
|
||||
while (someCondition) {
|
||||
var _ret = _loop();
|
||||
|
||||
if (typeof _ret === "object") return _ret.v;
|
||||
}
|
||||
};
|
||||
}
|
||||
36
packages/babel-core/test/fixtures/transformation/misc/regression-2765/output.js
vendored
Normal file
36
packages/babel-core/test/fixtures/transformation/misc/regression-2765/output.js
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
function f() {
|
||||
var _this = this;
|
||||
|
||||
let g =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var _ref = babelHelpers.asyncToGenerator(function* () {
|
||||
_this;
|
||||
});
|
||||
|
||||
return function g() {
|
||||
return _ref.apply(this, arguments);
|
||||
};
|
||||
}();
|
||||
}
|
||||
|
||||
class Class {
|
||||
m() {
|
||||
var _this2 = this;
|
||||
|
||||
return babelHelpers.asyncToGenerator(function* () {
|
||||
var c =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
var _ref2 = babelHelpers.asyncToGenerator(function* (b) {
|
||||
_this2;
|
||||
});
|
||||
|
||||
return function c(_x) {
|
||||
return _ref2.apply(this, arguments);
|
||||
};
|
||||
}();
|
||||
})();
|
||||
}
|
||||
|
||||
}
|
||||
104
packages/babel-core/test/fixtures/transformation/misc/regression-2892/output.js
vendored
Normal file
104
packages/babel-core/test/fixtures/transformation/misc/regression-2892/output.js
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }
|
||||
|
||||
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function step(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 _next(value) { step("next", value); } function _throw(err) { step("throw", err); } _next(); }); }; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!_instanceof(instance, Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
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); return Constructor; }
|
||||
|
||||
var Foo =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function Foo() {
|
||||
_classCallCheck(this, Foo);
|
||||
}
|
||||
|
||||
_createClass(Foo, [{
|
||||
key: "bar",
|
||||
value: function () {
|
||||
var _bar = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee() {
|
||||
var baz;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
case 0:
|
||||
baz = 0;
|
||||
|
||||
case 1:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
}
|
||||
}, _callee, this);
|
||||
}));
|
||||
|
||||
return function bar() {
|
||||
return _bar.apply(this, arguments);
|
||||
};
|
||||
}()
|
||||
}]);
|
||||
|
||||
return Foo;
|
||||
}();
|
||||
|
||||
exports.default = Foo;
|
||||
|
||||
function foo() {
|
||||
return _foo.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _foo() {
|
||||
_foo = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee3() {
|
||||
var bar, _bar2;
|
||||
|
||||
return regeneratorRuntime.wrap(function _callee3$(_context3) {
|
||||
while (1) {
|
||||
switch (_context3.prev = _context3.next) {
|
||||
case 0:
|
||||
_bar2 = function _ref2() {
|
||||
_bar2 = _asyncToGenerator(
|
||||
/*#__PURE__*/
|
||||
regeneratorRuntime.mark(function _callee2() {
|
||||
var baz;
|
||||
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
||||
while (1) {
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
baz = {};
|
||||
|
||||
case 1:
|
||||
case "end":
|
||||
return _context2.stop();
|
||||
}
|
||||
}
|
||||
}, _callee2, this);
|
||||
}));
|
||||
return _bar2.apply(this, arguments);
|
||||
};
|
||||
|
||||
bar = function _ref() {
|
||||
return _bar2.apply(this, arguments);
|
||||
};
|
||||
|
||||
case 2:
|
||||
case "end":
|
||||
return _context3.stop();
|
||||
}
|
||||
}
|
||||
}, _callee3, this);
|
||||
}));
|
||||
return _foo.apply(this, arguments);
|
||||
}
|
||||
6
packages/babel-core/test/fixtures/transformation/misc/regression-4855/output.js
vendored
Normal file
6
packages/babel-core/test/fixtures/transformation/misc/regression-4855/output.js
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
var _values = values;
|
||||
var _fieldName = fieldName;
|
||||
value = _values[_fieldName];
|
||||
rest = babelHelpers.objectWithoutProperties(_values, [_fieldName].map(babelHelpers.toPropertyKey));
|
||||
_values;
|
||||
var error;
|
||||
2
packages/babel-core/test/fixtures/transformation/misc/shebang/output.js
vendored
Normal file
2
packages/babel-core/test/fixtures/transformation/misc/shebang/output.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
foobar();
|
||||
3
packages/babel-core/test/fixtures/transformation/source-maps/arrow-function/output.js
vendored
Normal file
3
packages/babel-core/test/fixtures/transformation/source-maps/arrow-function/output.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
var t = function t(x) {
|
||||
return x * x;
|
||||
};
|
||||
18
packages/babel-core/test/fixtures/transformation/source-maps/class/output.js
vendored
Normal file
18
packages/babel-core/test/fixtures/transformation/source-maps/class/output.js
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
var Test =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function Test() {
|
||||
babelHelpers.classCallCheck(this, Test);
|
||||
}
|
||||
|
||||
babelHelpers.createClass(Test, [{
|
||||
key: "bar",
|
||||
get: function () {
|
||||
throw new Error("wow");
|
||||
}
|
||||
}]);
|
||||
return Test;
|
||||
}();
|
||||
|
||||
var test = new Test();
|
||||
test.bar;
|
||||
3
packages/babel-core/test/fixtures/transformation/source-maps/full/output.js
vendored
Normal file
3
packages/babel-core/test/fixtures/transformation/source-maps/full/output.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
arr.map(function (x) {
|
||||
return x * x;
|
||||
});
|
||||
4
packages/babel-core/test/fixtures/transformation/source-maps/inline/output.js
vendored
Normal file
4
packages/babel-core/test/fixtures/transformation/source-maps/inline/output.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
arr.map(function (x) {
|
||||
return x * x;
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNvdXJjZS1tYXBzL2lubGluZS9pbnB1dC5qcyJdLCJuYW1lcyI6WyJhcnIiLCJtYXAiLCJ4Il0sIm1hcHBpbmdzIjoiQUFBQUEsSUFBSUMsR0FBSixDQUFRO0FBQUEsU0FBS0MsSUFBSUEsQ0FBVDtBQUFBLENBQVIiLCJmaWxlIjoic291cmNlLW1hcHMvaW5saW5lL291dHB1dC5qcyIsInNvdXJjZXNDb250ZW50IjpbImFyci5tYXAoeCA9PiB4ICogeCk7Il19
|
||||
3
packages/babel-core/test/fixtures/transformation/source-maps/input-source-map/output.js
vendored
Normal file
3
packages/babel-core/test/fixtures/transformation/source-maps/input-source-map/output.js
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
var foo = function () {
|
||||
return 4;
|
||||
};
|
||||
7
packages/babel-generator/test/fixtures/auto-indentation/hard-tab/output.js
vendored
Normal file
7
packages/babel-generator/test/fixtures/auto-indentation/hard-tab/output.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
function foo() {
|
||||
bar();
|
||||
|
||||
if (foo) {
|
||||
bar();
|
||||
}
|
||||
}
|
||||
7
packages/babel-generator/test/fixtures/auto-indentation/soft-tab-2/output.js
vendored
Normal file
7
packages/babel-generator/test/fixtures/auto-indentation/soft-tab-2/output.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
function foo() {
|
||||
bar();
|
||||
|
||||
if (foo) {
|
||||
bar();
|
||||
}
|
||||
}
|
||||
7
packages/babel-generator/test/fixtures/auto-indentation/soft-tab-4/output.js
vendored
Normal file
7
packages/babel-generator/test/fixtures/auto-indentation/soft-tab-4/output.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
function foo() {
|
||||
bar();
|
||||
|
||||
if (foo) {
|
||||
bar();
|
||||
}
|
||||
}
|
||||
5
packages/babel-generator/test/fixtures/auto-string/double/output.js
vendored
Normal file
5
packages/babel-generator/test/fixtures/auto-string/double/output.js
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
foo("foo");
|
||||
foo("foo\nlol");
|
||||
foo("foo\n\"lol");
|
||||
foo("foo\n\"'lol");
|
||||
foo("😂");
|
||||
9
packages/babel-generator/test/fixtures/auto-string/jsx/output.js
vendored
Normal file
9
packages/babel-generator/test/fixtures/auto-string/jsx/output.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
var single = 'quotes';
|
||||
var outnumber = 'double';
|
||||
var moreSingleQuotesThanDouble = '!';
|
||||
React.createClass({
|
||||
render() {
|
||||
return <View multiple="attributes" attribute="If parent is JSX keep double quote" />;
|
||||
}
|
||||
|
||||
});
|
||||
5
packages/babel-generator/test/fixtures/auto-string/single/output.js
vendored
Normal file
5
packages/babel-generator/test/fixtures/auto-string/single/output.js
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
foo('foo');
|
||||
foo('foo\nlol');
|
||||
foo('foo\n"lol');
|
||||
foo('foo\n"\'lol');
|
||||
foo('😂');
|
||||
6
packages/babel-generator/test/fixtures/comments/2-space-multi-comment-with-space/output.js
vendored
Normal file
6
packages/babel-generator/test/fixtures/comments/2-space-multi-comment-with-space/output.js
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
function test() {
|
||||
/*
|
||||
* this is comment
|
||||
*/
|
||||
var i = 20;
|
||||
}
|
||||
6
packages/babel-generator/test/fixtures/comments/2-space-multi-comment/output.js
vendored
Normal file
6
packages/babel-generator/test/fixtures/comments/2-space-multi-comment/output.js
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
function test() {
|
||||
/*
|
||||
* this is comment
|
||||
*/
|
||||
var i = 20;
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
{ print("hello"); // comment
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
{
|
||||
print("hello");
|
||||
// comment
|
||||
}
|
||||
4
packages/babel-generator/test/fixtures/comments/block-line-comment/output.js
vendored
Normal file
4
packages/babel-generator/test/fixtures/comments/block-line-comment/output.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
// Leading to block
|
||||
{
|
||||
print("hello");
|
||||
}
|
||||
6
packages/babel-generator/test/fixtures/comments/comment-only-with-space/output.js
vendored
Normal file
6
packages/babel-generator/test/fixtures/comments/comment-only-with-space/output.js
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
// from #23
|
||||
|
||||
/**/
|
||||
|
||||
/*
|
||||
*/
|
||||
6
packages/babel-generator/test/fixtures/comments/comment-only/output.js
vendored
Normal file
6
packages/babel-generator/test/fixtures/comments/comment-only/output.js
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
// from #23
|
||||
|
||||
/**/
|
||||
|
||||
/*
|
||||
*/
|
||||
@ -0,0 +1,5 @@
|
||||
// comment
|
||||
print("hello");
|
||||
|
||||
// comment2
|
||||
print("hello2");
|
||||
12
packages/babel-generator/test/fixtures/comments/computed-property-comments-2/output.js
vendored
Normal file
12
packages/babel-generator/test/fixtures/comments/computed-property-comments-2/output.js
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
var test = {
|
||||
/**
|
||||
* Before bracket init
|
||||
*/
|
||||
["a"]: "1",
|
||||
[
|
||||
/*
|
||||
* Inside bracket init
|
||||
*/
|
||||
"b"]: "2"
|
||||
},
|
||||
ok = 42;
|
||||
22
packages/babel-generator/test/fixtures/comments/computed-property-comments/output.js
vendored
Normal file
22
packages/babel-generator/test/fixtures/comments/computed-property-comments/output.js
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
var test = {
|
||||
/**
|
||||
* Before bracket init
|
||||
*/
|
||||
["a"]: "1",
|
||||
[
|
||||
/*
|
||||
* Inside bracket init
|
||||
*/
|
||||
"b"]: "2",
|
||||
["c"
|
||||
/*
|
||||
* After bracket key
|
||||
*/
|
||||
]: "3",
|
||||
// Before bracket, line comment
|
||||
["d"]: "4",
|
||||
[// Inside bracket, line comment
|
||||
"e"]: "5",
|
||||
["f" // After bracket, line comment
|
||||
]: "6"
|
||||
};
|
||||
2
packages/babel-generator/test/fixtures/comments/do-while-line-comment/output.js
vendored
Normal file
2
packages/babel-generator/test/fixtures/comments/do-while-line-comment/output.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
do {} // LINE
|
||||
while (true);
|
||||
4
packages/babel-generator/test/fixtures/comments/empty-line-comment/output.js
vendored
Normal file
4
packages/babel-generator/test/fixtures/comments/empty-line-comment/output.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
function test() {
|
||||
// Leading to EmptyStatement
|
||||
; // Trailing to EmptyStatement
|
||||
}
|
||||
11
packages/babel-generator/test/fixtures/comments/function-block-line-comment/output.js
vendored
Normal file
11
packages/babel-generator/test/fixtures/comments/function-block-line-comment/output.js
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
!function () {} //
|
||||
, 42;
|
||||
!{
|
||||
get 42() {} //
|
||||
,
|
||||
|
||||
foo: 42
|
||||
};
|
||||
|
||||
(function () {} //
|
||||
);
|
||||
4
packages/babel-generator/test/fixtures/comments/if-block-line-comment/output.js
vendored
Normal file
4
packages/babel-generator/test/fixtures/comments/if-block-line-comment/output.js
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
if (cond) // Leading to if-block
|
||||
{
|
||||
print("hello");
|
||||
} // Trailing to if-block
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user