Rename all proposal plugins to -proposal- from -transform- (#6570)
This commit is contained in:
3
packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/bind/actual.js
vendored
Normal file
3
packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/bind/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var f = ctx::ns.obj.func;
|
||||
var g = ::ns.obj.func;
|
||||
var h = new X::y;
|
||||
7
packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/bind/expected.js
vendored
Normal file
7
packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/bind/expected.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
var _context;
|
||||
|
||||
var f = (_context = ctx, ns.obj.func).bind(_context);
|
||||
|
||||
var g = (_context = ns.obj).func.bind(_context);
|
||||
|
||||
var h = (_context = new X(), y).bind(_context);
|
||||
4
packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/call/actual.js
vendored
Normal file
4
packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/call/actual.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
ctx::ns.obj.func();
|
||||
::ns.obj.func();
|
||||
|
||||
ns.obj2::ns.obj1.func();
|
||||
7
packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/call/expected.js
vendored
Normal file
7
packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/call/expected.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
var _context;
|
||||
|
||||
(_context = ctx, ns.obj.func).call(_context);
|
||||
|
||||
(_context = ns.obj).func.call(_context);
|
||||
|
||||
(_context = ns.obj2, ns.obj1.func).call(_context);
|
||||
@@ -0,0 +1,6 @@
|
||||
import { map, takeWhile, forEach } from "iterlib";
|
||||
|
||||
getPlayers()
|
||||
::map(x => x.character())
|
||||
::takeWhile(x => x.strength > 100)
|
||||
::forEach(x => console.log(x));
|
||||
29
packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/complex-call/exec.js
vendored
Normal file
29
packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/complex-call/exec.js
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
var operations = [];
|
||||
|
||||
var lib = {};
|
||||
|
||||
['f', 'g', 'h'].forEach(function (key) {
|
||||
var func = function () {
|
||||
return operations.push("lib." + key + "()");
|
||||
};
|
||||
Object.defineProperty(lib, key, {
|
||||
get: function () {
|
||||
operations.push("get lib." + key);
|
||||
return func;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
({prop:'value'})
|
||||
::lib.f()
|
||||
::lib.g()
|
||||
::lib.h();
|
||||
|
||||
assert.deepEqual(operations, [
|
||||
'get lib.f',
|
||||
'lib.f()',
|
||||
'get lib.g',
|
||||
'lib.g()',
|
||||
'get lib.h',
|
||||
'lib.h()'
|
||||
]);
|
||||
@@ -0,0 +1,10 @@
|
||||
var _context;
|
||||
|
||||
import { map, takeWhile, forEach } from "iterlib";
|
||||
(_context = (_context = (_context = getPlayers(), map).call(_context, function (x) {
|
||||
return x.character();
|
||||
}), takeWhile).call(_context, function (x) {
|
||||
return x.strength > 100;
|
||||
}), forEach).call(_context, function (x) {
|
||||
return console.log(x);
|
||||
});
|
||||
3
packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/options.json
vendored
Normal file
3
packages/babel-plugin-proposal-function-bind/test/fixtures/function-bind/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["proposal-function-bind", "transform-es2015-arrow-functions"]
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
var bar = function () {};
|
||||
foo::bar;
|
||||
|
||||
var foo = {};
|
||||
::foo.bar;
|
||||
@@ -0,0 +1,5 @@
|
||||
var bar = function () {};
|
||||
|
||||
bar.bind(foo);
|
||||
var foo = {};
|
||||
foo.bar.bind(foo);
|
||||
3
packages/babel-plugin-proposal-function-bind/test/fixtures/regression/6458/actual.js
vendored
Normal file
3
packages/babel-plugin-proposal-function-bind/test/fixtures/regression/6458/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import Obj from "./file";
|
||||
|
||||
console.log(::Obj.method);
|
||||
7
packages/babel-plugin-proposal-function-bind/test/fixtures/regression/6458/expected.js
vendored
Normal file
7
packages/babel-plugin-proposal-function-bind/test/fixtures/regression/6458/expected.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
var _file = _interopRequireDefault(require("./file"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
console.log(_file.default.method.bind(_file.default));
|
||||
3
packages/babel-plugin-proposal-function-bind/test/fixtures/regression/6458/options.json
vendored
Normal file
3
packages/babel-plugin-proposal-function-bind/test/fixtures/regression/6458/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["proposal-function-bind", "transform-es2015-modules-commonjs"]
|
||||
}
|
||||
12
packages/babel-plugin-proposal-function-bind/test/fixtures/regression/T6984/actual.js
vendored
Normal file
12
packages/babel-plugin-proposal-function-bind/test/fixtures/regression/T6984/actual.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
function one(){}
|
||||
function two(){}
|
||||
|
||||
class Test1 {
|
||||
one(){
|
||||
one::two(1, 2)
|
||||
}
|
||||
|
||||
two(){
|
||||
one::two(1, 2)
|
||||
}
|
||||
}
|
||||
31
packages/babel-plugin-proposal-function-bind/test/fixtures/regression/T6984/expected.js
vendored
Normal file
31
packages/babel-plugin-proposal-function-bind/test/fixtures/regression/T6984/expected.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof 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; }
|
||||
|
||||
function _one() {}
|
||||
|
||||
function _two() {}
|
||||
|
||||
let Test1 =
|
||||
/*#__PURE__*/
|
||||
function () {
|
||||
function Test1() {
|
||||
_classCallCheck(this, Test1);
|
||||
}
|
||||
|
||||
_createClass(Test1, [{
|
||||
key: "one",
|
||||
value: function one() {
|
||||
_two.call(_one, 1, 2);
|
||||
}
|
||||
}, {
|
||||
key: "two",
|
||||
value: function two() {
|
||||
_two.call(_one, 1, 2);
|
||||
}
|
||||
}]);
|
||||
|
||||
return Test1;
|
||||
}();
|
||||
3
packages/babel-plugin-proposal-function-bind/test/fixtures/regression/T6984/options.json
vendored
Normal file
3
packages/babel-plugin-proposal-function-bind/test/fixtures/regression/T6984/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["proposal-function-bind", "transform-es2015-classes"]
|
||||
}
|
||||
Reference in New Issue
Block a user