uapte
This commit is contained in:
3
node_modules/babel-helper-function-name/.npmignore
generated
vendored
Normal file
3
node_modules/babel-helper-function-name/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
src
|
||||
test
|
||||
node_modules
|
||||
5
node_modules/babel-helper-function-name/README.md
generated
vendored
Normal file
5
node_modules/babel-helper-function-name/README.md
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# babel-helper-function-name
|
||||
|
||||
## Usage
|
||||
|
||||
TODO
|
||||
133
node_modules/babel-helper-function-name/lib/index.js
generated
vendored
Normal file
133
node_modules/babel-helper-function-name/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
|
||||
exports.default = function (_ref) {
|
||||
var node = _ref.node,
|
||||
parent = _ref.parent,
|
||||
scope = _ref.scope,
|
||||
id = _ref.id;
|
||||
|
||||
if (node.id) return;
|
||||
|
||||
if ((t.isObjectProperty(parent) || t.isObjectMethod(parent, { kind: "method" })) && (!parent.computed || t.isLiteral(parent.key))) {
|
||||
id = parent.key;
|
||||
} else if (t.isVariableDeclarator(parent)) {
|
||||
id = parent.id;
|
||||
|
||||
if (t.isIdentifier(id)) {
|
||||
var binding = scope.parent.getBinding(id.name);
|
||||
if (binding && binding.constant && scope.getBinding(id.name) === binding) {
|
||||
node.id = id;
|
||||
node.id[t.NOT_LOCAL_BINDING] = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (t.isAssignmentExpression(parent)) {
|
||||
id = parent.left;
|
||||
} else if (!id) {
|
||||
return;
|
||||
}
|
||||
|
||||
var name = void 0;
|
||||
if (id && t.isLiteral(id)) {
|
||||
name = id.value;
|
||||
} else if (id && t.isIdentifier(id)) {
|
||||
name = id.name;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
name = t.toBindingIdentifierName(name);
|
||||
id = t.identifier(name);
|
||||
|
||||
id[t.NOT_LOCAL_BINDING] = true;
|
||||
|
||||
var state = visit(node, name, scope);
|
||||
return wrap(state, node, id, scope) || node;
|
||||
};
|
||||
|
||||
var _babelHelperGetFunctionArity = require("babel-helper-get-function-arity");
|
||||
|
||||
var _babelHelperGetFunctionArity2 = _interopRequireDefault(_babelHelperGetFunctionArity);
|
||||
|
||||
var _babelTemplate = require("babel-template");
|
||||
|
||||
var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
|
||||
|
||||
var _babelTypes = require("babel-types");
|
||||
|
||||
var t = _interopRequireWildcard(_babelTypes);
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var buildPropertyMethodAssignmentWrapper = (0, _babelTemplate2.default)("\n (function (FUNCTION_KEY) {\n function FUNCTION_ID() {\n return FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n }\n\n return FUNCTION_ID;\n })(FUNCTION)\n");
|
||||
|
||||
var buildGeneratorPropertyMethodAssignmentWrapper = (0, _babelTemplate2.default)("\n (function (FUNCTION_KEY) {\n function* FUNCTION_ID() {\n return yield* FUNCTION_KEY.apply(this, arguments);\n }\n\n FUNCTION_ID.toString = function () {\n return FUNCTION_KEY.toString();\n };\n\n return FUNCTION_ID;\n })(FUNCTION)\n");
|
||||
|
||||
var visitor = {
|
||||
"ReferencedIdentifier|BindingIdentifier": function ReferencedIdentifierBindingIdentifier(path, state) {
|
||||
if (path.node.name !== state.name) return;
|
||||
|
||||
var localDeclar = path.scope.getBindingIdentifier(state.name);
|
||||
if (localDeclar !== state.outerDeclar) return;
|
||||
|
||||
state.selfReference = true;
|
||||
path.stop();
|
||||
}
|
||||
};
|
||||
|
||||
function wrap(state, method, id, scope) {
|
||||
if (state.selfReference) {
|
||||
if (scope.hasBinding(id.name) && !scope.hasGlobal(id.name)) {
|
||||
scope.rename(id.name);
|
||||
} else {
|
||||
if (!t.isFunction(method)) return;
|
||||
|
||||
var build = buildPropertyMethodAssignmentWrapper;
|
||||
if (method.generator) build = buildGeneratorPropertyMethodAssignmentWrapper;
|
||||
var _template = build({
|
||||
FUNCTION: method,
|
||||
FUNCTION_ID: id,
|
||||
FUNCTION_KEY: scope.generateUidIdentifier(id.name)
|
||||
}).expression;
|
||||
_template.callee._skipModulesRemap = true;
|
||||
|
||||
var params = _template.callee.body.body[0].params;
|
||||
for (var i = 0, len = (0, _babelHelperGetFunctionArity2.default)(method); i < len; i++) {
|
||||
params.push(scope.generateUidIdentifier("x"));
|
||||
}
|
||||
|
||||
return _template;
|
||||
}
|
||||
}
|
||||
|
||||
method.id = id;
|
||||
scope.getProgramParent().references[id.name] = true;
|
||||
}
|
||||
|
||||
function visit(node, name, scope) {
|
||||
var state = {
|
||||
selfAssignment: false,
|
||||
selfReference: false,
|
||||
outerDeclar: scope.getBindingIdentifier(name),
|
||||
references: [],
|
||||
name: name
|
||||
};
|
||||
|
||||
var binding = scope.getOwnBinding(name);
|
||||
|
||||
if (binding) {
|
||||
if (binding.kind === "param") {
|
||||
state.selfReference = true;
|
||||
} else {}
|
||||
} else if (state.outerDeclar || scope.hasGlobal(name)) {
|
||||
scope.traverse(node, visitor, state);
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
module.exports = exports["default"];
|
||||
44
node_modules/babel-helper-function-name/package.json
generated
vendored
Normal file
44
node_modules/babel-helper-function-name/package.json
generated
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"_from": "babel-helper-function-name@^6.24.1",
|
||||
"_id": "babel-helper-function-name@6.24.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=",
|
||||
"_location": "/babel-helper-function-name",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "babel-helper-function-name@^6.24.1",
|
||||
"name": "babel-helper-function-name",
|
||||
"escapedName": "babel-helper-function-name",
|
||||
"rawSpec": "^6.24.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^6.24.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/babel-helper-remap-async-to-generator",
|
||||
"/babel-plugin-transform-class-properties"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz",
|
||||
"_shasum": "d3475b8c03ed98242a25b48351ab18399d3580a9",
|
||||
"_spec": "babel-helper-function-name@^6.24.1",
|
||||
"_where": "/Applications/XAMPP/xamppfiles/htdocs/wordpress/t-latehome/wp-content/plugins/opal-estate-pro/node_modules/babel-plugin-transform-class-properties",
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"babel-helper-get-function-arity": "^6.24.1",
|
||||
"babel-runtime": "^6.22.0",
|
||||
"babel-template": "^6.24.1",
|
||||
"babel-traverse": "^6.24.1",
|
||||
"babel-types": "^6.24.1"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Helper function to change the property 'name' of every function",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"name": "babel-helper-function-name",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/babel/babel/tree/master/packages/babel-helper-function-name"
|
||||
},
|
||||
"version": "6.24.1"
|
||||
}
|
||||
Reference in New Issue
Block a user