porffor 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CNAME +1 -0
- package/LICENSE +21 -0
- package/README.md +275 -0
- package/compiler/builtins/base64.js +92 -0
- package/compiler/builtins.js +770 -0
- package/compiler/codeGen.js +2027 -0
- package/compiler/decompile.js +102 -0
- package/compiler/embedding.js +19 -0
- package/compiler/encoding.js +217 -0
- package/compiler/expression.js +70 -0
- package/compiler/index.js +67 -0
- package/compiler/opt.js +436 -0
- package/compiler/parse.js +8 -0
- package/compiler/prototype.js +272 -0
- package/compiler/sections.js +154 -0
- package/compiler/wasmSpec.js +200 -0
- package/compiler/wrap.js +119 -0
- package/index.html +1264 -0
- package/logo.png +0 -0
- package/package.json +23 -0
- package/porf.cmd +2 -0
- package/runner/compare.js +35 -0
- package/runner/index.js +32 -0
- package/runner/info.js +54 -0
- package/runner/profile.js +47 -0
- package/runner/repl.js +99 -0
- package/runner/sizes.js +38 -0
- package/runner/transform.js +36 -0
- package/sw.js +26 -0
- package/test/array_1.js +8 -0
- package/test/array_push.js +8 -0
- package/test/assignop_1.js +15 -0
- package/test/bitwise_1.js +6 -0
- package/test/bool_1.js +3 -0
- package/test/boolean.js +6 -0
- package/test/break_1.js +6 -0
- package/test/break_2.js +12 -0
- package/test/conditional_1.js +3 -0
- package/test/conditional_2.js +4 -0
- package/test/console_1.js +2 -0
- package/test/continue_1.js +6 -0
- package/test/continue_2.js +10 -0
- package/test/empty.js +1 -0
- package/test/ending_exp_1.js +2 -0
- package/test/ending_exp_2.js +6 -0
- package/test/eq_1.js +4 -0
- package/test/eq_2.js +4 -0
- package/test/eq_3.js +5 -0
- package/test/export_1.js +9 -0
- package/test/factorial.js +3 -0
- package/test/fibonacci.js +16 -0
- package/test/float_div0.js +2 -0
- package/test/float_frac.js +2 -0
- package/test/float_isfinite.js +29 -0
- package/test/float_isinteger.js +13 -0
- package/test/float_isnan.js +20 -0
- package/test/float_issafeinteger.js +11 -0
- package/test/float_large.js +2 -0
- package/test/float_math_funcs.js +24 -0
- package/test/float_math_random.js +6 -0
- package/test/float_nan.js +3 -0
- package/test/float_number_values.js +12 -0
- package/test/for_1.js +4 -0
- package/test/for_2.js +4 -0
- package/test/func_1.js +16 -0
- package/test/func_2.js +6 -0
- package/test/func_3.js +10 -0
- package/test/global_1.js +8 -0
- package/test/global_2.js +10 -0
- package/test/if_1.js +6 -0
- package/test/if_2.js +9 -0
- package/test/if_3.js +7 -0
- package/test/iife_1.js +8 -0
- package/test/iife_2.js +8 -0
- package/test/index.js +93 -0
- package/test/int_number_values.js +6 -0
- package/test/logic_1.js +7 -0
- package/test/logic_2.js +7 -0
- package/test/math_1.js +6 -0
- package/test/math_2.js +12 -0
- package/test/math_3.js +6 -0
- package/test/number_func.js +4 -0
- package/test/return_1.js +8 -0
- package/test/return_2.js +11 -0
- package/test/tailcall_1.js +10 -0
- package/test/throw_1.js +2 -0
- package/test/throw_2.js +4 -0
- package/test/throw_3.js +2 -0
- package/test/throw_4.js +3 -0
- package/test/try_1.js +7 -0
- package/test/unary_1.js +4 -0
- package/test/unary_2.js +5 -0
- package/test/unary_3.js +6 -0
- package/test/unary_4.js +12 -0
- package/test/unary_5.js +8 -0
- package/test/undefined_1.js +8 -0
- package/test/undefined_2.js +10 -0
- package/test/updateexp_1.js +9 -0
- package/test/vars_1.js +5 -0
- package/test/vars_2.js +9 -0
- package/test/while_1.js +6 -0
- package/test262/compare.js +30 -0
- package/test262/index.js +314 -0
- package/test262/node_modules/.bin/esparse +12 -0
- package/test262/node_modules/.bin/esparse.cmd +17 -0
- package/test262/node_modules/.bin/esparse.ps1 +28 -0
- package/test262/node_modules/.bin/esvalidate +12 -0
- package/test262/node_modules/.bin/esvalidate.cmd +17 -0
- package/test262/node_modules/.bin/esvalidate.ps1 +28 -0
- package/test262/node_modules/.bin/js-yaml +12 -0
- package/test262/node_modules/.bin/js-yaml.cmd +17 -0
- package/test262/node_modules/.bin/js-yaml.ps1 +28 -0
- package/test262/node_modules/.package-lock.json +0 -0
- package/test262/node_modules/@nodelib/fs.scandir/LICENSE +21 -0
- package/test262/node_modules/@nodelib/fs.scandir/README.md +171 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +20 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +19 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/constants.d.ts +4 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/constants.js +17 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/index.d.ts +12 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/index.js +26 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +7 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/providers/async.js +104 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +1 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/providers/common.js +13 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +5 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/providers/sync.js +54 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/settings.d.ts +20 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/settings.js +24 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +20 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/types/index.js +2 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +2 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/utils/fs.js +19 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +2 -0
- package/test262/node_modules/@nodelib/fs.scandir/out/utils/index.js +5 -0
- package/test262/node_modules/@nodelib/fs.scandir/package.json +44 -0
- package/test262/node_modules/@nodelib/fs.stat/LICENSE +21 -0
- package/test262/node_modules/@nodelib/fs.stat/README.md +126 -0
- package/test262/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +13 -0
- package/test262/node_modules/@nodelib/fs.stat/out/adapters/fs.js +17 -0
- package/test262/node_modules/@nodelib/fs.stat/out/index.d.ts +12 -0
- package/test262/node_modules/@nodelib/fs.stat/out/index.js +26 -0
- package/test262/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +4 -0
- package/test262/node_modules/@nodelib/fs.stat/out/providers/async.js +36 -0
- package/test262/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +3 -0
- package/test262/node_modules/@nodelib/fs.stat/out/providers/sync.js +23 -0
- package/test262/node_modules/@nodelib/fs.stat/out/settings.d.ts +16 -0
- package/test262/node_modules/@nodelib/fs.stat/out/settings.js +16 -0
- package/test262/node_modules/@nodelib/fs.stat/out/types/index.d.ts +4 -0
- package/test262/node_modules/@nodelib/fs.stat/out/types/index.js +2 -0
- package/test262/node_modules/@nodelib/fs.stat/package.json +37 -0
- package/test262/node_modules/@nodelib/fs.walk/LICENSE +21 -0
- package/test262/node_modules/@nodelib/fs.walk/README.md +215 -0
- package/test262/node_modules/@nodelib/fs.walk/out/index.d.ts +14 -0
- package/test262/node_modules/@nodelib/fs.walk/out/index.js +34 -0
- package/test262/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +12 -0
- package/test262/node_modules/@nodelib/fs.walk/out/providers/async.js +30 -0
- package/test262/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +4 -0
- package/test262/node_modules/@nodelib/fs.walk/out/providers/index.js +9 -0
- package/test262/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +12 -0
- package/test262/node_modules/@nodelib/fs.walk/out/providers/stream.js +34 -0
- package/test262/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +10 -0
- package/test262/node_modules/@nodelib/fs.walk/out/providers/sync.js +14 -0
- package/test262/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +30 -0
- package/test262/node_modules/@nodelib/fs.walk/out/readers/async.js +97 -0
- package/test262/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +7 -0
- package/test262/node_modules/@nodelib/fs.walk/out/readers/common.js +31 -0
- package/test262/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +6 -0
- package/test262/node_modules/@nodelib/fs.walk/out/readers/reader.js +11 -0
- package/test262/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +15 -0
- package/test262/node_modules/@nodelib/fs.walk/out/readers/sync.js +59 -0
- package/test262/node_modules/@nodelib/fs.walk/out/settings.d.ts +30 -0
- package/test262/node_modules/@nodelib/fs.walk/out/settings.js +26 -0
- package/test262/node_modules/@nodelib/fs.walk/out/types/index.d.ts +8 -0
- package/test262/node_modules/@nodelib/fs.walk/out/types/index.js +2 -0
- package/test262/node_modules/@nodelib/fs.walk/package.json +44 -0
- package/test262/node_modules/argparse/CHANGELOG.md +185 -0
- package/test262/node_modules/argparse/LICENSE +21 -0
- package/test262/node_modules/argparse/README.md +257 -0
- package/test262/node_modules/argparse/index.js +3 -0
- package/test262/node_modules/argparse/lib/action/append/constant.js +47 -0
- package/test262/node_modules/argparse/lib/action/append.js +53 -0
- package/test262/node_modules/argparse/lib/action/count.js +40 -0
- package/test262/node_modules/argparse/lib/action/help.js +47 -0
- package/test262/node_modules/argparse/lib/action/store/constant.js +43 -0
- package/test262/node_modules/argparse/lib/action/store/false.js +27 -0
- package/test262/node_modules/argparse/lib/action/store/true.js +26 -0
- package/test262/node_modules/argparse/lib/action/store.js +50 -0
- package/test262/node_modules/argparse/lib/action/subparsers.js +149 -0
- package/test262/node_modules/argparse/lib/action/version.js +47 -0
- package/test262/node_modules/argparse/lib/action.js +146 -0
- package/test262/node_modules/argparse/lib/action_container.js +482 -0
- package/test262/node_modules/argparse/lib/argparse.js +14 -0
- package/test262/node_modules/argparse/lib/argument/error.js +50 -0
- package/test262/node_modules/argparse/lib/argument/exclusive.js +54 -0
- package/test262/node_modules/argparse/lib/argument/group.js +75 -0
- package/test262/node_modules/argparse/lib/argument_parser.js +1161 -0
- package/test262/node_modules/argparse/lib/const.js +21 -0
- package/test262/node_modules/argparse/lib/help/added_formatters.js +87 -0
- package/test262/node_modules/argparse/lib/help/formatter.js +795 -0
- package/test262/node_modules/argparse/lib/namespace.js +76 -0
- package/test262/node_modules/argparse/lib/utils.js +57 -0
- package/test262/node_modules/argparse/package.json +34 -0
- package/test262/node_modules/braces/CHANGELOG.md +184 -0
- package/test262/node_modules/braces/LICENSE +21 -0
- package/test262/node_modules/braces/README.md +593 -0
- package/test262/node_modules/braces/index.js +170 -0
- package/test262/node_modules/braces/lib/compile.js +57 -0
- package/test262/node_modules/braces/lib/constants.js +57 -0
- package/test262/node_modules/braces/lib/expand.js +113 -0
- package/test262/node_modules/braces/lib/parse.js +333 -0
- package/test262/node_modules/braces/lib/stringify.js +32 -0
- package/test262/node_modules/braces/lib/utils.js +112 -0
- package/test262/node_modules/braces/package.json +77 -0
- package/test262/node_modules/esprima/ChangeLog +235 -0
- package/test262/node_modules/esprima/LICENSE.BSD +21 -0
- package/test262/node_modules/esprima/README.md +46 -0
- package/test262/node_modules/esprima/bin/esparse.js +139 -0
- package/test262/node_modules/esprima/bin/esvalidate.js +236 -0
- package/test262/node_modules/esprima/dist/esprima.js +6709 -0
- package/test262/node_modules/esprima/package.json +112 -0
- package/test262/node_modules/fast-glob/LICENSE +21 -0
- package/test262/node_modules/fast-glob/README.md +859 -0
- package/test262/node_modules/fast-glob/out/index.d.ts +40 -0
- package/test262/node_modules/fast-glob/out/index.js +102 -0
- package/test262/node_modules/fast-glob/out/managers/tasks.d.ts +22 -0
- package/test262/node_modules/fast-glob/out/managers/tasks.js +110 -0
- package/test262/node_modules/fast-glob/out/providers/async.d.ts +9 -0
- package/test262/node_modules/fast-glob/out/providers/async.js +23 -0
- package/test262/node_modules/fast-glob/out/providers/filters/deep.d.ts +16 -0
- package/test262/node_modules/fast-glob/out/providers/filters/deep.js +62 -0
- package/test262/node_modules/fast-glob/out/providers/filters/entry.d.ts +16 -0
- package/test262/node_modules/fast-glob/out/providers/filters/entry.js +63 -0
- package/test262/node_modules/fast-glob/out/providers/filters/error.d.ts +8 -0
- package/test262/node_modules/fast-glob/out/providers/filters/error.js +15 -0
- package/test262/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +33 -0
- package/test262/node_modules/fast-glob/out/providers/matchers/matcher.js +45 -0
- package/test262/node_modules/fast-glob/out/providers/matchers/partial.d.ts +4 -0
- package/test262/node_modules/fast-glob/out/providers/matchers/partial.js +38 -0
- package/test262/node_modules/fast-glob/out/providers/provider.d.ts +19 -0
- package/test262/node_modules/fast-glob/out/providers/provider.js +48 -0
- package/test262/node_modules/fast-glob/out/providers/stream.d.ts +11 -0
- package/test262/node_modules/fast-glob/out/providers/stream.js +31 -0
- package/test262/node_modules/fast-glob/out/providers/sync.d.ts +9 -0
- package/test262/node_modules/fast-glob/out/providers/sync.js +23 -0
- package/test262/node_modules/fast-glob/out/providers/transformers/entry.d.ts +8 -0
- package/test262/node_modules/fast-glob/out/providers/transformers/entry.js +26 -0
- package/test262/node_modules/fast-glob/out/readers/async.d.ts +10 -0
- package/test262/node_modules/fast-glob/out/readers/async.js +35 -0
- package/test262/node_modules/fast-glob/out/readers/reader.d.ts +15 -0
- package/test262/node_modules/fast-glob/out/readers/reader.js +33 -0
- package/test262/node_modules/fast-glob/out/readers/stream.d.ts +14 -0
- package/test262/node_modules/fast-glob/out/readers/stream.js +55 -0
- package/test262/node_modules/fast-glob/out/readers/sync.d.ts +12 -0
- package/test262/node_modules/fast-glob/out/readers/sync.js +43 -0
- package/test262/node_modules/fast-glob/out/settings.d.ts +164 -0
- package/test262/node_modules/fast-glob/out/settings.js +57 -0
- package/test262/node_modules/fast-glob/out/types/index.d.ts +31 -0
- package/test262/node_modules/fast-glob/out/types/index.js +2 -0
- package/test262/node_modules/fast-glob/out/utils/array.d.ts +2 -0
- package/test262/node_modules/fast-glob/out/utils/array.js +22 -0
- package/test262/node_modules/fast-glob/out/utils/errno.d.ts +2 -0
- package/test262/node_modules/fast-glob/out/utils/errno.js +7 -0
- package/test262/node_modules/fast-glob/out/utils/fs.d.ts +4 -0
- package/test262/node_modules/fast-glob/out/utils/fs.js +19 -0
- package/test262/node_modules/fast-glob/out/utils/index.d.ts +8 -0
- package/test262/node_modules/fast-glob/out/utils/index.js +17 -0
- package/test262/node_modules/fast-glob/out/utils/path.d.ts +13 -0
- package/test262/node_modules/fast-glob/out/utils/path.js +68 -0
- package/test262/node_modules/fast-glob/out/utils/pattern.d.ts +47 -0
- package/test262/node_modules/fast-glob/out/utils/pattern.js +188 -0
- package/test262/node_modules/fast-glob/out/utils/stream.d.ts +4 -0
- package/test262/node_modules/fast-glob/out/utils/stream.js +17 -0
- package/test262/node_modules/fast-glob/out/utils/string.d.ts +2 -0
- package/test262/node_modules/fast-glob/out/utils/string.js +11 -0
- package/test262/node_modules/fast-glob/package.json +81 -0
- package/test262/node_modules/fastq/.github/dependabot.yml +11 -0
- package/test262/node_modules/fastq/.github/workflows/ci.yml +50 -0
- package/test262/node_modules/fastq/LICENSE +13 -0
- package/test262/node_modules/fastq/README.md +309 -0
- package/test262/node_modules/fastq/bench.js +66 -0
- package/test262/node_modules/fastq/example.js +14 -0
- package/test262/node_modules/fastq/example.mjs +11 -0
- package/test262/node_modules/fastq/index.d.ts +37 -0
- package/test262/node_modules/fastq/package.json +52 -0
- package/test262/node_modules/fastq/queue.js +289 -0
- package/test262/node_modules/fastq/test/example.ts +81 -0
- package/test262/node_modules/fastq/test/promise.js +248 -0
- package/test262/node_modules/fastq/test/test.js +566 -0
- package/test262/node_modules/fastq/test/tsconfig.json +11 -0
- package/test262/node_modules/fill-range/LICENSE +21 -0
- package/test262/node_modules/fill-range/README.md +237 -0
- package/test262/node_modules/fill-range/index.js +249 -0
- package/test262/node_modules/fill-range/package.json +69 -0
- package/test262/node_modules/glob-parent/CHANGELOG.md +110 -0
- package/test262/node_modules/glob-parent/LICENSE +15 -0
- package/test262/node_modules/glob-parent/README.md +137 -0
- package/test262/node_modules/glob-parent/index.js +42 -0
- package/test262/node_modules/glob-parent/package.json +48 -0
- package/test262/node_modules/graceful-fs/LICENSE +15 -0
- package/test262/node_modules/graceful-fs/README.md +143 -0
- package/test262/node_modules/graceful-fs/clone.js +23 -0
- package/test262/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/test262/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/test262/node_modules/graceful-fs/package.json +53 -0
- package/test262/node_modules/graceful-fs/polyfills.js +355 -0
- package/test262/node_modules/is-extglob/LICENSE +21 -0
- package/test262/node_modules/is-extglob/README.md +107 -0
- package/test262/node_modules/is-extglob/index.js +20 -0
- package/test262/node_modules/is-extglob/package.json +69 -0
- package/test262/node_modules/is-glob/LICENSE +21 -0
- package/test262/node_modules/is-glob/README.md +206 -0
- package/test262/node_modules/is-glob/index.js +150 -0
- package/test262/node_modules/is-glob/package.json +81 -0
- package/test262/node_modules/is-number/LICENSE +21 -0
- package/test262/node_modules/is-number/README.md +187 -0
- package/test262/node_modules/is-number/index.js +18 -0
- package/test262/node_modules/is-number/package.json +82 -0
- package/test262/node_modules/js-yaml/CHANGELOG.md +557 -0
- package/test262/node_modules/js-yaml/LICENSE +21 -0
- package/test262/node_modules/js-yaml/README.md +299 -0
- package/test262/node_modules/js-yaml/bin/js-yaml.js +132 -0
- package/test262/node_modules/js-yaml/dist/js-yaml.js +3989 -0
- package/test262/node_modules/js-yaml/dist/js-yaml.min.js +1 -0
- package/test262/node_modules/js-yaml/index.js +7 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/common.js +59 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/dumper.js +850 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/exception.js +43 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/loader.js +1644 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/mark.js +76 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/schema.js +108 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/binary.js +138 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/bool.js +35 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/float.js +116 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/int.js +173 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/js/function.js +93 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +60 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/null.js +34 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/omap.js +44 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/pairs.js +53 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/set.js +29 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +88 -0
- package/test262/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
- package/test262/node_modules/js-yaml/lib/js-yaml.js +39 -0
- package/test262/node_modules/js-yaml/package.json +49 -0
- package/test262/node_modules/klaw/CHANGELOG.md +62 -0
- package/test262/node_modules/klaw/LICENSE +15 -0
- package/test262/node_modules/klaw/README.md +252 -0
- package/test262/node_modules/klaw/package.json +40 -0
- package/test262/node_modules/klaw/src/index.js +56 -0
- package/test262/node_modules/merge2/LICENSE +21 -0
- package/test262/node_modules/merge2/README.md +144 -0
- package/test262/node_modules/merge2/index.js +144 -0
- package/test262/node_modules/merge2/package.json +43 -0
- package/test262/node_modules/micromatch/LICENSE +21 -0
- package/test262/node_modules/micromatch/README.md +1011 -0
- package/test262/node_modules/micromatch/index.js +467 -0
- package/test262/node_modules/micromatch/package.json +119 -0
- package/test262/node_modules/picomatch/CHANGELOG.md +136 -0
- package/test262/node_modules/picomatch/LICENSE +21 -0
- package/test262/node_modules/picomatch/README.md +708 -0
- package/test262/node_modules/picomatch/index.js +3 -0
- package/test262/node_modules/picomatch/lib/constants.js +179 -0
- package/test262/node_modules/picomatch/lib/parse.js +1091 -0
- package/test262/node_modules/picomatch/lib/picomatch.js +342 -0
- package/test262/node_modules/picomatch/lib/scan.js +391 -0
- package/test262/node_modules/picomatch/lib/utils.js +64 -0
- package/test262/node_modules/picomatch/package.json +81 -0
- package/test262/node_modules/queue-microtask/LICENSE +20 -0
- package/test262/node_modules/queue-microtask/README.md +90 -0
- package/test262/node_modules/queue-microtask/index.d.ts +2 -0
- package/test262/node_modules/queue-microtask/index.js +9 -0
- package/test262/node_modules/queue-microtask/package.json +55 -0
- package/test262/node_modules/reusify/.coveralls.yml +1 -0
- package/test262/node_modules/reusify/.travis.yml +28 -0
- package/test262/node_modules/reusify/LICENSE +22 -0
- package/test262/node_modules/reusify/README.md +145 -0
- package/test262/node_modules/reusify/benchmarks/createNoCodeFunction.js +30 -0
- package/test262/node_modules/reusify/benchmarks/fib.js +13 -0
- package/test262/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +38 -0
- package/test262/node_modules/reusify/package.json +45 -0
- package/test262/node_modules/reusify/reusify.js +33 -0
- package/test262/node_modules/reusify/test.js +66 -0
- package/test262/node_modules/run-parallel/LICENSE +20 -0
- package/test262/node_modules/run-parallel/README.md +85 -0
- package/test262/node_modules/run-parallel/index.js +51 -0
- package/test262/node_modules/run-parallel/package.json +58 -0
- package/test262/node_modules/sprintf-js/LICENSE +24 -0
- package/test262/node_modules/sprintf-js/README.md +88 -0
- package/test262/node_modules/sprintf-js/bower.json +14 -0
- package/test262/node_modules/sprintf-js/demo/angular.html +20 -0
- package/test262/node_modules/sprintf-js/dist/angular-sprintf.min.js +4 -0
- package/test262/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +1 -0
- package/test262/node_modules/sprintf-js/dist/angular-sprintf.min.map +1 -0
- package/test262/node_modules/sprintf-js/dist/sprintf.min.js +4 -0
- package/test262/node_modules/sprintf-js/dist/sprintf.min.js.map +1 -0
- package/test262/node_modules/sprintf-js/dist/sprintf.min.map +1 -0
- package/test262/node_modules/sprintf-js/gruntfile.js +36 -0
- package/test262/node_modules/sprintf-js/package.json +22 -0
- package/test262/node_modules/sprintf-js/src/angular-sprintf.js +18 -0
- package/test262/node_modules/sprintf-js/src/sprintf.js +208 -0
- package/test262/node_modules/sprintf-js/test/test.js +82 -0
- package/test262/node_modules/test262-stream/.jshintignore +2 -0
- package/test262/node_modules/test262-stream/.jshintrc +6 -0
- package/test262/node_modules/test262-stream/.travis.yml +5 -0
- package/test262/node_modules/test262-stream/CONTRIBUTING.md +37 -0
- package/test262/node_modules/test262-stream/LICENSE-MICROSOFT.txt +27 -0
- package/test262/node_modules/test262-stream/LICENSE.txt +27 -0
- package/test262/node_modules/test262-stream/README.md +71 -0
- package/test262/node_modules/test262-stream/lib/builder.js +46 -0
- package/test262/node_modules/test262-stream/lib/compile.js +24 -0
- package/test262/node_modules/test262-stream/lib/create-scenarios.js +29 -0
- package/test262/node_modules/test262-stream/lib/index.js +187 -0
- package/test262/node_modules/test262-stream/lib/test-file.js +150 -0
- package/test262/node_modules/test262-stream/package.json +26 -0
- package/test262/node_modules/test262-stream/test/collateral/invalid-missing-harness/fake-test262/test/a-test-file.js +16 -0
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-other-accepted/fake-test262/harness/assert.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-other-accepted/fake-test262/harness/doneprintHandle.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-other-accepted/fake-test262/harness/sta.js +12 -0
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-other-accepted/fake-test262/package.json +3 -0
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-other-accepted/fake-test262/test/strict.js +9 -0
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-unsupported/fake-test262/harness/assert.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-unsupported/fake-test262/harness/doneprintHandle.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-unsupported/fake-test262/harness/sta.js +12 -0
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-unsupported/fake-test262/package.json +3 -0
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-unsupported/fake-test262/test/strict.js +9 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/asyncNegative_default.js +49 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/asyncNegative_strict_mode.js +50 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/async_default.js +48 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/async_strict_mode.js +49 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/bothStrict_default.js +46 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/bothStrict_strict_mode.js +47 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/error_default.js +39 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/error_strict_mode.js +40 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/module_default.js +37 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/module_strict_mode.js +38 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/negative-empty_default.js +37 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/negative-empty_strict_mode.js +38 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/noStrict_default.js +36 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/rawNoStrict_default.js +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/rawStrict_default.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/strict_strict_mode.js +41 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/asyncNegative_default.json +22 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/asyncNegative_strict_mode.json +22 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/async_default.json +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/async_strict_mode.json +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/bothStrict_default.json +24 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/bothStrict_strict_mode.json +24 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/error_default.json +19 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/error_strict_mode.json +19 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/module_default.json +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/module_strict_mode.json +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/negative-empty_default.json +19 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/negative-empty_strict_mode.json +19 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/noStrict_default.json +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/rawNoStrict_default.json +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/rawStrict_default.json +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/strict_strict_mode.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/harness/assert.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/harness/doneprintHandle.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/harness/sta.js +12 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/async.js +10 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/asyncNegative.js +11 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/bothStrict.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/error.js +8 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/module.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/module_FIXTURE.js +2 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/negative-empty.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/noStrict.js +5 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/rawNoStrict.js +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/rawStrict.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/strict.js +9 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/expected-content/test/bothStrict_default.js +46 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/expected-content/test/bothStrict_strict_mode.js +47 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/expected-metadata/test/bothStrict_default.json +24 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/expected-metadata/test/bothStrict_strict_mode.json +24 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/harness/assert.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/harness/doneprintHandle.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/harness/sta.js +12 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/bothStrict.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-0_FIXTURE.js +2 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-1_FIXTURE.js +2 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-2_FIXTURE.js +2 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-3_FIXTURE.js +2 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-4_FIXTURE.js +2 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-5_FIXTURE.js +2 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-6_FIXTURE.js +2 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-7_FIXTURE.js +2 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-8_FIXTURE.js +2 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-9_FIXTURE.txt +2 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/expected-content/test/raw_default.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/expected-content/test/runtime_default.js +38 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/expected-content/test/runtime_strict_mode.js +39 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/expected-metadata/test/raw_default.json +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/expected-metadata/test/runtime_default.json +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/expected-metadata/test/runtime_strict_mode.json +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/fake-test262/harness/assert.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/fake-test262/harness/sta.js +12 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/fake-test262/test/raw.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/fake-test262/test/runtime.js +7 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/asyncNegative_default.js +11 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/asyncNegative_strict_mode.js +12 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/async_default.js +10 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/async_strict_mode.js +11 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/bothStrict_default.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/bothStrict_strict_mode.js +16 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/error_default.js +8 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/error_strict_mode.js +9 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/module_default.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/module_strict_mode.js +7 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/negative-empty_default.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/negative-empty_strict_mode.js +7 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/noStrict_default.js +5 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/rawNoStrict_default.js +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/rawStrict_default.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/strict_strict_mode.js +10 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/asyncNegative_default.json +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/asyncNegative_strict_mode.json +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/async_default.json +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/async_strict_mode.json +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/bothStrict_default.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/bothStrict_strict_mode.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/error_default.json +16 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/error_strict_mode.json +16 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/module_default.json +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/module_strict_mode.json +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/negative-empty_default.json +16 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/negative-empty_strict_mode.json +16 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/noStrict_default.json +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/rawNoStrict_default.json +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/rawStrict_default.json +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/strict_strict_mode.json +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/harness/assert.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/harness/doneprintHandle.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/harness/sta.js +12 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/async.js +10 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/asyncNegative.js +11 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/bothStrict.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/error.js +8 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/module.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/module_FIXTURE.js +2 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/negative-empty.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/noStrict.js +5 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/rawNoStrict.js +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/rawStrict.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/strict.js +9 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/expected-content/test/strict_strict_mode.js +41 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/expected-metadata/test/strict_strict_mode.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/fake-test262/harness/assert.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/fake-test262/harness/doneprintHandle.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/fake-test262/harness/sta.js +12 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/fake-test262/package.json +3 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/fake-test262/test/strict.js +9 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/expected-content/test/strict_strict_mode.js +41 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/expected-metadata/test/strict_strict_mode.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/fake-test262/harness/assert.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/fake-test262/harness/doneprintHandle.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/fake-test262/harness/sta.js +12 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/fake-test262/package.json +3 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/fake-test262/test/strict.js +9 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/missing-raw-flag_default.js +44 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/missing-raw-flag_strict_mode.js +45 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw-with-ls-and-license-on-same-line_default.js +20 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw-with-ls-multiline-block_default.js +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw-with-ls_default.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw-with-ps-and-license-on-same-line_default.js +20 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw-with-ps-multiline-block_default.js +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw-with-ps_default.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/rawWithLicense_default.js +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw_default.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/missing-raw-flag_default.json +22 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/missing-raw-flag_strict_mode.json +22 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw-with-ls-and-license-on-same-line_default.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw-with-ls-multiline-block_default.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw-with-ls_default.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw-with-ps-and-license-on-same-line_default.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw-with-ps-multiline-block_default.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw-with-ps_default.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/rawWithLicense_default.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw_default.json +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/harness/assert.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/harness/doneprintHandle.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/harness/sta.js +12 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/missing-raw-flag.js +13 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw-with-ls-and-license-on-same-line.js +20 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw-with-ls-multiline-block.js +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw-with-ls.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw-with-ps-and-license-on-same-line.js +20 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw-with-ps-multiline-block.js +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw-with-ps.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/rawWithLicense.js +21 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/custom-includes/assert.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/custom-includes/doneprintHandle.js +9 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/custom-includes/sta.js +13 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-content/test/async_default.js +52 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-content/test/async_strict_mode.js +53 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-content/test/bothStrict_default.js +47 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-content/test/bothStrict_strict_mode.js +48 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-metadata/test/async_default.json +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-metadata/test/async_strict_mode.json +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-metadata/test/bothStrict_default.json +24 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-metadata/test/bothStrict_strict_mode.json +24 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/fake-test262/harness/assert.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/fake-test262/harness/doneprintHandle.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/fake-test262/test/async.js +10 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/fake-test262/test/bothStrict.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/async/asyncNegative_default.js +49 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/async/asyncNegative_strict_mode.js +50 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/async/async_default.js +48 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/async/async_strict_mode.js +49 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/bothStrict_default.js +46 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/bothStrict_strict_mode.js +47 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/strict/no/noStrict_default.js +36 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/strict/no/rawNoStrict_default.js +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/async/asyncNegative_default.json +22 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/async/asyncNegative_strict_mode.json +22 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/async/async_default.json +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/async/async_strict_mode.json +18 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/bothStrict_default.json +24 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/bothStrict_strict_mode.json +24 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/strict/no/noStrict_default.json +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/strict/no/rawNoStrict_default.json +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/harness/assert.js +17 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/harness/doneprintHandle.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/harness/sta.js +12 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/async/async.js +10 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/async/asyncNegative.js +11 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/bothStrict.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/error.js +8 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/negative-empty.js +6 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/strict/no/noStrict.js +5 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/strict/no/rawNoStrict.js +14 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/strict/rawStrict.js +15 -0
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/strict/strict.js +9 -0
- package/test262/node_modules/test262-stream/test/test.js +319 -0
- package/test262/node_modules/to-regex-range/LICENSE +21 -0
- package/test262/node_modules/to-regex-range/README.md +305 -0
- package/test262/node_modules/to-regex-range/index.js +288 -0
- package/test262/node_modules/to-regex-range/package.json +88 -0
- package/test262/package-lock.json +279 -0
- package/test262/package.json +6 -0
- package/test262/prelude.js +75 -0
- package/test262/results.json +1 -0
- package/util/enum.js +20 -0
@@ -0,0 +1,482 @@
|
|
1
|
+
/** internal
|
2
|
+
* class ActionContainer
|
3
|
+
*
|
4
|
+
* Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]]
|
5
|
+
**/
|
6
|
+
|
7
|
+
'use strict';
|
8
|
+
|
9
|
+
var format = require('util').format;
|
10
|
+
|
11
|
+
// Constants
|
12
|
+
var c = require('./const');
|
13
|
+
|
14
|
+
var $$ = require('./utils');
|
15
|
+
|
16
|
+
//Actions
|
17
|
+
var ActionHelp = require('./action/help');
|
18
|
+
var ActionAppend = require('./action/append');
|
19
|
+
var ActionAppendConstant = require('./action/append/constant');
|
20
|
+
var ActionCount = require('./action/count');
|
21
|
+
var ActionStore = require('./action/store');
|
22
|
+
var ActionStoreConstant = require('./action/store/constant');
|
23
|
+
var ActionStoreTrue = require('./action/store/true');
|
24
|
+
var ActionStoreFalse = require('./action/store/false');
|
25
|
+
var ActionVersion = require('./action/version');
|
26
|
+
var ActionSubparsers = require('./action/subparsers');
|
27
|
+
|
28
|
+
// Errors
|
29
|
+
var argumentErrorHelper = require('./argument/error');
|
30
|
+
|
31
|
+
/**
|
32
|
+
* new ActionContainer(options)
|
33
|
+
*
|
34
|
+
* Action container. Parent for [[ArgumentParser]] and [[ArgumentGroup]]
|
35
|
+
*
|
36
|
+
* ##### Options:
|
37
|
+
*
|
38
|
+
* - `description` -- A description of what the program does
|
39
|
+
* - `prefixChars` -- Characters that prefix optional arguments
|
40
|
+
* - `argumentDefault` -- The default value for all arguments
|
41
|
+
* - `conflictHandler` -- The conflict handler to use for duplicate arguments
|
42
|
+
**/
|
43
|
+
var ActionContainer = module.exports = function ActionContainer(options) {
|
44
|
+
options = options || {};
|
45
|
+
|
46
|
+
this.description = options.description;
|
47
|
+
this.argumentDefault = options.argumentDefault;
|
48
|
+
this.prefixChars = options.prefixChars || '';
|
49
|
+
this.conflictHandler = options.conflictHandler;
|
50
|
+
|
51
|
+
// set up registries
|
52
|
+
this._registries = {};
|
53
|
+
|
54
|
+
// register actions
|
55
|
+
this.register('action', null, ActionStore);
|
56
|
+
this.register('action', 'store', ActionStore);
|
57
|
+
this.register('action', 'storeConst', ActionStoreConstant);
|
58
|
+
this.register('action', 'storeTrue', ActionStoreTrue);
|
59
|
+
this.register('action', 'storeFalse', ActionStoreFalse);
|
60
|
+
this.register('action', 'append', ActionAppend);
|
61
|
+
this.register('action', 'appendConst', ActionAppendConstant);
|
62
|
+
this.register('action', 'count', ActionCount);
|
63
|
+
this.register('action', 'help', ActionHelp);
|
64
|
+
this.register('action', 'version', ActionVersion);
|
65
|
+
this.register('action', 'parsers', ActionSubparsers);
|
66
|
+
|
67
|
+
// raise an exception if the conflict handler is invalid
|
68
|
+
this._getHandler();
|
69
|
+
|
70
|
+
// action storage
|
71
|
+
this._actions = [];
|
72
|
+
this._optionStringActions = {};
|
73
|
+
|
74
|
+
// groups
|
75
|
+
this._actionGroups = [];
|
76
|
+
this._mutuallyExclusiveGroups = [];
|
77
|
+
|
78
|
+
// defaults storage
|
79
|
+
this._defaults = {};
|
80
|
+
|
81
|
+
// determines whether an "option" looks like a negative number
|
82
|
+
// -1, -1.5 -5e+4
|
83
|
+
this._regexpNegativeNumber = new RegExp('^[-]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$');
|
84
|
+
|
85
|
+
// whether or not there are any optionals that look like negative
|
86
|
+
// numbers -- uses a list so it can be shared and edited
|
87
|
+
this._hasNegativeNumberOptionals = [];
|
88
|
+
};
|
89
|
+
|
90
|
+
// Groups must be required, then ActionContainer already defined
|
91
|
+
var ArgumentGroup = require('./argument/group');
|
92
|
+
var MutuallyExclusiveGroup = require('./argument/exclusive');
|
93
|
+
|
94
|
+
//
|
95
|
+
// Registration methods
|
96
|
+
//
|
97
|
+
|
98
|
+
/**
|
99
|
+
* ActionContainer#register(registryName, value, object) -> Void
|
100
|
+
* - registryName (String) : object type action|type
|
101
|
+
* - value (string) : keyword
|
102
|
+
* - object (Object|Function) : handler
|
103
|
+
*
|
104
|
+
* Register handlers
|
105
|
+
**/
|
106
|
+
ActionContainer.prototype.register = function (registryName, value, object) {
|
107
|
+
this._registries[registryName] = this._registries[registryName] || {};
|
108
|
+
this._registries[registryName][value] = object;
|
109
|
+
};
|
110
|
+
|
111
|
+
ActionContainer.prototype._registryGet = function (registryName, value, defaultValue) {
|
112
|
+
if (arguments.length < 3) {
|
113
|
+
defaultValue = null;
|
114
|
+
}
|
115
|
+
return this._registries[registryName][value] || defaultValue;
|
116
|
+
};
|
117
|
+
|
118
|
+
//
|
119
|
+
// Namespace default accessor methods
|
120
|
+
//
|
121
|
+
|
122
|
+
/**
|
123
|
+
* ActionContainer#setDefaults(options) -> Void
|
124
|
+
* - options (object):hash of options see [[Action.new]]
|
125
|
+
*
|
126
|
+
* Set defaults
|
127
|
+
**/
|
128
|
+
ActionContainer.prototype.setDefaults = function (options) {
|
129
|
+
options = options || {};
|
130
|
+
for (var property in options) {
|
131
|
+
if ($$.has(options, property)) {
|
132
|
+
this._defaults[property] = options[property];
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
// if these defaults match any existing arguments, replace the previous
|
137
|
+
// default on the object with the new one
|
138
|
+
this._actions.forEach(function (action) {
|
139
|
+
if ($$.has(options, action.dest)) {
|
140
|
+
action.defaultValue = options[action.dest];
|
141
|
+
}
|
142
|
+
});
|
143
|
+
};
|
144
|
+
|
145
|
+
/**
|
146
|
+
* ActionContainer#getDefault(dest) -> Mixed
|
147
|
+
* - dest (string): action destination
|
148
|
+
*
|
149
|
+
* Return action default value
|
150
|
+
**/
|
151
|
+
ActionContainer.prototype.getDefault = function (dest) {
|
152
|
+
var result = $$.has(this._defaults, dest) ? this._defaults[dest] : null;
|
153
|
+
|
154
|
+
this._actions.forEach(function (action) {
|
155
|
+
if (action.dest === dest && $$.has(action, 'defaultValue')) {
|
156
|
+
result = action.defaultValue;
|
157
|
+
}
|
158
|
+
});
|
159
|
+
|
160
|
+
return result;
|
161
|
+
};
|
162
|
+
//
|
163
|
+
// Adding argument actions
|
164
|
+
//
|
165
|
+
|
166
|
+
/**
|
167
|
+
* ActionContainer#addArgument(args, options) -> Object
|
168
|
+
* - args (String|Array): argument key, or array of argument keys
|
169
|
+
* - options (Object): action objects see [[Action.new]]
|
170
|
+
*
|
171
|
+
* #### Examples
|
172
|
+
* - addArgument([ '-f', '--foo' ], { action: 'store', defaultValue: 1, ... })
|
173
|
+
* - addArgument([ 'bar' ], { action: 'store', nargs: 1, ... })
|
174
|
+
* - addArgument('--baz', { action: 'store', nargs: 1, ... })
|
175
|
+
**/
|
176
|
+
ActionContainer.prototype.addArgument = function (args, options) {
|
177
|
+
args = args;
|
178
|
+
options = options || {};
|
179
|
+
|
180
|
+
if (typeof args === 'string') {
|
181
|
+
args = [ args ];
|
182
|
+
}
|
183
|
+
if (!Array.isArray(args)) {
|
184
|
+
throw new TypeError('addArgument first argument should be a string or an array');
|
185
|
+
}
|
186
|
+
if (typeof options !== 'object' || Array.isArray(options)) {
|
187
|
+
throw new TypeError('addArgument second argument should be a hash');
|
188
|
+
}
|
189
|
+
|
190
|
+
// if no positional args are supplied or only one is supplied and
|
191
|
+
// it doesn't look like an option string, parse a positional argument
|
192
|
+
if (!args || args.length === 1 && this.prefixChars.indexOf(args[0][0]) < 0) {
|
193
|
+
if (args && !!options.dest) {
|
194
|
+
throw new Error('dest supplied twice for positional argument');
|
195
|
+
}
|
196
|
+
options = this._getPositional(args, options);
|
197
|
+
|
198
|
+
// otherwise, we're adding an optional argument
|
199
|
+
} else {
|
200
|
+
options = this._getOptional(args, options);
|
201
|
+
}
|
202
|
+
|
203
|
+
// if no default was supplied, use the parser-level default
|
204
|
+
if (typeof options.defaultValue === 'undefined') {
|
205
|
+
var dest = options.dest;
|
206
|
+
if ($$.has(this._defaults, dest)) {
|
207
|
+
options.defaultValue = this._defaults[dest];
|
208
|
+
} else if (typeof this.argumentDefault !== 'undefined') {
|
209
|
+
options.defaultValue = this.argumentDefault;
|
210
|
+
}
|
211
|
+
}
|
212
|
+
|
213
|
+
// create the action object, and add it to the parser
|
214
|
+
var ActionClass = this._popActionClass(options);
|
215
|
+
if (typeof ActionClass !== 'function') {
|
216
|
+
throw new Error(format('Unknown action "%s".', ActionClass));
|
217
|
+
}
|
218
|
+
var action = new ActionClass(options);
|
219
|
+
|
220
|
+
// throw an error if the action type is not callable
|
221
|
+
var typeFunction = this._registryGet('type', action.type, action.type);
|
222
|
+
if (typeof typeFunction !== 'function') {
|
223
|
+
throw new Error(format('"%s" is not callable', typeFunction));
|
224
|
+
}
|
225
|
+
|
226
|
+
return this._addAction(action);
|
227
|
+
};
|
228
|
+
|
229
|
+
/**
|
230
|
+
* ActionContainer#addArgumentGroup(options) -> ArgumentGroup
|
231
|
+
* - options (Object): hash of options see [[ArgumentGroup.new]]
|
232
|
+
*
|
233
|
+
* Create new arguments groups
|
234
|
+
**/
|
235
|
+
ActionContainer.prototype.addArgumentGroup = function (options) {
|
236
|
+
var group = new ArgumentGroup(this, options);
|
237
|
+
this._actionGroups.push(group);
|
238
|
+
return group;
|
239
|
+
};
|
240
|
+
|
241
|
+
/**
|
242
|
+
* ActionContainer#addMutuallyExclusiveGroup(options) -> ArgumentGroup
|
243
|
+
* - options (Object): {required: false}
|
244
|
+
*
|
245
|
+
* Create new mutual exclusive groups
|
246
|
+
**/
|
247
|
+
ActionContainer.prototype.addMutuallyExclusiveGroup = function (options) {
|
248
|
+
var group = new MutuallyExclusiveGroup(this, options);
|
249
|
+
this._mutuallyExclusiveGroups.push(group);
|
250
|
+
return group;
|
251
|
+
};
|
252
|
+
|
253
|
+
ActionContainer.prototype._addAction = function (action) {
|
254
|
+
var self = this;
|
255
|
+
|
256
|
+
// resolve any conflicts
|
257
|
+
this._checkConflict(action);
|
258
|
+
|
259
|
+
// add to actions list
|
260
|
+
this._actions.push(action);
|
261
|
+
action.container = this;
|
262
|
+
|
263
|
+
// index the action by any option strings it has
|
264
|
+
action.optionStrings.forEach(function (optionString) {
|
265
|
+
self._optionStringActions[optionString] = action;
|
266
|
+
});
|
267
|
+
|
268
|
+
// set the flag if any option strings look like negative numbers
|
269
|
+
action.optionStrings.forEach(function (optionString) {
|
270
|
+
if (optionString.match(self._regexpNegativeNumber)) {
|
271
|
+
if (!self._hasNegativeNumberOptionals.some(Boolean)) {
|
272
|
+
self._hasNegativeNumberOptionals.push(true);
|
273
|
+
}
|
274
|
+
}
|
275
|
+
});
|
276
|
+
|
277
|
+
// return the created action
|
278
|
+
return action;
|
279
|
+
};
|
280
|
+
|
281
|
+
ActionContainer.prototype._removeAction = function (action) {
|
282
|
+
var actionIndex = this._actions.indexOf(action);
|
283
|
+
if (actionIndex >= 0) {
|
284
|
+
this._actions.splice(actionIndex, 1);
|
285
|
+
}
|
286
|
+
};
|
287
|
+
|
288
|
+
ActionContainer.prototype._addContainerActions = function (container) {
|
289
|
+
// collect groups by titles
|
290
|
+
var titleGroupMap = {};
|
291
|
+
this._actionGroups.forEach(function (group) {
|
292
|
+
if (titleGroupMap[group.title]) {
|
293
|
+
throw new Error(format('Cannot merge actions - two groups are named "%s".', group.title));
|
294
|
+
}
|
295
|
+
titleGroupMap[group.title] = group;
|
296
|
+
});
|
297
|
+
|
298
|
+
// map each action to its group
|
299
|
+
var groupMap = {};
|
300
|
+
function actionHash(action) {
|
301
|
+
// unique (hopefully?) string suitable as dictionary key
|
302
|
+
return action.getName();
|
303
|
+
}
|
304
|
+
container._actionGroups.forEach(function (group) {
|
305
|
+
// if a group with the title exists, use that, otherwise
|
306
|
+
// create a new group matching the container's group
|
307
|
+
if (!titleGroupMap[group.title]) {
|
308
|
+
titleGroupMap[group.title] = this.addArgumentGroup({
|
309
|
+
title: group.title,
|
310
|
+
description: group.description
|
311
|
+
});
|
312
|
+
}
|
313
|
+
|
314
|
+
// map the actions to their new group
|
315
|
+
group._groupActions.forEach(function (action) {
|
316
|
+
groupMap[actionHash(action)] = titleGroupMap[group.title];
|
317
|
+
});
|
318
|
+
}, this);
|
319
|
+
|
320
|
+
// add container's mutually exclusive groups
|
321
|
+
// NOTE: if add_mutually_exclusive_group ever gains title= and
|
322
|
+
// description= then this code will need to be expanded as above
|
323
|
+
var mutexGroup;
|
324
|
+
container._mutuallyExclusiveGroups.forEach(function (group) {
|
325
|
+
mutexGroup = this.addMutuallyExclusiveGroup({
|
326
|
+
required: group.required
|
327
|
+
});
|
328
|
+
// map the actions to their new mutex group
|
329
|
+
group._groupActions.forEach(function (action) {
|
330
|
+
groupMap[actionHash(action)] = mutexGroup;
|
331
|
+
});
|
332
|
+
}, this); // forEach takes a 'this' argument
|
333
|
+
|
334
|
+
// add all actions to this container or their group
|
335
|
+
container._actions.forEach(function (action) {
|
336
|
+
var key = actionHash(action);
|
337
|
+
if (groupMap[key]) {
|
338
|
+
groupMap[key]._addAction(action);
|
339
|
+
} else {
|
340
|
+
this._addAction(action);
|
341
|
+
}
|
342
|
+
});
|
343
|
+
};
|
344
|
+
|
345
|
+
ActionContainer.prototype._getPositional = function (dest, options) {
|
346
|
+
if (Array.isArray(dest)) {
|
347
|
+
dest = dest[0];
|
348
|
+
}
|
349
|
+
// make sure required is not specified
|
350
|
+
if (options.required) {
|
351
|
+
throw new Error('"required" is an invalid argument for positionals.');
|
352
|
+
}
|
353
|
+
|
354
|
+
// mark positional arguments as required if at least one is
|
355
|
+
// always required
|
356
|
+
if (options.nargs !== c.OPTIONAL && options.nargs !== c.ZERO_OR_MORE) {
|
357
|
+
options.required = true;
|
358
|
+
}
|
359
|
+
if (options.nargs === c.ZERO_OR_MORE && typeof options.defaultValue === 'undefined') {
|
360
|
+
options.required = true;
|
361
|
+
}
|
362
|
+
|
363
|
+
// return the keyword arguments with no option strings
|
364
|
+
options.dest = dest;
|
365
|
+
options.optionStrings = [];
|
366
|
+
return options;
|
367
|
+
};
|
368
|
+
|
369
|
+
ActionContainer.prototype._getOptional = function (args, options) {
|
370
|
+
var prefixChars = this.prefixChars;
|
371
|
+
var optionStrings = [];
|
372
|
+
var optionStringsLong = [];
|
373
|
+
|
374
|
+
// determine short and long option strings
|
375
|
+
args.forEach(function (optionString) {
|
376
|
+
// error on strings that don't start with an appropriate prefix
|
377
|
+
if (prefixChars.indexOf(optionString[0]) < 0) {
|
378
|
+
throw new Error(format('Invalid option string "%s": must start with a "%s".',
|
379
|
+
optionString,
|
380
|
+
prefixChars
|
381
|
+
));
|
382
|
+
}
|
383
|
+
|
384
|
+
// strings starting with two prefix characters are long options
|
385
|
+
optionStrings.push(optionString);
|
386
|
+
if (optionString.length > 1 && prefixChars.indexOf(optionString[1]) >= 0) {
|
387
|
+
optionStringsLong.push(optionString);
|
388
|
+
}
|
389
|
+
});
|
390
|
+
|
391
|
+
// infer dest, '--foo-bar' -> 'foo_bar' and '-x' -> 'x'
|
392
|
+
var dest = options.dest || null;
|
393
|
+
delete options.dest;
|
394
|
+
|
395
|
+
if (!dest) {
|
396
|
+
var optionStringDest = optionStringsLong.length ? optionStringsLong[0] : optionStrings[0];
|
397
|
+
dest = $$.trimChars(optionStringDest, this.prefixChars);
|
398
|
+
|
399
|
+
if (dest.length === 0) {
|
400
|
+
throw new Error(
|
401
|
+
format('dest= is required for options like "%s"', optionStrings.join(', '))
|
402
|
+
);
|
403
|
+
}
|
404
|
+
dest = dest.replace(/-/g, '_');
|
405
|
+
}
|
406
|
+
|
407
|
+
// return the updated keyword arguments
|
408
|
+
options.dest = dest;
|
409
|
+
options.optionStrings = optionStrings;
|
410
|
+
|
411
|
+
return options;
|
412
|
+
};
|
413
|
+
|
414
|
+
ActionContainer.prototype._popActionClass = function (options, defaultValue) {
|
415
|
+
defaultValue = defaultValue || null;
|
416
|
+
|
417
|
+
var action = (options.action || defaultValue);
|
418
|
+
delete options.action;
|
419
|
+
|
420
|
+
var actionClass = this._registryGet('action', action, action);
|
421
|
+
return actionClass;
|
422
|
+
};
|
423
|
+
|
424
|
+
ActionContainer.prototype._getHandler = function () {
|
425
|
+
var handlerString = this.conflictHandler;
|
426
|
+
var handlerFuncName = '_handleConflict' + $$.capitalize(handlerString);
|
427
|
+
var func = this[handlerFuncName];
|
428
|
+
if (typeof func === 'undefined') {
|
429
|
+
var msg = 'invalid conflict resolution value: ' + handlerString;
|
430
|
+
throw new Error(msg);
|
431
|
+
} else {
|
432
|
+
return func;
|
433
|
+
}
|
434
|
+
};
|
435
|
+
|
436
|
+
ActionContainer.prototype._checkConflict = function (action) {
|
437
|
+
var optionStringActions = this._optionStringActions;
|
438
|
+
var conflictOptionals = [];
|
439
|
+
|
440
|
+
// find all options that conflict with this option
|
441
|
+
// collect pairs, the string, and an existing action that it conflicts with
|
442
|
+
action.optionStrings.forEach(function (optionString) {
|
443
|
+
var conflOptional = optionStringActions[optionString];
|
444
|
+
if (typeof conflOptional !== 'undefined') {
|
445
|
+
conflictOptionals.push([ optionString, conflOptional ]);
|
446
|
+
}
|
447
|
+
});
|
448
|
+
|
449
|
+
if (conflictOptionals.length > 0) {
|
450
|
+
var conflictHandler = this._getHandler();
|
451
|
+
conflictHandler.call(this, action, conflictOptionals);
|
452
|
+
}
|
453
|
+
};
|
454
|
+
|
455
|
+
ActionContainer.prototype._handleConflictError = function (action, conflOptionals) {
|
456
|
+
var conflicts = conflOptionals.map(function (pair) { return pair[0]; });
|
457
|
+
conflicts = conflicts.join(', ');
|
458
|
+
throw argumentErrorHelper(
|
459
|
+
action,
|
460
|
+
format('Conflicting option string(s): %s', conflicts)
|
461
|
+
);
|
462
|
+
};
|
463
|
+
|
464
|
+
ActionContainer.prototype._handleConflictResolve = function (action, conflOptionals) {
|
465
|
+
// remove all conflicting options
|
466
|
+
var self = this;
|
467
|
+
conflOptionals.forEach(function (pair) {
|
468
|
+
var optionString = pair[0];
|
469
|
+
var conflictingAction = pair[1];
|
470
|
+
// remove the conflicting option string
|
471
|
+
var i = conflictingAction.optionStrings.indexOf(optionString);
|
472
|
+
if (i >= 0) {
|
473
|
+
conflictingAction.optionStrings.splice(i, 1);
|
474
|
+
}
|
475
|
+
delete self._optionStringActions[optionString];
|
476
|
+
// if the option now has no option string, remove it from the
|
477
|
+
// container holding it
|
478
|
+
if (conflictingAction.optionStrings.length === 0) {
|
479
|
+
conflictingAction.container._removeAction(conflictingAction);
|
480
|
+
}
|
481
|
+
});
|
482
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
module.exports.ArgumentParser = require('./argument_parser.js');
|
4
|
+
module.exports.Namespace = require('./namespace');
|
5
|
+
module.exports.Action = require('./action');
|
6
|
+
module.exports.HelpFormatter = require('./help/formatter.js');
|
7
|
+
module.exports.Const = require('./const.js');
|
8
|
+
|
9
|
+
module.exports.ArgumentDefaultsHelpFormatter =
|
10
|
+
require('./help/added_formatters.js').ArgumentDefaultsHelpFormatter;
|
11
|
+
module.exports.RawDescriptionHelpFormatter =
|
12
|
+
require('./help/added_formatters.js').RawDescriptionHelpFormatter;
|
13
|
+
module.exports.RawTextHelpFormatter =
|
14
|
+
require('./help/added_formatters.js').RawTextHelpFormatter;
|
@@ -0,0 +1,50 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
|
4
|
+
var format = require('util').format;
|
5
|
+
|
6
|
+
|
7
|
+
var ERR_CODE = 'ARGError';
|
8
|
+
|
9
|
+
/*:nodoc:*
|
10
|
+
* argumentError(argument, message) -> TypeError
|
11
|
+
* - argument (Object): action with broken argument
|
12
|
+
* - message (String): error message
|
13
|
+
*
|
14
|
+
* Error format helper. An error from creating or using an argument
|
15
|
+
* (optional or positional). The string value of this exception
|
16
|
+
* is the message, augmented with information
|
17
|
+
* about the argument that caused it.
|
18
|
+
*
|
19
|
+
* #####Example
|
20
|
+
*
|
21
|
+
* var argumentErrorHelper = require('./argument/error');
|
22
|
+
* if (conflictOptionals.length > 0) {
|
23
|
+
* throw argumentErrorHelper(
|
24
|
+
* action,
|
25
|
+
* format('Conflicting option string(s): %s', conflictOptionals.join(', '))
|
26
|
+
* );
|
27
|
+
* }
|
28
|
+
*
|
29
|
+
**/
|
30
|
+
module.exports = function (argument, message) {
|
31
|
+
var argumentName = null;
|
32
|
+
var errMessage;
|
33
|
+
var err;
|
34
|
+
|
35
|
+
if (argument.getName) {
|
36
|
+
argumentName = argument.getName();
|
37
|
+
} else {
|
38
|
+
argumentName = '' + argument;
|
39
|
+
}
|
40
|
+
|
41
|
+
if (!argumentName) {
|
42
|
+
errMessage = message;
|
43
|
+
} else {
|
44
|
+
errMessage = format('argument "%s": %s', argumentName, message);
|
45
|
+
}
|
46
|
+
|
47
|
+
err = new TypeError(errMessage);
|
48
|
+
err.code = ERR_CODE;
|
49
|
+
return err;
|
50
|
+
};
|
@@ -0,0 +1,54 @@
|
|
1
|
+
/** internal
|
2
|
+
* class MutuallyExclusiveGroup
|
3
|
+
*
|
4
|
+
* Group arguments.
|
5
|
+
* By default, ArgumentParser groups command-line arguments
|
6
|
+
* into “positional arguments” and “optional arguments”
|
7
|
+
* when displaying help messages. When there is a better
|
8
|
+
* conceptual grouping of arguments than this default one,
|
9
|
+
* appropriate groups can be created using the addArgumentGroup() method
|
10
|
+
*
|
11
|
+
* This class inherited from [[ArgumentContainer]]
|
12
|
+
**/
|
13
|
+
'use strict';
|
14
|
+
|
15
|
+
var util = require('util');
|
16
|
+
|
17
|
+
var ArgumentGroup = require('./group');
|
18
|
+
|
19
|
+
/**
|
20
|
+
* new MutuallyExclusiveGroup(container, options)
|
21
|
+
* - container (object): main container
|
22
|
+
* - options (object): options.required -> true/false
|
23
|
+
*
|
24
|
+
* `required` could be an argument itself, but making it a property of
|
25
|
+
* the options argument is more consistent with the JS adaptation of the Python)
|
26
|
+
**/
|
27
|
+
var MutuallyExclusiveGroup = module.exports = function MutuallyExclusiveGroup(container, options) {
|
28
|
+
var required;
|
29
|
+
options = options || {};
|
30
|
+
required = options.required || false;
|
31
|
+
ArgumentGroup.call(this, container);
|
32
|
+
this.required = required;
|
33
|
+
|
34
|
+
};
|
35
|
+
util.inherits(MutuallyExclusiveGroup, ArgumentGroup);
|
36
|
+
|
37
|
+
|
38
|
+
MutuallyExclusiveGroup.prototype._addAction = function (action) {
|
39
|
+
var msg;
|
40
|
+
if (action.required) {
|
41
|
+
msg = 'mutually exclusive arguments must be optional';
|
42
|
+
throw new Error(msg);
|
43
|
+
}
|
44
|
+
action = this._container._addAction(action);
|
45
|
+
this._groupActions.push(action);
|
46
|
+
return action;
|
47
|
+
};
|
48
|
+
|
49
|
+
|
50
|
+
MutuallyExclusiveGroup.prototype._removeAction = function (action) {
|
51
|
+
this._container._removeAction(action);
|
52
|
+
this._groupActions.remove(action);
|
53
|
+
};
|
54
|
+
|
@@ -0,0 +1,75 @@
|
|
1
|
+
/** internal
|
2
|
+
* class ArgumentGroup
|
3
|
+
*
|
4
|
+
* Group arguments.
|
5
|
+
* By default, ArgumentParser groups command-line arguments
|
6
|
+
* into “positional arguments” and “optional arguments”
|
7
|
+
* when displaying help messages. When there is a better
|
8
|
+
* conceptual grouping of arguments than this default one,
|
9
|
+
* appropriate groups can be created using the addArgumentGroup() method
|
10
|
+
*
|
11
|
+
* This class inherited from [[ArgumentContainer]]
|
12
|
+
**/
|
13
|
+
'use strict';
|
14
|
+
|
15
|
+
var util = require('util');
|
16
|
+
|
17
|
+
var ActionContainer = require('../action_container');
|
18
|
+
|
19
|
+
|
20
|
+
/**
|
21
|
+
* new ArgumentGroup(container, options)
|
22
|
+
* - container (object): main container
|
23
|
+
* - options (object): hash of group options
|
24
|
+
*
|
25
|
+
* #### options
|
26
|
+
* - **prefixChars** group name prefix
|
27
|
+
* - **argumentDefault** default argument value
|
28
|
+
* - **title** group title
|
29
|
+
* - **description** group description
|
30
|
+
*
|
31
|
+
**/
|
32
|
+
var ArgumentGroup = module.exports = function ArgumentGroup(container, options) {
|
33
|
+
|
34
|
+
options = options || {};
|
35
|
+
|
36
|
+
// add any missing keyword arguments by checking the container
|
37
|
+
options.conflictHandler = (options.conflictHandler || container.conflictHandler);
|
38
|
+
options.prefixChars = (options.prefixChars || container.prefixChars);
|
39
|
+
options.argumentDefault = (options.argumentDefault || container.argumentDefault);
|
40
|
+
|
41
|
+
ActionContainer.call(this, options);
|
42
|
+
|
43
|
+
// group attributes
|
44
|
+
this.title = options.title;
|
45
|
+
this._groupActions = [];
|
46
|
+
|
47
|
+
// share most attributes with the container
|
48
|
+
this._container = container;
|
49
|
+
this._registries = container._registries;
|
50
|
+
this._actions = container._actions;
|
51
|
+
this._optionStringActions = container._optionStringActions;
|
52
|
+
this._defaults = container._defaults;
|
53
|
+
this._hasNegativeNumberOptionals = container._hasNegativeNumberOptionals;
|
54
|
+
this._mutuallyExclusiveGroups = container._mutuallyExclusiveGroups;
|
55
|
+
};
|
56
|
+
util.inherits(ArgumentGroup, ActionContainer);
|
57
|
+
|
58
|
+
|
59
|
+
ArgumentGroup.prototype._addAction = function (action) {
|
60
|
+
// Parent add action
|
61
|
+
action = ActionContainer.prototype._addAction.call(this, action);
|
62
|
+
this._groupActions.push(action);
|
63
|
+
return action;
|
64
|
+
};
|
65
|
+
|
66
|
+
|
67
|
+
ArgumentGroup.prototype._removeAction = function (action) {
|
68
|
+
// Parent remove action
|
69
|
+
ActionContainer.prototype._removeAction.call(this, action);
|
70
|
+
var actionIndex = this._groupActions.indexOf(action);
|
71
|
+
if (actionIndex >= 0) {
|
72
|
+
this._groupActions.splice(actionIndex, 1);
|
73
|
+
}
|
74
|
+
};
|
75
|
+
|