Skip to content

Commit

Permalink
移除:do-expressions,function-bind解析
Browse files Browse the repository at this point in the history
  • Loading branch information
bplok20010 committed Oct 11, 2020
1 parent e80a5f4 commit 6fe4e9d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 69 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ module.exports = function (options, state) {
babel: {
//...babel options
decoratorsBeforeExport: true,
strictMode: true,
useFlow: true,
loose: true,
runtimeOptions: {},
Expand All @@ -43,8 +42,6 @@ module.exports = function (options, state) {
},
eslint: {},
postcss: {},
//compilerOptions
typescript: {},
};
};
```
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module.exports = async function (appSrc = "src", outDir = "lib", options = {}) {
log(success(`任务数:${fileTotal}`));

RPQueue(files, {
limit: options.taskRunner,
limit: options.taskRunner || 5,
process: file => {
const p = compile(file, options).catch(console.log);

Expand Down
42 changes: 3 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "transform-es",
"version": "5.1.0",
"version": "5.2.0",
"description": "",
"keywords": [
"compile",
Expand Down Expand Up @@ -45,7 +45,7 @@
"@babel/core": "^7.10.2",
"@babel/runtime": "^7.10.2",
"babel-eslint": "^10.1.0",
"babel-preset-packez": "^1.2.0",
"babel-preset-packez": "^1.3.0",
"chalk": "^2.4.2",
"commander": "^3.0.0",
"eslint": "^6.8.0",
Expand Down
48 changes: 24 additions & 24 deletions test/src/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,31 +281,31 @@ Array.isArray(vxx);
// }
// }
//do-expressions
{
let za = do {
if (x > 10) {
("big");
} else {
("small");
}
};
// is equivalent to:
let zza = x > 10 ? "big" : "small";
}
// {
// let za = do {
// if (x > 10) {
// ("big");
// } else {
// ("small");
// }
// };
// // is equivalent to:
// let zza = x > 10 ? "big" : "small";
// }
//function-bind
{
obj::func;
// is equivalent to:
func.bind(obj)::obj.func;
// is equivalent to:
obj.func.bind(obj);

obj::func(val);
// is equivalent to:
func.call(obj, val)::obj.func(val);
// is equivalent to:
obj.func.call(obj, val);
}
// {
// obj::func;
// // is equivalent to:
// func.bind(obj)::obj.func;
// // is equivalent to:
// obj.func.bind(obj);

// obj::func(val);
// // is equivalent to:
// func.call(obj, val)::obj.func(val);
// // is equivalent to:
// obj.func.call(obj, val);
// }
//function-sent
{
function* generator() {
Expand Down

0 comments on commit 6fe4e9d

Please sign in to comment.