jass 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +47 -0
- data/README.md +45 -0
- data/lib/jass.rb +55 -0
- data/lib/jass/base.rb +141 -0
- data/lib/jass/bundle_processor.rb +28 -0
- data/lib/jass/compiler.rb +112 -0
- data/lib/jass/dependency.rb +14 -0
- data/lib/jass/errors.rb +29 -0
- data/lib/jass/es6_processor.rb +17 -0
- data/lib/jass/function.rb +13 -0
- data/lib/jass/global_directive_processor.rb +12 -0
- data/lib/jass/plugin.rb +13 -0
- data/lib/jass/railtie.rb +12 -0
- data/lib/jass/version.rb +3 -0
- data/vendor/node_modules/@types/acorn/index.d.ts +256 -0
- data/vendor/node_modules/@types/acorn/package.json +29 -0
- data/vendor/node_modules/@types/estree/index.d.ts +546 -0
- data/vendor/node_modules/@types/estree/package.json +22 -0
- data/vendor/node_modules/acorn-dynamic-import/lib/index.js +17 -0
- data/vendor/node_modules/acorn-dynamic-import/lib/inject.js +72 -0
- data/vendor/node_modules/acorn-dynamic-import/lib/walk.js +22 -0
- data/vendor/node_modules/acorn-dynamic-import/package.json +45 -0
- data/vendor/node_modules/acorn-dynamic-import/src/index.js +4 -0
- data/vendor/node_modules/acorn-dynamic-import/src/inject.js +52 -0
- data/vendor/node_modules/acorn-dynamic-import/src/walk.js +12 -0
- data/vendor/node_modules/acorn-es7-plugin/acorn-es7-plugin.js +17 -0
- data/vendor/node_modules/acorn-es7-plugin/acorn-v3.js +333 -0
- data/vendor/node_modules/acorn-es7-plugin/acorn-v4.js +194 -0
- data/vendor/node_modules/acorn-es7-plugin/package.json +29 -0
- data/vendor/node_modules/acorn-jsx/index.js +3 -0
- data/vendor/node_modules/acorn-jsx/inject.js +449 -0
- data/vendor/node_modules/acorn-jsx/package.json +28 -0
- data/vendor/node_modules/acorn-jsx/xhtml.js +255 -0
- data/vendor/node_modules/acorn/bin/_acorn.js +69 -0
- data/vendor/node_modules/acorn/bin/acorn +4 -0
- data/vendor/node_modules/acorn/bin/run_test262.js +22 -0
- data/vendor/node_modules/acorn/bin/test262.whitelist +409 -0
- data/vendor/node_modules/acorn/dist/acorn.es.js +5305 -0
- data/vendor/node_modules/acorn/dist/acorn.js +5336 -0
- data/vendor/node_modules/acorn/dist/acorn_loose.es.js +1412 -0
- data/vendor/node_modules/acorn/dist/acorn_loose.js +1422 -0
- data/vendor/node_modules/acorn/dist/walk.es.js +419 -0
- data/vendor/node_modules/acorn/dist/walk.js +439 -0
- data/vendor/node_modules/acorn/package.json +56 -0
- data/vendor/node_modules/ansi-styles/index.js +165 -0
- data/vendor/node_modules/ansi-styles/package.json +56 -0
- data/vendor/node_modules/arr-diff/index.js +58 -0
- data/vendor/node_modules/arr-diff/package.json +49 -0
- data/vendor/node_modules/arr-flatten/index.js +22 -0
- data/vendor/node_modules/arr-flatten/package.json +76 -0
- data/vendor/node_modules/array-unique/index.js +28 -0
- data/vendor/node_modules/array-unique/package.json +37 -0
- data/vendor/node_modules/braces/index.js +399 -0
- data/vendor/node_modules/braces/package.json +83 -0
- data/vendor/node_modules/buble/bin/buble +24 -0
- data/vendor/node_modules/buble/bin/handleError.js +58 -0
- data/vendor/node_modules/buble/bin/runBuble.js +150 -0
- data/vendor/node_modules/buble/bin/showHelp.js +16 -0
- data/vendor/node_modules/buble/dist/buble-browser-deps.umd.js +14857 -0
- data/vendor/node_modules/buble/dist/buble-browser.cjs.js +9941 -0
- data/vendor/node_modules/buble/dist/buble-browser.es.js +9933 -0
- data/vendor/node_modules/buble/dist/buble.cjs.js +9433 -0
- data/vendor/node_modules/buble/dist/buble.es.js +9425 -0
- data/vendor/node_modules/buble/package.json +74 -0
- data/vendor/node_modules/buble/register.js +90 -0
- data/vendor/node_modules/buble/src/index.js +98 -0
- data/vendor/node_modules/buble/src/program/BlockStatement.js +373 -0
- data/vendor/node_modules/buble/src/program/Node.js +112 -0
- data/vendor/node_modules/buble/src/program/Program.js +74 -0
- data/vendor/node_modules/buble/src/program/Scope.js +116 -0
- data/vendor/node_modules/buble/src/program/extractNames.js +35 -0
- data/vendor/node_modules/buble/src/program/keys.js +4 -0
- data/vendor/node_modules/buble/src/program/types/ArrayExpression.js +70 -0
- data/vendor/node_modules/buble/src/program/types/ArrowFunctionExpression.js +52 -0
- data/vendor/node_modules/buble/src/program/types/AssignmentExpression.js +185 -0
- data/vendor/node_modules/buble/src/program/types/BinaryExpression.js +12 -0
- data/vendor/node_modules/buble/src/program/types/BreakStatement.js +26 -0
- data/vendor/node_modules/buble/src/program/types/CallExpression.js +104 -0
- data/vendor/node_modules/buble/src/program/types/ClassBody.js +237 -0
- data/vendor/node_modules/buble/src/program/types/ClassDeclaration.js +79 -0
- data/vendor/node_modules/buble/src/program/types/ClassExpression.js +51 -0
- data/vendor/node_modules/buble/src/program/types/ContinueStatement.js +17 -0
- data/vendor/node_modules/buble/src/program/types/ExportDefaultDeclaration.js +10 -0
- data/vendor/node_modules/buble/src/program/types/ExportNamedDeclaration.js +10 -0
- data/vendor/node_modules/buble/src/program/types/ForInStatement.js +76 -0
- data/vendor/node_modules/buble/src/program/types/ForOfStatement.js +89 -0
- data/vendor/node_modules/buble/src/program/types/ForStatement.js +54 -0
- data/vendor/node_modules/buble/src/program/types/FunctionDeclaration.js +25 -0
- data/vendor/node_modules/buble/src/program/types/FunctionExpression.js +74 -0
- data/vendor/node_modules/buble/src/program/types/Identifier.js +54 -0
- data/vendor/node_modules/buble/src/program/types/IfStatement.js +29 -0
- data/vendor/node_modules/buble/src/program/types/ImportDeclaration.js +10 -0
- data/vendor/node_modules/buble/src/program/types/ImportDefaultSpecifier.js +8 -0
- data/vendor/node_modules/buble/src/program/types/ImportSpecifier.js +8 -0
- data/vendor/node_modules/buble/src/program/types/JSXAttribute.js +20 -0
- data/vendor/node_modules/buble/src/program/types/JSXClosingElement.js +27 -0
- data/vendor/node_modules/buble/src/program/types/JSXClosingFragment.js +22 -0
- data/vendor/node_modules/buble/src/program/types/JSXElement.js +57 -0
- data/vendor/node_modules/buble/src/program/types/JSXExpressionContainer.js +10 -0
- data/vendor/node_modules/buble/src/program/types/JSXFragment.js +4 -0
- data/vendor/node_modules/buble/src/program/types/JSXOpeningElement.js +93 -0
- data/vendor/node_modules/buble/src/program/types/JSXOpeningFragment.js +7 -0
- data/vendor/node_modules/buble/src/program/types/JSXSpreadAttribute.js +10 -0
- data/vendor/node_modules/buble/src/program/types/Literal.js +43 -0
- data/vendor/node_modules/buble/src/program/types/MemberExpression.js +13 -0
- data/vendor/node_modules/buble/src/program/types/NewExpression.js +55 -0
- data/vendor/node_modules/buble/src/program/types/ObjectExpression.js +250 -0
- data/vendor/node_modules/buble/src/program/types/Property.js +52 -0
- data/vendor/node_modules/buble/src/program/types/ReturnStatement.js +32 -0
- data/vendor/node_modules/buble/src/program/types/SpreadElement.js +12 -0
- data/vendor/node_modules/buble/src/program/types/Super.js +88 -0
- data/vendor/node_modules/buble/src/program/types/TaggedTemplateExpression.js +63 -0
- data/vendor/node_modules/buble/src/program/types/TemplateElement.js +7 -0
- data/vendor/node_modules/buble/src/program/types/TemplateLiteral.js +80 -0
- data/vendor/node_modules/buble/src/program/types/ThisExpression.js +31 -0
- data/vendor/node_modules/buble/src/program/types/UpdateExpression.js +32 -0
- data/vendor/node_modules/buble/src/program/types/VariableDeclaration.js +101 -0
- data/vendor/node_modules/buble/src/program/types/VariableDeclarator.js +43 -0
- data/vendor/node_modules/buble/src/program/types/index.js +98 -0
- data/vendor/node_modules/buble/src/program/types/shared/LoopStatement.js +105 -0
- data/vendor/node_modules/buble/src/program/types/shared/ModuleDeclaration.js +10 -0
- data/vendor/node_modules/buble/src/program/wrap.js +68 -0
- data/vendor/node_modules/buble/src/support.js +97 -0
- data/vendor/node_modules/buble/src/utils/CompileError.js +30 -0
- data/vendor/node_modules/buble/src/utils/array.js +11 -0
- data/vendor/node_modules/buble/src/utils/checkConst.js +8 -0
- data/vendor/node_modules/buble/src/utils/deindent.js +30 -0
- data/vendor/node_modules/buble/src/utils/destructure.js +377 -0
- data/vendor/node_modules/buble/src/utils/getSnippet.js +30 -0
- data/vendor/node_modules/buble/src/utils/isReference.js +41 -0
- data/vendor/node_modules/buble/src/utils/locate.js +20 -0
- data/vendor/node_modules/buble/src/utils/patterns.js +1 -0
- data/vendor/node_modules/buble/src/utils/removeTrailingComma.js +13 -0
- data/vendor/node_modules/buble/src/utils/reserved.js +6 -0
- data/vendor/node_modules/buble/src/utils/spread.js +70 -0
- data/vendor/node_modules/builtin-modules/builtin-modules.json +39 -0
- data/vendor/node_modules/builtin-modules/index.js +10 -0
- data/vendor/node_modules/builtin-modules/package.json +40 -0
- data/vendor/node_modules/builtin-modules/static.js +2 -0
- data/vendor/node_modules/chalk/index.js +228 -0
- data/vendor/node_modules/chalk/package.json +66 -0
- data/vendor/node_modules/chalk/templates.js +128 -0
- data/vendor/node_modules/chalk/types/index.d.ts +97 -0
- data/vendor/node_modules/color-convert/conversions.js +861 -0
- data/vendor/node_modules/color-convert/index.js +78 -0
- data/vendor/node_modules/color-convert/package.json +46 -0
- data/vendor/node_modules/color-convert/route.js +97 -0
- data/vendor/node_modules/color-name/index.js +152 -0
- data/vendor/node_modules/color-name/package.json +25 -0
- data/vendor/node_modules/color-name/test.js +7 -0
- data/vendor/node_modules/date-time/index.js +33 -0
- data/vendor/node_modules/date-time/package.json +39 -0
- data/vendor/node_modules/escape-string-regexp/index.js +11 -0
- data/vendor/node_modules/escape-string-regexp/package.json +41 -0
- data/vendor/node_modules/estree-walker/dist/estree-walker.es.js +57 -0
- data/vendor/node_modules/estree-walker/dist/estree-walker.umd.js +68 -0
- data/vendor/node_modules/estree-walker/package.json +34 -0
- data/vendor/node_modules/estree-walker/src/estree-walker.js +51 -0
- data/vendor/node_modules/expand-brackets/index.js +163 -0
- data/vendor/node_modules/expand-brackets/package.json +62 -0
- data/vendor/node_modules/expand-range/index.js +43 -0
- data/vendor/node_modules/expand-range/package.json +73 -0
- data/vendor/node_modules/extglob/index.js +178 -0
- data/vendor/node_modules/extglob/package.json +60 -0
- data/vendor/node_modules/filename-regex/index.js +10 -0
- data/vendor/node_modules/filename-regex/package.json +50 -0
- data/vendor/node_modules/fill-range/index.js +408 -0
- data/vendor/node_modules/fill-range/package.json +61 -0
- data/vendor/node_modules/for-in/index.js +16 -0
- data/vendor/node_modules/for-in/package.json +68 -0
- data/vendor/node_modules/for-own/index.js +19 -0
- data/vendor/node_modules/for-own/package.json +70 -0
- data/vendor/node_modules/glob-base/index.js +51 -0
- data/vendor/node_modules/glob-base/package.json +52 -0
- data/vendor/node_modules/glob-parent/index.js +10 -0
- data/vendor/node_modules/glob-parent/package.json +35 -0
- data/vendor/node_modules/glob-parent/test.js +28 -0
- data/vendor/node_modules/has-flag/index.js +8 -0
- data/vendor/node_modules/has-flag/package.json +44 -0
- data/vendor/node_modules/irregular-plurals/irregular-plurals.json +146 -0
- data/vendor/node_modules/irregular-plurals/package.json +39 -0
- data/vendor/node_modules/is-buffer/index.js +21 -0
- data/vendor/node_modules/is-buffer/package.json +51 -0
- data/vendor/node_modules/is-dotfile/index.js +14 -0
- data/vendor/node_modules/is-dotfile/package.json +69 -0
- data/vendor/node_modules/is-equal-shallow/index.js +27 -0
- data/vendor/node_modules/is-equal-shallow/package.json +54 -0
- data/vendor/node_modules/is-extendable/index.js +13 -0
- data/vendor/node_modules/is-extendable/package.json +51 -0
- data/vendor/node_modules/is-extglob/index.js +11 -0
- data/vendor/node_modules/is-extglob/package.json +48 -0
- data/vendor/node_modules/is-glob/index.js +14 -0
- data/vendor/node_modules/is-glob/package.json +60 -0
- data/vendor/node_modules/is-module/index.js +11 -0
- data/vendor/node_modules/is-module/package.json +20 -0
- data/vendor/node_modules/is-number/index.js +19 -0
- data/vendor/node_modules/is-number/package.json +59 -0
- data/vendor/node_modules/is-posix-bracket/index.js +10 -0
- data/vendor/node_modules/is-posix-bracket/package.json +64 -0
- data/vendor/node_modules/is-primitive/index.js +13 -0
- data/vendor/node_modules/is-primitive/package.json +46 -0
- data/vendor/node_modules/is-reference/dist/is-reference.es.js +26 -0
- data/vendor/node_modules/is-reference/dist/is-reference.js +34 -0
- data/vendor/node_modules/is-reference/dist/types/index.d.ts +2 -0
- data/vendor/node_modules/is-reference/package.json +47 -0
- data/vendor/node_modules/isarray/index.js +5 -0
- data/vendor/node_modules/isarray/package.json +45 -0
- data/vendor/node_modules/isarray/test.js +20 -0
- data/vendor/node_modules/isobject/index.js +14 -0
- data/vendor/node_modules/isobject/package.json +67 -0
- data/vendor/node_modules/kind-of/index.js +116 -0
- data/vendor/node_modules/kind-of/package.json +90 -0
- data/vendor/node_modules/locate-character/dist/locate-character.es.js +43 -0
- data/vendor/node_modules/locate-character/dist/locate-character.umd.js +54 -0
- data/vendor/node_modules/locate-character/dist/types/index.d.ts +17 -0
- data/vendor/node_modules/locate-character/package.json +41 -0
- data/vendor/node_modules/magic-string/dist/magic-string.cjs.js +1300 -0
- data/vendor/node_modules/magic-string/dist/magic-string.es.js +1296 -0
- data/vendor/node_modules/magic-string/dist/magic-string.umd.js +1352 -0
- data/vendor/node_modules/magic-string/index.d.ts +83 -0
- data/vendor/node_modules/magic-string/node_modules/vlq/dist/vlq.js +91 -0
- data/vendor/node_modules/magic-string/node_modules/vlq/package.json +27 -0
- data/vendor/node_modules/magic-string/node_modules/vlq/src/vlq.js +78 -0
- data/vendor/node_modules/magic-string/package.json +55 -0
- data/vendor/node_modules/micromatch/index.js +431 -0
- data/vendor/node_modules/micromatch/lib/chars.js +67 -0
- data/vendor/node_modules/micromatch/lib/expand.js +304 -0
- data/vendor/node_modules/micromatch/lib/glob.js +193 -0
- data/vendor/node_modules/micromatch/lib/utils.js +149 -0
- data/vendor/node_modules/micromatch/package.json +114 -0
- data/vendor/node_modules/minimist/index.js +236 -0
- data/vendor/node_modules/minimist/package.json +45 -0
- data/vendor/node_modules/nodent-compiler/compiler.js +171 -0
- data/vendor/node_modules/nodent-compiler/lib/arboriculture.js +2694 -0
- data/vendor/node_modules/nodent-compiler/lib/output.js +934 -0
- data/vendor/node_modules/nodent-compiler/lib/parser.js +291 -0
- data/vendor/node_modules/nodent-compiler/package.json +37 -0
- data/vendor/node_modules/normalize-path/index.js +19 -0
- data/vendor/node_modules/normalize-path/package.json +78 -0
- data/vendor/node_modules/object.omit/index.js +40 -0
- data/vendor/node_modules/object.omit/package.json +67 -0
- data/vendor/node_modules/os-homedir/index.js +24 -0
- data/vendor/node_modules/os-homedir/package.json +41 -0
- data/vendor/node_modules/parse-glob/index.js +156 -0
- data/vendor/node_modules/parse-glob/package.json +62 -0
- data/vendor/node_modules/parse-ms/index.js +16 -0
- data/vendor/node_modules/parse-ms/package.json +34 -0
- data/vendor/node_modules/path-parse/index.js +93 -0
- data/vendor/node_modules/path-parse/index.min.js +1 -0
- data/vendor/node_modules/path-parse/package.json +33 -0
- data/vendor/node_modules/path-parse/test.js +77 -0
- data/vendor/node_modules/path-parse/test.min.js +1 -0
- data/vendor/node_modules/plur/index.js +20 -0
- data/vendor/node_modules/plur/package.json +42 -0
- data/vendor/node_modules/preserve/index.js +54 -0
- data/vendor/node_modules/preserve/package.json +48 -0
- data/vendor/node_modules/preserve/test.js +48 -0
- data/vendor/node_modules/pretty-ms/index.js +48 -0
- data/vendor/node_modules/pretty-ms/package.json +48 -0
- data/vendor/node_modules/randomatic/index.js +82 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/index.js +22 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/node_modules/kind-of/index.js +116 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/node_modules/kind-of/package.json +90 -0
- data/vendor/node_modules/randomatic/node_modules/is-number/package.json +83 -0
- data/vendor/node_modules/randomatic/node_modules/kind-of/index.js +119 -0
- data/vendor/node_modules/randomatic/node_modules/kind-of/package.json +90 -0
- data/vendor/node_modules/randomatic/package.json +78 -0
- data/vendor/node_modules/regex-cache/index.js +68 -0
- data/vendor/node_modules/regex-cache/package.json +64 -0
- data/vendor/node_modules/remove-trailing-separator/index.js +17 -0
- data/vendor/node_modules/remove-trailing-separator/package.json +37 -0
- data/vendor/node_modules/repeat-element/index.js +18 -0
- data/vendor/node_modules/repeat-element/package.json +44 -0
- data/vendor/node_modules/repeat-string/index.js +70 -0
- data/vendor/node_modules/repeat-string/package.json +77 -0
- data/vendor/node_modules/require-relative/index.js +33 -0
- data/vendor/node_modules/require-relative/package.json +22 -0
- data/vendor/node_modules/resolve/index.js +8 -0
- data/vendor/node_modules/resolve/lib/async.js +203 -0
- data/vendor/node_modules/resolve/lib/caller.js +8 -0
- data/vendor/node_modules/resolve/lib/core.js +53 -0
- data/vendor/node_modules/resolve/lib/core.json +69 -0
- data/vendor/node_modules/resolve/lib/node-modules-paths.js +45 -0
- data/vendor/node_modules/resolve/lib/sync.js +93 -0
- data/vendor/node_modules/resolve/package.json +40 -0
- data/vendor/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.cjs.js +804 -0
- data/vendor/node_modules/rollup-plugin-commonjs/dist/rollup-plugin-commonjs.es.js +800 -0
- data/vendor/node_modules/rollup-plugin-commonjs/package.json +52 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/ast-utils.js +104 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/defaultResolver.js +39 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/helpers.js +19 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/index.js +198 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/transform.js +431 -0
- data/vendor/node_modules/rollup-plugin-commonjs/src/utils.js +13 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.cjs.js +218 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/dist/rollup-plugin-node-resolve.es.js +214 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/package.json +51 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/src/empty.js +1 -0
- data/vendor/node_modules/rollup-plugin-node-resolve/src/index.js +205 -0
- data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.cjs.js +223 -0
- data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.es.js +214 -0
- data/vendor/node_modules/rollup-pluginutils/dist/pluginutils.es6.js +217 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/dist/estree-walker.es.js +55 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/dist/estree-walker.es6.js +59 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/dist/estree-walker.umd.js +65 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/package.json +33 -0
- data/vendor/node_modules/rollup-pluginutils/node_modules/estree-walker/src/estree-walker.js +49 -0
- data/vendor/node_modules/rollup-pluginutils/package.json +40 -0
- data/vendor/node_modules/rollup-pluginutils/src/addExtension.js +6 -0
- data/vendor/node_modules/rollup-pluginutils/src/attachScopes.js +147 -0
- data/vendor/node_modules/rollup-pluginutils/src/createFilter.js +33 -0
- data/vendor/node_modules/rollup-pluginutils/src/index.js +4 -0
- data/vendor/node_modules/rollup-pluginutils/src/makeLegalIdentifier.js +15 -0
- data/vendor/node_modules/rollup-pluginutils/src/utils/ensureArray.js +5 -0
- data/vendor/node_modules/rollup/bin/rollup +4085 -0
- data/vendor/node_modules/rollup/dist/rollup.browser.js +19829 -0
- data/vendor/node_modules/rollup/dist/rollup.es.js +23586 -0
- data/vendor/node_modules/rollup/dist/rollup.js +23597 -0
- data/vendor/node_modules/rollup/dist/typings/Chunk.d.ts +85 -0
- data/vendor/node_modules/rollup/dist/typings/ExternalModule.d.ts +30 -0
- data/vendor/node_modules/rollup/dist/typings/Graph.d.ts +47 -0
- data/vendor/node_modules/rollup/dist/typings/Module.d.ts +130 -0
- data/vendor/node_modules/rollup/dist/typings/ast/CallOptions.d.ts +20 -0
- data/vendor/node_modules/rollup/dist/typings/ast/Entity.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/ExecutionPathOptions.d.ts +57 -0
- data/vendor/node_modules/rollup/dist/typings/ast/clone.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/ast/enhance.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/ast/keys.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ArrayExpression.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ArrayPattern.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ArrowFunctionExpression.d.ts +25 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/AssignmentExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/AssignmentPattern.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/AssignmentProperty.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/AwaitExpression.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/BinaryExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/BlockStatement.d.ts +19 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/BreakStatement.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/CallExpression.d.ts +22 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/CatchClause.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ClassBody.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ClassDeclaration.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ClassExpression.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ConditionalExpression.d.ts +28 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/DoWhileStatement.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/EmptyStatement.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportAllDeclaration.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportDefaultDeclaration.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportNamedDeclaration.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExportSpecifier.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ExpressionStatement.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ForInStatement.d.ts +20 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ForOfStatement.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ForStatement.d.ts +19 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/FunctionDeclaration.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/FunctionExpression.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Identifier.d.ts +29 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/IfStatement.d.ts +17 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Import.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportDeclaration.d.ts +17 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportDefaultSpecifier.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportNamespaceSpecifier.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ImportSpecifier.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/LabeledStatement.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Literal.d.ts +22 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/LogicalExpression.d.ts +23 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/MemberExpression.d.ts +34 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/MethodDefinition.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/NewExpression.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/NodeType.d.ts +64 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ObjectExpression.d.ts +22 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ObjectPattern.d.ts +15 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Program.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/Property.d.ts +30 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/RestElement.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ReturnStatement.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/SequenceExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/SpreadElement.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/SwitchCase.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/SwitchStatement.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/TaggedTemplateExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/TemplateElement.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/TemplateLiteral.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ThisExpression.d.ts +17 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/ThrowStatement.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/UnaryExpression.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/UnknownNode.d.ts +5 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/UpdateExpression.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/VariableDeclaration.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/VariableDeclarator.d.ts +13 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/WhileStatement.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/YieldExpression.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/index.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/ClassNode.d.ts +17 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/Expression.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/FunctionNode.d.ts +25 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/Node.d.ts +133 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/Pattern.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/ast/nodes/shared/pureFunctions.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/BlockScope.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/CatchScope.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/FunctionScope.d.ts +20 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/GlobalScope.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/ModuleScope.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/ParameterScope.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/ReturnValueScope.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/ast/scopes/Scope.d.ts +42 -0
- data/vendor/node_modules/rollup/dist/typings/ast/utils/extractNames.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/ast/values.d.ts +31 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ArgumentsVariable.d.ts +15 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ExportDefaultVariable.d.ts +16 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ExternalVariable.d.ts +12 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/GlobalVariable.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/LocalVariable.d.ts +21 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/NamespaceVariable.d.ts +20 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ParameterVariable.d.ts +5 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ReplaceableInitializationVariable.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/ThisVariable.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/Variable.d.ts +43 -0
- data/vendor/node_modules/rollup/dist/typings/ast/variables/VariableReassignmentTracker.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/amd.d.ts +11 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/cjs.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/es.d.ts +9 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/iife.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/index.d.ts +15 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/esModuleExport.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/getExportBlock.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/getGlobalNameMaker.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/getInteropBlock.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/sanitize.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/setupNamespace.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/trimEmptyImports.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/shared/warnOnBuiltins.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/system.d.ts +8 -0
- data/vendor/node_modules/rollup/dist/typings/finalisers/umd.d.ts +10 -0
- data/vendor/node_modules/rollup/dist/typings/node-entry.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/rollup/index.d.ts +167 -0
- data/vendor/node_modules/rollup/dist/typings/utils/callIfFunction.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/collapseSourcemaps.d.ts +5 -0
- data/vendor/node_modules/rollup/dist/typings/utils/commondir.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/defaults.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/utils/deprecateOptions.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/utils/ensureArray.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/utils/entryHashing.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/error.d.ts +18 -0
- data/vendor/node_modules/rollup/dist/typings/utils/first-sync.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/first.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/flushTime.d.ts +5 -0
- data/vendor/node_modules/rollup/dist/typings/utils/fs.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/getCodeFrame.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/getExportMode.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/getIndentString.d.ts +4 -0
- data/vendor/node_modules/rollup/dist/typings/utils/identifierHelpers.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/mergeOptions.d.ts +19 -0
- data/vendor/node_modules/rollup/dist/typings/utils/object.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/utils/path.d.ts +6 -0
- data/vendor/node_modules/rollup/dist/typings/utils/promise.d.ts +2 -0
- data/vendor/node_modules/rollup/dist/typings/utils/relativeId.d.ts +1 -0
- data/vendor/node_modules/rollup/dist/typings/utils/renderHelpers.d.ts +26 -0
- data/vendor/node_modules/rollup/dist/typings/utils/sourceMappingURL.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/utils/timers.d.ts +7 -0
- data/vendor/node_modules/rollup/dist/typings/utils/transform.d.ts +25 -0
- data/vendor/node_modules/rollup/dist/typings/utils/transformBundle.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/watch/chokidar.d.ts +3 -0
- data/vendor/node_modules/rollup/dist/typings/watch/fileWatchers.d.ts +14 -0
- data/vendor/node_modules/rollup/dist/typings/watch/index.d.ts +47 -0
- data/vendor/node_modules/rollup/package.json +122 -0
- data/vendor/node_modules/rollup/typings/package.json.d.ts +3 -0
- data/vendor/node_modules/signal-exit/index.js +157 -0
- data/vendor/node_modules/signal-exit/package.json +38 -0
- data/vendor/node_modules/signal-exit/signals.js +53 -0
- data/vendor/node_modules/source-map/dist/source-map.debug.js +3091 -0
- data/vendor/node_modules/source-map/dist/source-map.js +3090 -0
- data/vendor/node_modules/source-map/dist/source-map.min.js +2 -0
- data/vendor/node_modules/source-map/lib/array-set.js +121 -0
- data/vendor/node_modules/source-map/lib/base64-vlq.js +140 -0
- data/vendor/node_modules/source-map/lib/base64.js +67 -0
- data/vendor/node_modules/source-map/lib/binary-search.js +111 -0
- data/vendor/node_modules/source-map/lib/mapping-list.js +79 -0
- data/vendor/node_modules/source-map/lib/quick-sort.js +114 -0
- data/vendor/node_modules/source-map/lib/source-map-consumer.js +1082 -0
- data/vendor/node_modules/source-map/lib/source-map-generator.js +416 -0
- data/vendor/node_modules/source-map/lib/source-node.js +413 -0
- data/vendor/node_modules/source-map/lib/util.js +417 -0
- data/vendor/node_modules/source-map/package.json +72 -0
- data/vendor/node_modules/source-map/source-map.js +8 -0
- data/vendor/node_modules/sourcemap-codec/dist/sourcemap-codec.es.js +129 -0
- data/vendor/node_modules/sourcemap-codec/dist/sourcemap-codec.umd.js +140 -0
- data/vendor/node_modules/sourcemap-codec/dist/types/sourcemap-codec.d.ts +5 -0
- data/vendor/node_modules/sourcemap-codec/package.json +52 -0
- data/vendor/node_modules/supports-color/browser.js +5 -0
- data/vendor/node_modules/supports-color/index.js +135 -0
- data/vendor/node_modules/supports-color/package.json +53 -0
- data/vendor/node_modules/time-zone/index.js +10 -0
- data/vendor/node_modules/time-zone/package.json +35 -0
- data/vendor/node_modules/vlq/dist/types/vlq.d.ts +2 -0
- data/vendor/node_modules/vlq/dist/vlq.es.js +64 -0
- data/vendor/node_modules/vlq/dist/vlq.js +75 -0
- data/vendor/node_modules/vlq/package.json +30 -0
- data/vendor/package.json +15 -0
- data/vendor/yarn.lock +453 -0
- metadata +641 -0
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"name": "@types/estree",
|
3
|
+
"version": "0.0.38",
|
4
|
+
"description": "TypeScript definitions for ESTree AST specification",
|
5
|
+
"license": "MIT",
|
6
|
+
"contributors": [
|
7
|
+
{
|
8
|
+
"name": "RReverser",
|
9
|
+
"url": "https://github.com/RReverser",
|
10
|
+
"githubUsername": "RReverser"
|
11
|
+
}
|
12
|
+
],
|
13
|
+
"main": "",
|
14
|
+
"repository": {
|
15
|
+
"type": "git",
|
16
|
+
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
|
17
|
+
},
|
18
|
+
"scripts": {},
|
19
|
+
"dependencies": {},
|
20
|
+
"typesPublisherContentHash": "19879f4eaa24d649d1de20d95bf747d91637d037470d47442d96dad57ec9a424",
|
21
|
+
"typeScriptVersion": "2.0"
|
22
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
2
|
+
value: true
|
3
|
+
});
|
4
|
+
|
5
|
+
var _acorn = require('acorn');
|
6
|
+
|
7
|
+
var acorn = _interopRequireWildcard(_acorn);
|
8
|
+
|
9
|
+
var _inject = require('./inject');
|
10
|
+
|
11
|
+
var _inject2 = _interopRequireDefault(_inject);
|
12
|
+
|
13
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
|
14
|
+
|
15
|
+
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; } }
|
16
|
+
|
17
|
+
exports['default'] = (0, _inject2['default'])(acorn);
|
@@ -0,0 +1,72 @@
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
2
|
+
value: true
|
3
|
+
});
|
4
|
+
exports['default'] = injectDynamicImport;
|
5
|
+
/* eslint-disable no-underscore-dangle */
|
6
|
+
|
7
|
+
var DynamicImportKey = exports.DynamicImportKey = 'Import';
|
8
|
+
|
9
|
+
function injectDynamicImport(acorn) {
|
10
|
+
var tt = acorn.tokTypes;
|
11
|
+
|
12
|
+
// NOTE: This allows `yield import()` to parse correctly.
|
13
|
+
tt._import.startsExpr = true;
|
14
|
+
|
15
|
+
function parseDynamicImport() {
|
16
|
+
var node = this.startNode();
|
17
|
+
this.next();
|
18
|
+
if (this.type !== tt.parenL) {
|
19
|
+
this.unexpected();
|
20
|
+
}
|
21
|
+
return this.finishNode(node, DynamicImportKey);
|
22
|
+
}
|
23
|
+
|
24
|
+
function peekNext() {
|
25
|
+
return this.input[this.pos];
|
26
|
+
}
|
27
|
+
|
28
|
+
// eslint-disable-next-line no-param-reassign
|
29
|
+
acorn.plugins.dynamicImport = function () {
|
30
|
+
function dynamicImportPlugin(instance) {
|
31
|
+
instance.extend('parseStatement', function (nextMethod) {
|
32
|
+
return function () {
|
33
|
+
function parseStatement() {
|
34
|
+
var node = this.startNode();
|
35
|
+
if (this.type === tt._import) {
|
36
|
+
var nextToken = peekNext.call(this);
|
37
|
+
if (nextToken === tt.parenL.label) {
|
38
|
+
var expr = this.parseExpression();
|
39
|
+
return this.parseExpressionStatement(node, expr);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
44
|
+
args[_key] = arguments[_key];
|
45
|
+
}
|
46
|
+
|
47
|
+
return nextMethod.apply(this, args);
|
48
|
+
}
|
49
|
+
|
50
|
+
return parseStatement;
|
51
|
+
}();
|
52
|
+
});
|
53
|
+
|
54
|
+
instance.extend('parseExprAtom', function (nextMethod) {
|
55
|
+
return function () {
|
56
|
+
function parseExprAtom(refDestructuringErrors) {
|
57
|
+
if (this.type === tt._import) {
|
58
|
+
return parseDynamicImport.call(this);
|
59
|
+
}
|
60
|
+
return nextMethod.call(this, refDestructuringErrors);
|
61
|
+
}
|
62
|
+
|
63
|
+
return parseExprAtom;
|
64
|
+
}();
|
65
|
+
});
|
66
|
+
}
|
67
|
+
|
68
|
+
return dynamicImportPlugin;
|
69
|
+
}();
|
70
|
+
|
71
|
+
return acorn;
|
72
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
2
|
+
value: true
|
3
|
+
});
|
4
|
+
exports.inject = inject;
|
5
|
+
|
6
|
+
var _walk = require('acorn/dist/walk');
|
7
|
+
|
8
|
+
var walk = _interopRequireWildcard(_walk);
|
9
|
+
|
10
|
+
var _inject = require('./inject');
|
11
|
+
|
12
|
+
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; } }
|
13
|
+
|
14
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
15
|
+
|
16
|
+
function inject(injectableWalk) {
|
17
|
+
return Object.assign({}, injectableWalk, {
|
18
|
+
base: Object.assign({}, injectableWalk.base, _defineProperty({}, _inject.DynamicImportKey, function () {}))
|
19
|
+
});
|
20
|
+
}
|
21
|
+
|
22
|
+
exports['default'] = inject(walk);
|
@@ -0,0 +1,45 @@
|
|
1
|
+
{
|
2
|
+
"name": "acorn-dynamic-import",
|
3
|
+
"description": "Support dynamic imports in acorn",
|
4
|
+
"main": "lib/index.js",
|
5
|
+
"homepage": "https://github.com/kesne/acorn-dynamic-import",
|
6
|
+
"author": "Jordan Gensler <jordangens@gmail.com>",
|
7
|
+
"repository": {
|
8
|
+
"type": "git",
|
9
|
+
"url": "https://github.com/kesne/acorn-dynamic-import"
|
10
|
+
},
|
11
|
+
"license": "MIT",
|
12
|
+
"scripts": {
|
13
|
+
"build": "babel src --out-dir lib",
|
14
|
+
"test": "npm run lint && npm run tests-only",
|
15
|
+
"lint": "eslint .",
|
16
|
+
"tests-only": "mocha",
|
17
|
+
"prepublish": "in-publish && safe-publish-latest && npm run build || not-in-publish",
|
18
|
+
"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)",
|
19
|
+
"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",
|
20
|
+
"version:major": "npm --no-git-tag-version version major",
|
21
|
+
"version:minor": "npm --no-git-tag-version version minor",
|
22
|
+
"version:patch": "npm --no-git-tag-version version patch",
|
23
|
+
"postversion": "git commit package.json CHANGELOG.md -m \"v$npm_package_version\" && npm run tag && git push && git push --tags",
|
24
|
+
"preversion": "npm run test && npm run check-changelog && npm run check-only-changelog-changed",
|
25
|
+
"tag": "git tag v$npm_package_version"
|
26
|
+
},
|
27
|
+
"dependencies": {
|
28
|
+
"acorn": "^5.0.0"
|
29
|
+
},
|
30
|
+
"devDependencies": {
|
31
|
+
"babel-cli": "^6.18.0",
|
32
|
+
"babel-eslint": "^7.1.1",
|
33
|
+
"babel-preset-airbnb": "^2.1.1",
|
34
|
+
"babel-register": "^6.18.0",
|
35
|
+
"chai": "^3.0.0",
|
36
|
+
"eslint": "^3.10.2",
|
37
|
+
"eslint-config-airbnb-base": "^10.0.1",
|
38
|
+
"eslint-plugin-import": "^2.2.0",
|
39
|
+
"in-publish": "^2.0.0",
|
40
|
+
"mocha": "^2.2.5",
|
41
|
+
"rimraf": "^2.5.4",
|
42
|
+
"safe-publish-latest": "^1.1.1"
|
43
|
+
},
|
44
|
+
"version": "3.0.0"
|
45
|
+
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
/* eslint-disable no-underscore-dangle */
|
2
|
+
|
3
|
+
export const DynamicImportKey = 'Import';
|
4
|
+
|
5
|
+
export default function injectDynamicImport(acorn) {
|
6
|
+
const tt = acorn.tokTypes;
|
7
|
+
|
8
|
+
// NOTE: This allows `yield import()` to parse correctly.
|
9
|
+
tt._import.startsExpr = true;
|
10
|
+
|
11
|
+
function parseDynamicImport() {
|
12
|
+
const node = this.startNode();
|
13
|
+
this.next();
|
14
|
+
if (this.type !== tt.parenL) {
|
15
|
+
this.unexpected();
|
16
|
+
}
|
17
|
+
return this.finishNode(node, DynamicImportKey);
|
18
|
+
}
|
19
|
+
|
20
|
+
function peekNext() {
|
21
|
+
return this.input[this.pos];
|
22
|
+
}
|
23
|
+
|
24
|
+
// eslint-disable-next-line no-param-reassign
|
25
|
+
acorn.plugins.dynamicImport = function dynamicImportPlugin(instance) {
|
26
|
+
instance.extend('parseStatement', nextMethod => (
|
27
|
+
function parseStatement(...args) {
|
28
|
+
const node = this.startNode();
|
29
|
+
if (this.type === tt._import) {
|
30
|
+
const nextToken = peekNext.call(this);
|
31
|
+
if (nextToken === tt.parenL.label) {
|
32
|
+
const expr = this.parseExpression();
|
33
|
+
return this.parseExpressionStatement(node, expr);
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
return nextMethod.apply(this, args);
|
38
|
+
}
|
39
|
+
));
|
40
|
+
|
41
|
+
instance.extend('parseExprAtom', nextMethod => (
|
42
|
+
function parseExprAtom(refDestructuringErrors) {
|
43
|
+
if (this.type === tt._import) {
|
44
|
+
return parseDynamicImport.call(this);
|
45
|
+
}
|
46
|
+
return nextMethod.call(this, refDestructuringErrors);
|
47
|
+
}
|
48
|
+
));
|
49
|
+
};
|
50
|
+
|
51
|
+
return acorn;
|
52
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import * as walk from 'acorn/dist/walk';
|
2
|
+
import { DynamicImportKey } from './inject';
|
3
|
+
|
4
|
+
export function inject(injectableWalk) {
|
5
|
+
return Object.assign({}, injectableWalk, {
|
6
|
+
base: Object.assign({}, injectableWalk.base, {
|
7
|
+
[DynamicImportKey]() {},
|
8
|
+
}),
|
9
|
+
});
|
10
|
+
}
|
11
|
+
|
12
|
+
export default inject(walk);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module.exports = function(acorn) {
|
2
|
+
switch (parseInt(acorn.version)) {
|
3
|
+
case 2:
|
4
|
+
case 3:
|
5
|
+
acorn.plugins.asyncawait = require('./acorn-v3') ;
|
6
|
+
break ;
|
7
|
+
case 4:
|
8
|
+
acorn.plugins.asyncawait = require('./acorn-v4') ;
|
9
|
+
break ;
|
10
|
+
case 5:
|
11
|
+
acorn.plugins.asyncawait = require('./acorn-v4') ;
|
12
|
+
break ;
|
13
|
+
default:
|
14
|
+
throw new Error("acorn-es7-plugin requires Acorn v2, 3, 4 or 5") ;
|
15
|
+
}
|
16
|
+
return acorn
|
17
|
+
}
|
@@ -0,0 +1,333 @@
|
|
1
|
+
var NotAsync = {} ;
|
2
|
+
var asyncExit = /^async[\t ]+(return|throw)/ ;
|
3
|
+
var asyncFunction = /^async[\t ]+function/ ;
|
4
|
+
var atomOrPropertyOrLabel = /^\s*[():;]/ ;
|
5
|
+
var removeComments = /([^\n])\/\*(\*(?!\/)|[^\n*])*\*\/([^\n])/g ;
|
6
|
+
var matchAsyncGet = /\s*(get|set)\s*\(/ ;
|
7
|
+
|
8
|
+
function hasLineTerminatorBeforeNext(st, since) {
|
9
|
+
return st.lineStart >= since;
|
10
|
+
}
|
11
|
+
|
12
|
+
function test(regex,st,noComment) {
|
13
|
+
var src = st.input.slice(st.start) ;
|
14
|
+
if (noComment) {
|
15
|
+
src = src.replace(removeComments,"$1 $3") ;
|
16
|
+
}
|
17
|
+
return regex.test(src);
|
18
|
+
}
|
19
|
+
|
20
|
+
/* Create a new parser derived from the specified parser, so that in the
|
21
|
+
* event of an error we can back out and try again */
|
22
|
+
function subParse(parser, pos, extensions,parens) {
|
23
|
+
var p = new parser.constructor(parser.options, parser.input, pos);
|
24
|
+
if (extensions)
|
25
|
+
for (var k in extensions)
|
26
|
+
p[k] = extensions[k] ;
|
27
|
+
|
28
|
+
var src = parser ;
|
29
|
+
var dest = p ;
|
30
|
+
['inFunction','inAsyncFunction','inAsync','inGenerator','inModule'].forEach(function(k){
|
31
|
+
if (k in src)
|
32
|
+
dest[k] = src[k] ;
|
33
|
+
}) ;
|
34
|
+
if (parens)
|
35
|
+
p.options.preserveParens = true ;
|
36
|
+
p.nextToken();
|
37
|
+
return p;
|
38
|
+
}
|
39
|
+
|
40
|
+
//TODO: Implement option noAsyncGetters
|
41
|
+
|
42
|
+
function asyncAwaitPlugin (parser,options){
|
43
|
+
var es7check = function(){} ;
|
44
|
+
|
45
|
+
parser.extend("initialContext",function(base){
|
46
|
+
return function(){
|
47
|
+
if (this.options.ecmaVersion < 7) {
|
48
|
+
es7check = function(node) {
|
49
|
+
parser.raise(node.start,"async/await keywords only available when ecmaVersion>=7") ;
|
50
|
+
} ;
|
51
|
+
}
|
52
|
+
this.reservedWords = new RegExp(this.reservedWords.toString().replace(/await|async/g,"").replace("|/","/").replace("/|","/").replace("||","|")) ;
|
53
|
+
this.reservedWordsStrict = new RegExp(this.reservedWordsStrict.toString().replace(/await|async/g,"").replace("|/","/").replace("/|","/").replace("||","|")) ;
|
54
|
+
this.reservedWordsStrictBind = new RegExp(this.reservedWordsStrictBind.toString().replace(/await|async/g,"").replace("|/","/").replace("/|","/").replace("||","|")) ;
|
55
|
+
this.inAsyncFunction = options.inAsyncFunction ;
|
56
|
+
if (options.awaitAnywhere && options.inAsyncFunction)
|
57
|
+
parser.raise(node.start,"The options awaitAnywhere and inAsyncFunction are mutually exclusive") ;
|
58
|
+
|
59
|
+
return base.apply(this,arguments);
|
60
|
+
}
|
61
|
+
}) ;
|
62
|
+
|
63
|
+
parser.extend("shouldParseExportStatement",function(base){
|
64
|
+
return function(){
|
65
|
+
if (this.type.label==='name' && this.value==='async' && test(asyncFunction,this)) {
|
66
|
+
return true ;
|
67
|
+
}
|
68
|
+
return base.apply(this,arguments) ;
|
69
|
+
}
|
70
|
+
}) ;
|
71
|
+
|
72
|
+
parser.extend("parseStatement",function(base){
|
73
|
+
return function (declaration, topLevel) {
|
74
|
+
var start = this.start;
|
75
|
+
var startLoc = this.startLoc;
|
76
|
+
if (this.type.label==='name') {
|
77
|
+
if (test(asyncFunction,this,true)) {
|
78
|
+
var wasAsync = this.inAsyncFunction ;
|
79
|
+
try {
|
80
|
+
this.inAsyncFunction = true ;
|
81
|
+
this.next() ;
|
82
|
+
var r = this.parseStatement(declaration, topLevel) ;
|
83
|
+
r.async = true ;
|
84
|
+
r.start = start;
|
85
|
+
r.loc && (r.loc.start = startLoc);
|
86
|
+
r.range && (r.range[0] = start);
|
87
|
+
return r ;
|
88
|
+
} finally {
|
89
|
+
this.inAsyncFunction = wasAsync ;
|
90
|
+
}
|
91
|
+
} else if ((typeof options==="object" && options.asyncExits) && test(asyncExit,this)) {
|
92
|
+
// NON-STANDARD EXTENSION iff. options.asyncExits is set, the
|
93
|
+
// extensions 'async return <expr>?' and 'async throw <expr>?'
|
94
|
+
// are enabled. In each case they are the standard ESTree nodes
|
95
|
+
// with the flag 'async:true'
|
96
|
+
this.next() ;
|
97
|
+
var r = this.parseStatement(declaration, topLevel) ;
|
98
|
+
r.async = true ;
|
99
|
+
r.start = start;
|
100
|
+
r.loc && (r.loc.start = startLoc);
|
101
|
+
r.range && (r.range[0] = start);
|
102
|
+
return r ;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
return base.apply(this,arguments);
|
106
|
+
}
|
107
|
+
}) ;
|
108
|
+
|
109
|
+
parser.extend("parseIdent",function(base){
|
110
|
+
return function(liberal){
|
111
|
+
var id = base.apply(this,arguments);
|
112
|
+
if (this.inAsyncFunction && id.name==='await') {
|
113
|
+
if (arguments.length===0) {
|
114
|
+
this.raise(id.start,"'await' is reserved within async functions") ;
|
115
|
+
}
|
116
|
+
}
|
117
|
+
return id ;
|
118
|
+
}
|
119
|
+
}) ;
|
120
|
+
|
121
|
+
parser.extend("parseExprAtom",function(base){
|
122
|
+
return function(refShorthandDefaultPos){
|
123
|
+
var start = this.start ;
|
124
|
+
var startLoc = this.startLoc;
|
125
|
+
var rhs,r = base.apply(this,arguments);
|
126
|
+
if (r.type==='Identifier') {
|
127
|
+
if (r.name==='async' && !hasLineTerminatorBeforeNext(this, r.end)) {
|
128
|
+
// Is this really an async function?
|
129
|
+
var isAsync = this.inAsyncFunction ;
|
130
|
+
try {
|
131
|
+
this.inAsyncFunction = true ;
|
132
|
+
var pp = this ;
|
133
|
+
var inBody = false ;
|
134
|
+
|
135
|
+
var parseHooks = {
|
136
|
+
parseFunctionBody:function(node,isArrowFunction){
|
137
|
+
try {
|
138
|
+
var wasInBody = inBody ;
|
139
|
+
inBody = true ;
|
140
|
+
return pp.parseFunctionBody.apply(this,arguments) ;
|
141
|
+
} finally {
|
142
|
+
inBody = wasInBody ;
|
143
|
+
}
|
144
|
+
},
|
145
|
+
raise:function(){
|
146
|
+
try {
|
147
|
+
return pp.raise.apply(this,arguments) ;
|
148
|
+
} catch(ex) {
|
149
|
+
throw inBody?ex:NotAsync ;
|
150
|
+
}
|
151
|
+
}
|
152
|
+
} ;
|
153
|
+
|
154
|
+
rhs = subParse(this,this.start,parseHooks,true).parseExpression() ;
|
155
|
+
if (rhs.type==='SequenceExpression')
|
156
|
+
rhs = rhs.expressions[0] ;
|
157
|
+
if (rhs.type === 'CallExpression')
|
158
|
+
rhs = rhs.callee ;
|
159
|
+
if (rhs.type==='FunctionExpression' || rhs.type==='FunctionDeclaration' || rhs.type==='ArrowFunctionExpression') {
|
160
|
+
// Because we don't know if the top level parser supprts preserveParens, we have to re-parse
|
161
|
+
// without it set
|
162
|
+
rhs = subParse(this,this.start,parseHooks).parseExpression() ;
|
163
|
+
if (rhs.type==='SequenceExpression')
|
164
|
+
rhs = rhs.expressions[0] ;
|
165
|
+
if (rhs.type === 'CallExpression')
|
166
|
+
rhs = rhs.callee ;
|
167
|
+
|
168
|
+
rhs.async = true ;
|
169
|
+
rhs.start = start;
|
170
|
+
rhs.loc && (rhs.loc.start = startLoc);
|
171
|
+
rhs.range && (rhs.range[0] = start);
|
172
|
+
this.pos = rhs.end;
|
173
|
+
this.end = rhs.end ;
|
174
|
+
this.endLoc = rhs.endLoc ;
|
175
|
+
this.next();
|
176
|
+
es7check(rhs) ;
|
177
|
+
return rhs ;
|
178
|
+
}
|
179
|
+
} catch (ex) {
|
180
|
+
if (ex!==NotAsync)
|
181
|
+
throw ex ;
|
182
|
+
}
|
183
|
+
finally {
|
184
|
+
this.inAsyncFunction = isAsync ;
|
185
|
+
}
|
186
|
+
}
|
187
|
+
else if (r.name==='await') {
|
188
|
+
var n = this.startNodeAt(r.start, r.loc && r.loc.start);
|
189
|
+
if (this.inAsyncFunction) {
|
190
|
+
rhs = this.parseExprSubscripts() ;
|
191
|
+
n.operator = 'await' ;
|
192
|
+
n.argument = rhs ;
|
193
|
+
n = this.finishNodeAt(n,'AwaitExpression', rhs.end, rhs.loc && rhs.loc.end) ;
|
194
|
+
es7check(n) ;
|
195
|
+
return n ;
|
196
|
+
}
|
197
|
+
// NON-STANDARD EXTENSION iff. options.awaitAnywhere is true,
|
198
|
+
// an 'AwaitExpression' is allowed anywhere the token 'await'
|
199
|
+
// could not be an identifier with the name 'await'.
|
200
|
+
|
201
|
+
// Look-ahead to see if this is really a property or label called async or await
|
202
|
+
if (this.input.slice(r.end).match(atomOrPropertyOrLabel)) {
|
203
|
+
if (!options.awaitAnywhere && this.options.sourceType === 'module')
|
204
|
+
return this.raise(r.start,"'await' is reserved within modules") ;
|
205
|
+
return r ; // This is a valid property name or label
|
206
|
+
}
|
207
|
+
|
208
|
+
if (typeof options==="object" && options.awaitAnywhere) {
|
209
|
+
start = this.start ;
|
210
|
+
rhs = subParse(this,start-4).parseExprSubscripts() ;
|
211
|
+
if (rhs.end<=start) {
|
212
|
+
rhs = subParse(this,start).parseExprSubscripts() ;
|
213
|
+
n.operator = 'await' ;
|
214
|
+
n.argument = rhs ;
|
215
|
+
n = this.finishNodeAt(n,'AwaitExpression', rhs.end, rhs.loc && rhs.loc.end) ;
|
216
|
+
this.pos = rhs.end;
|
217
|
+
this.end = rhs.end ;
|
218
|
+
this.endLoc = rhs.endLoc ;
|
219
|
+
this.next();
|
220
|
+
es7check(n) ;
|
221
|
+
return n ;
|
222
|
+
}
|
223
|
+
}
|
224
|
+
|
225
|
+
if (!options.awaitAnywhere && this.options.sourceType === 'module')
|
226
|
+
return this.raise(r.start,"'await' is reserved within modules") ;
|
227
|
+
}
|
228
|
+
}
|
229
|
+
return r ;
|
230
|
+
}
|
231
|
+
}) ;
|
232
|
+
|
233
|
+
parser.extend('finishNodeAt',function(base){
|
234
|
+
return function(node,type,pos,loc) {
|
235
|
+
if (node.__asyncValue) {
|
236
|
+
delete node.__asyncValue ;
|
237
|
+
node.value.async = true ;
|
238
|
+
}
|
239
|
+
return base.apply(this,arguments) ;
|
240
|
+
}
|
241
|
+
}) ;
|
242
|
+
|
243
|
+
parser.extend('finishNode',function(base){
|
244
|
+
return function(node,type) {
|
245
|
+
if (node.__asyncValue) {
|
246
|
+
delete node.__asyncValue ;
|
247
|
+
node.value.async = true ;
|
248
|
+
}
|
249
|
+
return base.apply(this,arguments) ;
|
250
|
+
}
|
251
|
+
}) ;
|
252
|
+
|
253
|
+
var allowedPropSpecifiers = {
|
254
|
+
get:true,
|
255
|
+
set:true,
|
256
|
+
async:true
|
257
|
+
};
|
258
|
+
|
259
|
+
parser.extend("parsePropertyName",function(base){
|
260
|
+
return function (prop) {
|
261
|
+
var prevName = prop.key && prop.key.name ;
|
262
|
+
var key = base.apply(this,arguments) ;
|
263
|
+
if (key.type === "Identifier" && (key.name === "async") && !hasLineTerminatorBeforeNext(this, key.end)) {
|
264
|
+
// Look-ahead to see if this is really a property or label called async or await
|
265
|
+
if (!this.input.slice(key.end).match(atomOrPropertyOrLabel)){
|
266
|
+
// Cheese - eliminate the cases 'async get(){}' and async set(){}'
|
267
|
+
if (matchAsyncGet.test(this.input.slice(key.end))) {
|
268
|
+
key = base.apply(this,arguments) ;
|
269
|
+
prop.__asyncValue = true ;
|
270
|
+
} else {
|
271
|
+
es7check(prop) ;
|
272
|
+
if (prop.kind === 'set')
|
273
|
+
this.raise(key.start,"'set <member>(value)' cannot be be async") ;
|
274
|
+
|
275
|
+
key = base.apply(this,arguments) ;
|
276
|
+
if (key.type==='Identifier') {
|
277
|
+
if (key.name==='set')
|
278
|
+
this.raise(key.start,"'set <member>(value)' cannot be be async") ;
|
279
|
+
}
|
280
|
+
prop.__asyncValue = true ;
|
281
|
+
}
|
282
|
+
}
|
283
|
+
}
|
284
|
+
return key;
|
285
|
+
};
|
286
|
+
}) ;
|
287
|
+
|
288
|
+
parser.extend("parseClassMethod",function(base){
|
289
|
+
return function (classBody, method, isGenerator) {
|
290
|
+
var wasAsync ;
|
291
|
+
if (method.__asyncValue) {
|
292
|
+
if (method.kind==='constructor')
|
293
|
+
this.raise(method.start,"class constructor() cannot be be async") ;
|
294
|
+
wasAsync = this.inAsyncFunction ;
|
295
|
+
this.inAsyncFunction = true ;
|
296
|
+
}
|
297
|
+
var r = base.apply(this,arguments) ;
|
298
|
+
this.inAsyncFunction = wasAsync ;
|
299
|
+
return r ;
|
300
|
+
}
|
301
|
+
}) ;
|
302
|
+
|
303
|
+
parser.extend("parseMethod",function(base){
|
304
|
+
return function (isGenerator) {
|
305
|
+
var wasAsync ;
|
306
|
+
if (this.__currentProperty && this.__currentProperty.__asyncValue) {
|
307
|
+
wasAsync = this.inAsyncFunction ;
|
308
|
+
this.inAsyncFunction = true ;
|
309
|
+
}
|
310
|
+
var r = base.apply(this,arguments) ;
|
311
|
+
this.inAsyncFunction = wasAsync ;
|
312
|
+
return r ;
|
313
|
+
}
|
314
|
+
}) ;
|
315
|
+
|
316
|
+
parser.extend("parsePropertyValue",function(base){
|
317
|
+
return function (prop, isPattern, isGenerator, startPos, startLoc, refDestructuringErrors) {
|
318
|
+
var prevProp = this.__currentProperty ;
|
319
|
+
this.__currentProperty = prop ;
|
320
|
+
var wasAsync ;
|
321
|
+
if (prop.__asyncValue) {
|
322
|
+
wasAsync = this.inAsyncFunction ;
|
323
|
+
this.inAsyncFunction = true ;
|
324
|
+
}
|
325
|
+
var r = base.apply(this,arguments) ;
|
326
|
+
this.inAsyncFunction = wasAsync ;
|
327
|
+
this.__currentProperty = prevProp ;
|
328
|
+
return r ;
|
329
|
+
}
|
330
|
+
}) ;
|
331
|
+
}
|
332
|
+
|
333
|
+
module.exports = asyncAwaitPlugin ;
|