First commit

This commit is contained in:
2021-03-07 05:58:59 +01:00
committed by Andreas Schaafsma
commit 6e1a5f9fe5
18475 changed files with 3309357 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
# 2.0.2
- Fixing parsing of `yield import()`.
# 2.0.1
- Removing unnecessary `in-publish` dependency.
# 2.0.0
- Updating acorn version to >= 4.
# 1.0.1
- Fixes for publishing the module.
# 1.0.0
- Initial release of plugin.

21
hGameTest/node_modules/acorn-dynamic-import/LICENSE generated vendored Executable file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016 Jordan Gensler
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

33
hGameTest/node_modules/acorn-dynamic-import/README.md generated vendored Executable file
View File

@@ -0,0 +1,33 @@
# Dynamic import support in acorn
This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript.
For more information, check out the [proposal repo](https://github.com/tc39/proposal-dynamic-import).
## Usage
You can use this module directly in order to get Acorn instance with plugin installed:
```js
import acorn from 'acorn-dynamic-import';
// or...
const acorn = require('acorn-dynamic-import').default;
```
Or you can use `inject.js` for injecting plugin into your own version of Acorn like this:
```js
const acorn = require('acorn-dynamic-import/lib/inject').default(require('./custom-acorn'));
```
Then, use the `plugins` option whenever you need to support dynamicImport while parsing:
```js
const ast = acorn.parse(code, {
plugins: { dynamicImport: true }
});
```
## License
This plugin is issued under the [MIT license](./LICENSE).

View File

@@ -0,0 +1,17 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
var _acorn = require('acorn');
var acorn = _interopRequireWildcard(_acorn);
var _inject = require('./inject');
var _inject2 = _interopRequireDefault(_inject);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
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; } }
exports['default'] = (0, _inject2['default'])(acorn);

View File

@@ -0,0 +1,70 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports['default'] = injectDynamicImport;
/* eslint-disable no-underscore-dangle */
function injectDynamicImport(acorn) {
var tt = acorn.tokTypes;
// NOTE: This allows `yield import()` to parse correctly.
tt._import.startsExpr = true;
function parseDynamicImport() {
var node = this.startNode();
this.next();
if (this.type !== tt.parenL) {
this.unexpected();
}
return this.finishNode(node, 'Import');
}
function peekNext() {
return this.input[this.pos];
}
// eslint-disable-next-line no-param-reassign
acorn.plugins.dynamicImport = function () {
function dynamicImportPlugin(instance) {
instance.extend('parseStatement', function (nextMethod) {
return function () {
function parseStatement() {
var node = this.startNode();
if (this.type === tt._import) {
var nextToken = peekNext.call(this);
if (nextToken === tt.parenL.label) {
var expr = this.parseExpression();
return this.parseExpressionStatement(node, expr);
}
}
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return nextMethod.apply(this, args);
}
return parseStatement;
}();
});
instance.extend('parseExprAtom', function (nextMethod) {
return function () {
function parseExprAtom(refDestructuringErrors) {
if (this.type === tt._import) {
return parseDynamicImport.call(this);
}
return nextMethod.call(this, refDestructuringErrors);
}
return parseExprAtom;
}();
});
}
return dynamicImportPlugin;
}();
return acorn;
}

View File

@@ -0,0 +1,76 @@
{
"_from": "acorn-dynamic-import@^2.0.0",
"_id": "acorn-dynamic-import@2.0.2",
"_inBundle": false,
"_integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=",
"_location": "/acorn-dynamic-import",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "acorn-dynamic-import@^2.0.0",
"name": "acorn-dynamic-import",
"escapedName": "acorn-dynamic-import",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/webpack"
],
"_resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz",
"_shasum": "c752bd210bef679501b6c6cb7fc84f8f47158cc4",
"_spec": "acorn-dynamic-import@^2.0.0",
"_where": "/home/andreas/Documents/Projects/haxe/openfl/nigger/node_modules/webpack",
"author": {
"name": "Jordan Gensler",
"email": "jordangens@gmail.com"
},
"bugs": {
"url": "https://github.com/kesne/acorn-dynamic-import/issues"
},
"bundleDependencies": false,
"dependencies": {
"acorn": "^4.0.3"
},
"deprecated": false,
"description": "Support dynamic imports in acorn",
"devDependencies": {
"babel-cli": "^6.18.0",
"babel-eslint": "^7.1.1",
"babel-preset-airbnb": "^2.1.1",
"babel-register": "^6.18.0",
"chai": "^3.0.0",
"eslint": "^3.10.2",
"eslint-config-airbnb-base": "^10.0.1",
"eslint-plugin-import": "^2.2.0",
"in-publish": "^2.0.0",
"mocha": "^2.2.5",
"rimraf": "^2.5.4",
"safe-publish-latest": "^1.1.1"
},
"homepage": "https://github.com/kesne/acorn-dynamic-import",
"license": "MIT",
"main": "lib/index.js",
"name": "acorn-dynamic-import",
"repository": {
"type": "git",
"url": "git+https://github.com/kesne/acorn-dynamic-import.git"
},
"scripts": {
"build": "babel src --out-dir lib",
"check-changelog": "expr $(git status --porcelain 2>/dev/null| grep \"^\\s*M.*CHANGELOG.md\" | wc -l) >/dev/null || (echo 'Please edit CHANGELOG.md' && exit 1)",
"check-only-changelog-changed": "(expr $(git status --porcelain 2>/dev/null| grep -v \"CHANGELOG.md\" | wc -l) >/dev/null && echo 'Only CHANGELOG.md may have uncommitted changes' && exit 1) || exit 0",
"lint": "eslint .",
"postversion": "git commit package.json CHANGELOG.md -m \"v$npm_package_version\" && npm run tag && git push && git push --tags",
"prepublish": "in-publish && safe-publish-latest && npm run build || not-in-publish",
"preversion": "npm run test && npm run check-changelog && npm run check-only-changelog-changed",
"tag": "git tag v$npm_package_version",
"test": "npm run lint && npm run tests-only",
"tests-only": "mocha",
"version:major": "npm --no-git-tag-version version major",
"version:minor": "npm --no-git-tag-version version minor",
"version:patch": "npm --no-git-tag-version version patch"
},
"version": "2.0.2"
}

View File

@@ -0,0 +1,4 @@
import * as acorn from 'acorn';
import inject from './inject';
export default inject(acorn);

View File

@@ -0,0 +1,50 @@
/* eslint-disable no-underscore-dangle */
export default function injectDynamicImport(acorn) {
const tt = acorn.tokTypes;
// NOTE: This allows `yield import()` to parse correctly.
tt._import.startsExpr = true;
function parseDynamicImport() {
const node = this.startNode();
this.next();
if (this.type !== tt.parenL) {
this.unexpected();
}
return this.finishNode(node, 'Import');
}
function peekNext() {
return this.input[this.pos];
}
// eslint-disable-next-line no-param-reassign
acorn.plugins.dynamicImport = function dynamicImportPlugin(instance) {
instance.extend('parseStatement', nextMethod => (
function parseStatement(...args) {
const node = this.startNode();
if (this.type === tt._import) {
const nextToken = peekNext.call(this);
if (nextToken === tt.parenL.label) {
const expr = this.parseExpression();
return this.parseExpressionStatement(node, expr);
}
}
return nextMethod.apply(this, args);
}
));
instance.extend('parseExprAtom', nextMethod => (
function parseExprAtom(refDestructuringErrors) {
if (this.type === tt._import) {
return parseDynamicImport.call(this);
}
return nextMethod.call(this, refDestructuringErrors);
}
));
};
return acorn;
}