aboutsummaryrefslogtreecommitdiff
path: root/node_modules/@babel/preset-stage-2
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2018-11-08 00:38:48 +0800
committerruki <waruqi@gmail.com>2018-11-07 21:53:09 +0800
commit26105034da4fcce7ac883c899d781f016559310d (patch)
treec459a5dc4e3aa0972d9919033ece511ce76dd129 /node_modules/@babel/preset-stage-2
parent2c77f00f1a7ecb6c8192f9c16d3b2001b254a107 (diff)
downloadxmake-docs-26105034da4fcce7ac883c899d781f016559310d.tar.gz
xmake-docs-26105034da4fcce7ac883c899d781f016559310d.zip
switch to vuepress
Diffstat (limited to 'node_modules/@babel/preset-stage-2')
-rw-r--r--node_modules/@babel/preset-stage-2/README.md69
-rw-r--r--node_modules/@babel/preset-stage-2/lib/index.js116
-rw-r--r--node_modules/@babel/preset-stage-2/package.json25
3 files changed, 210 insertions, 0 deletions
diff --git a/node_modules/@babel/preset-stage-2/README.md b/node_modules/@babel/preset-stage-2/README.md
new file mode 100644
index 00000000..10342ad4
--- /dev/null
+++ b/node_modules/@babel/preset-stage-2/README.md
@@ -0,0 +1,69 @@
+# @babel/preset-stage-2
+
+> Babel preset for stage 2 plugins.
+
+The gist of Stage 2 is:
+
+> **Stage 2:** draft
+>
+> **What is it?** A first version of what will be in the specification. At this point, an eventual inclusion of the feature in the standard is likely.
+>
+> **What’s required?** The proposal must now additionally have a formal description of the syntax and semantics of the feature (using the formal language of the ECMAScript specification). The description should be as complete as possible, but can contain todos and placeholders. Two experimental implementations of the feature are needed, but one of them can be in a transpiler such as Babel.
+>
+> **What’s next?** Only incremental changes are expected from now on.
+
+## Install
+
+```sh
+npm install --save-dev @babel/preset-stage-2
+```
+
+## Usage
+
+### Via `.babelrc` (Recommended)
+
+**.babelrc**
+
+```json
+{
+ "presets": ["@babel/preset-stage-2"]
+}
+```
+
+### Via CLI
+
+```sh
+babel script.js --presets @babel/preset-stage-2
+```
+
+### Via Node API
+
+```javascript
+require("@babel/core").transform("code", {
+ presets: ["@babel/preset-stage-2"]
+});
+```
+
+## Options
+
+### `loose`
+
+`boolean`, defaults to `false`.
+
+Enable "loose" transformations for any plugins in this preset that allow them.
+
+### `useBuiltIns`
+
+`boolean`, defaults to `false`.
+
+Will use the native built-in instead of trying to polyfill behavior for any plugins that require one.
+
+### `decoratorsLegacy`
+
+`boolean`, defaults to `false`.
+
+Use the legacy (stage 1) decorators syntax and behavior.
+
+## References
+
+- Chapter "[The TC39 process for ECMAScript features](http://exploringjs.com/es2016-es2017/ch_tc39-process.html)" in "Exploring ES2016 and ES2017" by Axel Rauschmayer
diff --git a/node_modules/@babel/preset-stage-2/lib/index.js b/node_modules/@babel/preset-stage-2/lib/index.js
new file mode 100644
index 00000000..0d573a1c
--- /dev/null
+++ b/node_modules/@babel/preset-stage-2/lib/index.js
@@ -0,0 +1,116 @@
+"use strict";
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+exports.default = void 0;
+
+function _helperPluginUtils() {
+ const data = require("@babel/helper-plugin-utils");
+
+ _helperPluginUtils = function _helperPluginUtils() {
+ return data;
+ };
+
+ return data;
+}
+
+function _presetStage() {
+ const data = _interopRequireDefault(require("@babel/preset-stage-3"));
+
+ _presetStage = function _presetStage() {
+ return data;
+ };
+
+ return data;
+}
+
+function _pluginProposalDecorators() {
+ const data = _interopRequireDefault(require("@babel/plugin-proposal-decorators"));
+
+ _pluginProposalDecorators = function _pluginProposalDecorators() {
+ return data;
+ };
+
+ return data;
+}
+
+function _pluginProposalFunctionSent() {
+ const data = _interopRequireDefault(require("@babel/plugin-proposal-function-sent"));
+
+ _pluginProposalFunctionSent = function _pluginProposalFunctionSent() {
+ return data;
+ };
+
+ return data;
+}
+
+function _pluginProposalExportNamespaceFrom() {
+ const data = _interopRequireDefault(require("@babel/plugin-proposal-export-namespace-from"));
+
+ _pluginProposalExportNamespaceFrom = function _pluginProposalExportNamespaceFrom() {
+ return data;
+ };
+
+ return data;
+}
+
+function _pluginProposalNumericSeparator() {
+ const data = _interopRequireDefault(require("@babel/plugin-proposal-numeric-separator"));
+
+ _pluginProposalNumericSeparator = function _pluginProposalNumericSeparator() {
+ return data;
+ };
+
+ return data;
+}
+
+function _pluginProposalThrowExpressions() {
+ const data = _interopRequireDefault(require("@babel/plugin-proposal-throw-expressions"));
+
+ _pluginProposalThrowExpressions = function _pluginProposalThrowExpressions() {
+ return data;
+ };
+
+ return data;
+}
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+var _default = (0, _helperPluginUtils().declare)((api, opts = {}) => {
+ api.assertVersion(7);
+ const _opts$loose = opts.loose,
+ loose = _opts$loose === void 0 ? false : _opts$loose,
+ _opts$useBuiltIns = opts.useBuiltIns,
+ useBuiltIns = _opts$useBuiltIns === void 0 ? false : _opts$useBuiltIns,
+ _opts$decoratorsLegac = opts.decoratorsLegacy,
+ decoratorsLegacy = _opts$decoratorsLegac === void 0 ? false : _opts$decoratorsLegac;
+
+ if (typeof loose !== "boolean") {
+ throw new Error("@babel/preset-stage-2 'loose' option must be a boolean.");
+ }
+
+ if (typeof useBuiltIns !== "boolean") {
+ throw new Error("@babel/preset-stage-2 'useBuiltIns' option must be a boolean.");
+ }
+
+ if (typeof decoratorsLegacy !== "boolean") {
+ throw new Error("@babel/preset-stage-2 'decoratorsLegacy' option must be a boolean.");
+ }
+
+ if (decoratorsLegacy !== true) {
+ throw new Error("The new decorators proposal is not supported yet." + ' You must pass the `"decoratorsLegacy": true` option to' + " @babel/preset-stage-2");
+ }
+
+ return {
+ presets: [[_presetStage().default, {
+ loose,
+ useBuiltIns
+ }]],
+ plugins: [[_pluginProposalDecorators().default, {
+ legacy: decoratorsLegacy
+ }], _pluginProposalFunctionSent().default, _pluginProposalExportNamespaceFrom().default, _pluginProposalNumericSeparator().default, _pluginProposalThrowExpressions().default]
+ };
+});
+
+exports.default = _default; \ No newline at end of file
diff --git a/node_modules/@babel/preset-stage-2/package.json b/node_modules/@babel/preset-stage-2/package.json
new file mode 100644
index 00000000..5b2c3bd0
--- /dev/null
+++ b/node_modules/@babel/preset-stage-2/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "@babel/preset-stage-2",
+ "version": "7.0.0-beta.47",
+ "description": "Babel preset for stage 2 plugins",
+ "author": "Sebastian McKenzie <sebmck@gmail.com>",
+ "homepage": "https://babeljs.io/",
+ "license": "MIT",
+ "repository": "https://github.com/babel/babel/tree/master/packages/babel-preset-stage-2",
+ "main": "lib/index.js",
+ "dependencies": {
+ "@babel/helper-plugin-utils": "7.0.0-beta.47",
+ "@babel/plugin-proposal-decorators": "7.0.0-beta.47",
+ "@babel/plugin-proposal-export-namespace-from": "7.0.0-beta.47",
+ "@babel/plugin-proposal-function-sent": "7.0.0-beta.47",
+ "@babel/plugin-proposal-numeric-separator": "7.0.0-beta.47",
+ "@babel/plugin-proposal-throw-expressions": "7.0.0-beta.47",
+ "@babel/preset-stage-3": "7.0.0-beta.47"
+ },
+ "peerDependencies": {
+ "@babel/core": "7.0.0-beta.47"
+ },
+ "devDependencies": {
+ "@babel/core": "7.0.0-beta.47"
+ }
+}