porffor 0.1.0 → 0.2.0-77e30e8
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/README.md +184 -204
- package/compiler/2c.js +377 -0
- package/compiler/builtins/base64.js +91 -91
- package/compiler/builtins.js +19 -13
- package/compiler/codeGen.js +1313 -418
- package/compiler/decompile.js +35 -9
- package/compiler/embedding.js +9 -5
- package/compiler/encoding.js +8 -2
- package/compiler/index.js +55 -17
- package/compiler/log.js +15 -0
- package/compiler/opt.js +357 -258
- package/compiler/parse.js +24 -1
- package/compiler/prototype.js +263 -56
- package/compiler/sections.js +51 -8
- package/compiler/wasmSpec.js +3 -0
- package/compiler/wrap.js +21 -7
- package/package.json +6 -1
- package/porf.cmd +1 -1
- package/rhemyn/README.md +37 -0
- package/rhemyn/compile.js +214 -0
- package/rhemyn/parse.js +321 -0
- package/rhemyn/test/parse.js +59 -0
- package/runner/index.js +54 -31
- package/runner/info.js +37 -2
- package/runner/profile.js +1 -2
- package/runner/repl.js +13 -11
- package/runner/results.json +1 -0
- package/runner/transform.js +15 -36
- package/runner/version.js +10 -0
- package/CNAME +0 -1
- package/index.html +0 -1264
- package/logo.png +0 -0
- package/sw.js +0 -26
- package/test/array_1.js +0 -8
- package/test/array_push.js +0 -8
- package/test/assignop_1.js +0 -15
- package/test/bitwise_1.js +0 -6
- package/test/bool_1.js +0 -3
- package/test/boolean.js +0 -6
- package/test/break_1.js +0 -6
- package/test/break_2.js +0 -12
- package/test/conditional_1.js +0 -3
- package/test/conditional_2.js +0 -4
- package/test/console_1.js +0 -2
- package/test/continue_1.js +0 -6
- package/test/continue_2.js +0 -10
- package/test/empty.js +0 -1
- package/test/ending_exp_1.js +0 -2
- package/test/ending_exp_2.js +0 -6
- package/test/eq_1.js +0 -4
- package/test/eq_2.js +0 -4
- package/test/eq_3.js +0 -5
- package/test/export_1.js +0 -9
- package/test/factorial.js +0 -3
- package/test/fibonacci.js +0 -16
- package/test/float_div0.js +0 -2
- package/test/float_frac.js +0 -2
- package/test/float_isfinite.js +0 -29
- package/test/float_isinteger.js +0 -13
- package/test/float_isnan.js +0 -20
- package/test/float_issafeinteger.js +0 -11
- package/test/float_large.js +0 -2
- package/test/float_math_funcs.js +0 -24
- package/test/float_math_random.js +0 -6
- package/test/float_nan.js +0 -3
- package/test/float_number_values.js +0 -12
- package/test/for_1.js +0 -4
- package/test/for_2.js +0 -4
- package/test/func_1.js +0 -16
- package/test/func_2.js +0 -6
- package/test/func_3.js +0 -10
- package/test/global_1.js +0 -8
- package/test/global_2.js +0 -10
- package/test/if_1.js +0 -6
- package/test/if_2.js +0 -9
- package/test/if_3.js +0 -7
- package/test/iife_1.js +0 -8
- package/test/iife_2.js +0 -8
- package/test/index.js +0 -93
- package/test/int_number_values.js +0 -6
- package/test/logic_1.js +0 -7
- package/test/logic_2.js +0 -7
- package/test/math_1.js +0 -6
- package/test/math_2.js +0 -12
- package/test/math_3.js +0 -6
- package/test/number_func.js +0 -4
- package/test/return_1.js +0 -8
- package/test/return_2.js +0 -11
- package/test/tailcall_1.js +0 -10
- package/test/throw_1.js +0 -2
- package/test/throw_2.js +0 -4
- package/test/throw_3.js +0 -2
- package/test/throw_4.js +0 -3
- package/test/try_1.js +0 -7
- package/test/unary_1.js +0 -4
- package/test/unary_2.js +0 -5
- package/test/unary_3.js +0 -6
- package/test/unary_4.js +0 -12
- package/test/unary_5.js +0 -8
- package/test/undefined_1.js +0 -8
- package/test/undefined_2.js +0 -10
- package/test/updateexp_1.js +0 -9
- package/test/vars_1.js +0 -5
- package/test/vars_2.js +0 -9
- package/test/while_1.js +0 -6
- package/test262/compare.js +0 -30
- package/test262/index.js +0 -314
- package/test262/node_modules/.bin/esparse +0 -12
- package/test262/node_modules/.bin/esparse.cmd +0 -17
- package/test262/node_modules/.bin/esparse.ps1 +0 -28
- package/test262/node_modules/.bin/esvalidate +0 -12
- package/test262/node_modules/.bin/esvalidate.cmd +0 -17
- package/test262/node_modules/.bin/esvalidate.ps1 +0 -28
- package/test262/node_modules/.bin/js-yaml +0 -12
- package/test262/node_modules/.bin/js-yaml.cmd +0 -17
- package/test262/node_modules/.bin/js-yaml.ps1 +0 -28
- package/test262/node_modules/.package-lock.json +0 -0
- package/test262/node_modules/@nodelib/fs.scandir/LICENSE +0 -21
- package/test262/node_modules/@nodelib/fs.scandir/README.md +0 -171
- package/test262/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +0 -20
- package/test262/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +0 -19
- package/test262/node_modules/@nodelib/fs.scandir/out/constants.d.ts +0 -4
- package/test262/node_modules/@nodelib/fs.scandir/out/constants.js +0 -17
- package/test262/node_modules/@nodelib/fs.scandir/out/index.d.ts +0 -12
- package/test262/node_modules/@nodelib/fs.scandir/out/index.js +0 -26
- package/test262/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +0 -7
- package/test262/node_modules/@nodelib/fs.scandir/out/providers/async.js +0 -104
- package/test262/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +0 -1
- package/test262/node_modules/@nodelib/fs.scandir/out/providers/common.js +0 -13
- package/test262/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +0 -5
- package/test262/node_modules/@nodelib/fs.scandir/out/providers/sync.js +0 -54
- package/test262/node_modules/@nodelib/fs.scandir/out/settings.d.ts +0 -20
- package/test262/node_modules/@nodelib/fs.scandir/out/settings.js +0 -24
- package/test262/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +0 -20
- package/test262/node_modules/@nodelib/fs.scandir/out/types/index.js +0 -2
- package/test262/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +0 -2
- package/test262/node_modules/@nodelib/fs.scandir/out/utils/fs.js +0 -19
- package/test262/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +0 -2
- package/test262/node_modules/@nodelib/fs.scandir/out/utils/index.js +0 -5
- package/test262/node_modules/@nodelib/fs.scandir/package.json +0 -44
- package/test262/node_modules/@nodelib/fs.stat/LICENSE +0 -21
- package/test262/node_modules/@nodelib/fs.stat/README.md +0 -126
- package/test262/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +0 -13
- package/test262/node_modules/@nodelib/fs.stat/out/adapters/fs.js +0 -17
- package/test262/node_modules/@nodelib/fs.stat/out/index.d.ts +0 -12
- package/test262/node_modules/@nodelib/fs.stat/out/index.js +0 -26
- package/test262/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +0 -4
- package/test262/node_modules/@nodelib/fs.stat/out/providers/async.js +0 -36
- package/test262/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +0 -3
- package/test262/node_modules/@nodelib/fs.stat/out/providers/sync.js +0 -23
- package/test262/node_modules/@nodelib/fs.stat/out/settings.d.ts +0 -16
- package/test262/node_modules/@nodelib/fs.stat/out/settings.js +0 -16
- package/test262/node_modules/@nodelib/fs.stat/out/types/index.d.ts +0 -4
- package/test262/node_modules/@nodelib/fs.stat/out/types/index.js +0 -2
- package/test262/node_modules/@nodelib/fs.stat/package.json +0 -37
- package/test262/node_modules/@nodelib/fs.walk/LICENSE +0 -21
- package/test262/node_modules/@nodelib/fs.walk/README.md +0 -215
- package/test262/node_modules/@nodelib/fs.walk/out/index.d.ts +0 -14
- package/test262/node_modules/@nodelib/fs.walk/out/index.js +0 -34
- package/test262/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +0 -12
- package/test262/node_modules/@nodelib/fs.walk/out/providers/async.js +0 -30
- package/test262/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +0 -4
- package/test262/node_modules/@nodelib/fs.walk/out/providers/index.js +0 -9
- package/test262/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +0 -12
- package/test262/node_modules/@nodelib/fs.walk/out/providers/stream.js +0 -34
- package/test262/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +0 -10
- package/test262/node_modules/@nodelib/fs.walk/out/providers/sync.js +0 -14
- package/test262/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +0 -30
- package/test262/node_modules/@nodelib/fs.walk/out/readers/async.js +0 -97
- package/test262/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +0 -7
- package/test262/node_modules/@nodelib/fs.walk/out/readers/common.js +0 -31
- package/test262/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +0 -6
- package/test262/node_modules/@nodelib/fs.walk/out/readers/reader.js +0 -11
- package/test262/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +0 -15
- package/test262/node_modules/@nodelib/fs.walk/out/readers/sync.js +0 -59
- package/test262/node_modules/@nodelib/fs.walk/out/settings.d.ts +0 -30
- package/test262/node_modules/@nodelib/fs.walk/out/settings.js +0 -26
- package/test262/node_modules/@nodelib/fs.walk/out/types/index.d.ts +0 -8
- package/test262/node_modules/@nodelib/fs.walk/out/types/index.js +0 -2
- package/test262/node_modules/@nodelib/fs.walk/package.json +0 -44
- package/test262/node_modules/argparse/CHANGELOG.md +0 -185
- package/test262/node_modules/argparse/LICENSE +0 -21
- package/test262/node_modules/argparse/README.md +0 -257
- package/test262/node_modules/argparse/index.js +0 -3
- package/test262/node_modules/argparse/lib/action/append/constant.js +0 -47
- package/test262/node_modules/argparse/lib/action/append.js +0 -53
- package/test262/node_modules/argparse/lib/action/count.js +0 -40
- package/test262/node_modules/argparse/lib/action/help.js +0 -47
- package/test262/node_modules/argparse/lib/action/store/constant.js +0 -43
- package/test262/node_modules/argparse/lib/action/store/false.js +0 -27
- package/test262/node_modules/argparse/lib/action/store/true.js +0 -26
- package/test262/node_modules/argparse/lib/action/store.js +0 -50
- package/test262/node_modules/argparse/lib/action/subparsers.js +0 -149
- package/test262/node_modules/argparse/lib/action/version.js +0 -47
- package/test262/node_modules/argparse/lib/action.js +0 -146
- package/test262/node_modules/argparse/lib/action_container.js +0 -482
- package/test262/node_modules/argparse/lib/argparse.js +0 -14
- package/test262/node_modules/argparse/lib/argument/error.js +0 -50
- package/test262/node_modules/argparse/lib/argument/exclusive.js +0 -54
- package/test262/node_modules/argparse/lib/argument/group.js +0 -75
- package/test262/node_modules/argparse/lib/argument_parser.js +0 -1161
- package/test262/node_modules/argparse/lib/const.js +0 -21
- package/test262/node_modules/argparse/lib/help/added_formatters.js +0 -87
- package/test262/node_modules/argparse/lib/help/formatter.js +0 -795
- package/test262/node_modules/argparse/lib/namespace.js +0 -76
- package/test262/node_modules/argparse/lib/utils.js +0 -57
- package/test262/node_modules/argparse/package.json +0 -34
- package/test262/node_modules/braces/CHANGELOG.md +0 -184
- package/test262/node_modules/braces/LICENSE +0 -21
- package/test262/node_modules/braces/README.md +0 -593
- package/test262/node_modules/braces/index.js +0 -170
- package/test262/node_modules/braces/lib/compile.js +0 -57
- package/test262/node_modules/braces/lib/constants.js +0 -57
- package/test262/node_modules/braces/lib/expand.js +0 -113
- package/test262/node_modules/braces/lib/parse.js +0 -333
- package/test262/node_modules/braces/lib/stringify.js +0 -32
- package/test262/node_modules/braces/lib/utils.js +0 -112
- package/test262/node_modules/braces/package.json +0 -77
- package/test262/node_modules/esprima/ChangeLog +0 -235
- package/test262/node_modules/esprima/LICENSE.BSD +0 -21
- package/test262/node_modules/esprima/README.md +0 -46
- package/test262/node_modules/esprima/bin/esparse.js +0 -139
- package/test262/node_modules/esprima/bin/esvalidate.js +0 -236
- package/test262/node_modules/esprima/dist/esprima.js +0 -6709
- package/test262/node_modules/esprima/package.json +0 -112
- package/test262/node_modules/fast-glob/LICENSE +0 -21
- package/test262/node_modules/fast-glob/README.md +0 -859
- package/test262/node_modules/fast-glob/out/index.d.ts +0 -40
- package/test262/node_modules/fast-glob/out/index.js +0 -102
- package/test262/node_modules/fast-glob/out/managers/tasks.d.ts +0 -22
- package/test262/node_modules/fast-glob/out/managers/tasks.js +0 -110
- package/test262/node_modules/fast-glob/out/providers/async.d.ts +0 -9
- package/test262/node_modules/fast-glob/out/providers/async.js +0 -23
- package/test262/node_modules/fast-glob/out/providers/filters/deep.d.ts +0 -16
- package/test262/node_modules/fast-glob/out/providers/filters/deep.js +0 -62
- package/test262/node_modules/fast-glob/out/providers/filters/entry.d.ts +0 -16
- package/test262/node_modules/fast-glob/out/providers/filters/entry.js +0 -63
- package/test262/node_modules/fast-glob/out/providers/filters/error.d.ts +0 -8
- package/test262/node_modules/fast-glob/out/providers/filters/error.js +0 -15
- package/test262/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +0 -33
- package/test262/node_modules/fast-glob/out/providers/matchers/matcher.js +0 -45
- package/test262/node_modules/fast-glob/out/providers/matchers/partial.d.ts +0 -4
- package/test262/node_modules/fast-glob/out/providers/matchers/partial.js +0 -38
- package/test262/node_modules/fast-glob/out/providers/provider.d.ts +0 -19
- package/test262/node_modules/fast-glob/out/providers/provider.js +0 -48
- package/test262/node_modules/fast-glob/out/providers/stream.d.ts +0 -11
- package/test262/node_modules/fast-glob/out/providers/stream.js +0 -31
- package/test262/node_modules/fast-glob/out/providers/sync.d.ts +0 -9
- package/test262/node_modules/fast-glob/out/providers/sync.js +0 -23
- package/test262/node_modules/fast-glob/out/providers/transformers/entry.d.ts +0 -8
- package/test262/node_modules/fast-glob/out/providers/transformers/entry.js +0 -26
- package/test262/node_modules/fast-glob/out/readers/async.d.ts +0 -10
- package/test262/node_modules/fast-glob/out/readers/async.js +0 -35
- package/test262/node_modules/fast-glob/out/readers/reader.d.ts +0 -15
- package/test262/node_modules/fast-glob/out/readers/reader.js +0 -33
- package/test262/node_modules/fast-glob/out/readers/stream.d.ts +0 -14
- package/test262/node_modules/fast-glob/out/readers/stream.js +0 -55
- package/test262/node_modules/fast-glob/out/readers/sync.d.ts +0 -12
- package/test262/node_modules/fast-glob/out/readers/sync.js +0 -43
- package/test262/node_modules/fast-glob/out/settings.d.ts +0 -164
- package/test262/node_modules/fast-glob/out/settings.js +0 -57
- package/test262/node_modules/fast-glob/out/types/index.d.ts +0 -31
- package/test262/node_modules/fast-glob/out/types/index.js +0 -2
- package/test262/node_modules/fast-glob/out/utils/array.d.ts +0 -2
- package/test262/node_modules/fast-glob/out/utils/array.js +0 -22
- package/test262/node_modules/fast-glob/out/utils/errno.d.ts +0 -2
- package/test262/node_modules/fast-glob/out/utils/errno.js +0 -7
- package/test262/node_modules/fast-glob/out/utils/fs.d.ts +0 -4
- package/test262/node_modules/fast-glob/out/utils/fs.js +0 -19
- package/test262/node_modules/fast-glob/out/utils/index.d.ts +0 -8
- package/test262/node_modules/fast-glob/out/utils/index.js +0 -17
- package/test262/node_modules/fast-glob/out/utils/path.d.ts +0 -13
- package/test262/node_modules/fast-glob/out/utils/path.js +0 -68
- package/test262/node_modules/fast-glob/out/utils/pattern.d.ts +0 -47
- package/test262/node_modules/fast-glob/out/utils/pattern.js +0 -188
- package/test262/node_modules/fast-glob/out/utils/stream.d.ts +0 -4
- package/test262/node_modules/fast-glob/out/utils/stream.js +0 -17
- package/test262/node_modules/fast-glob/out/utils/string.d.ts +0 -2
- package/test262/node_modules/fast-glob/out/utils/string.js +0 -11
- package/test262/node_modules/fast-glob/package.json +0 -81
- package/test262/node_modules/fastq/.github/dependabot.yml +0 -11
- package/test262/node_modules/fastq/.github/workflows/ci.yml +0 -50
- package/test262/node_modules/fastq/LICENSE +0 -13
- package/test262/node_modules/fastq/README.md +0 -309
- package/test262/node_modules/fastq/bench.js +0 -66
- package/test262/node_modules/fastq/example.js +0 -14
- package/test262/node_modules/fastq/example.mjs +0 -11
- package/test262/node_modules/fastq/index.d.ts +0 -37
- package/test262/node_modules/fastq/package.json +0 -52
- package/test262/node_modules/fastq/queue.js +0 -289
- package/test262/node_modules/fastq/test/example.ts +0 -81
- package/test262/node_modules/fastq/test/promise.js +0 -248
- package/test262/node_modules/fastq/test/test.js +0 -566
- package/test262/node_modules/fastq/test/tsconfig.json +0 -11
- package/test262/node_modules/fill-range/LICENSE +0 -21
- package/test262/node_modules/fill-range/README.md +0 -237
- package/test262/node_modules/fill-range/index.js +0 -249
- package/test262/node_modules/fill-range/package.json +0 -69
- package/test262/node_modules/glob-parent/CHANGELOG.md +0 -110
- package/test262/node_modules/glob-parent/LICENSE +0 -15
- package/test262/node_modules/glob-parent/README.md +0 -137
- package/test262/node_modules/glob-parent/index.js +0 -42
- package/test262/node_modules/glob-parent/package.json +0 -48
- package/test262/node_modules/graceful-fs/LICENSE +0 -15
- package/test262/node_modules/graceful-fs/README.md +0 -143
- package/test262/node_modules/graceful-fs/clone.js +0 -23
- package/test262/node_modules/graceful-fs/graceful-fs.js +0 -448
- package/test262/node_modules/graceful-fs/legacy-streams.js +0 -118
- package/test262/node_modules/graceful-fs/package.json +0 -53
- package/test262/node_modules/graceful-fs/polyfills.js +0 -355
- package/test262/node_modules/is-extglob/LICENSE +0 -21
- package/test262/node_modules/is-extglob/README.md +0 -107
- package/test262/node_modules/is-extglob/index.js +0 -20
- package/test262/node_modules/is-extglob/package.json +0 -69
- package/test262/node_modules/is-glob/LICENSE +0 -21
- package/test262/node_modules/is-glob/README.md +0 -206
- package/test262/node_modules/is-glob/index.js +0 -150
- package/test262/node_modules/is-glob/package.json +0 -81
- package/test262/node_modules/is-number/LICENSE +0 -21
- package/test262/node_modules/is-number/README.md +0 -187
- package/test262/node_modules/is-number/index.js +0 -18
- package/test262/node_modules/is-number/package.json +0 -82
- package/test262/node_modules/js-yaml/CHANGELOG.md +0 -557
- package/test262/node_modules/js-yaml/LICENSE +0 -21
- package/test262/node_modules/js-yaml/README.md +0 -299
- package/test262/node_modules/js-yaml/bin/js-yaml.js +0 -132
- package/test262/node_modules/js-yaml/dist/js-yaml.js +0 -3989
- package/test262/node_modules/js-yaml/dist/js-yaml.min.js +0 -1
- package/test262/node_modules/js-yaml/index.js +0 -7
- package/test262/node_modules/js-yaml/lib/js-yaml/common.js +0 -59
- package/test262/node_modules/js-yaml/lib/js-yaml/dumper.js +0 -850
- package/test262/node_modules/js-yaml/lib/js-yaml/exception.js +0 -43
- package/test262/node_modules/js-yaml/lib/js-yaml/loader.js +0 -1644
- package/test262/node_modules/js-yaml/lib/js-yaml/mark.js +0 -76
- package/test262/node_modules/js-yaml/lib/js-yaml/schema/core.js +0 -18
- package/test262/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +0 -25
- package/test262/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +0 -28
- package/test262/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +0 -17
- package/test262/node_modules/js-yaml/lib/js-yaml/schema/json.js +0 -25
- package/test262/node_modules/js-yaml/lib/js-yaml/schema.js +0 -108
- package/test262/node_modules/js-yaml/lib/js-yaml/type/binary.js +0 -138
- package/test262/node_modules/js-yaml/lib/js-yaml/type/bool.js +0 -35
- package/test262/node_modules/js-yaml/lib/js-yaml/type/float.js +0 -116
- package/test262/node_modules/js-yaml/lib/js-yaml/type/int.js +0 -173
- package/test262/node_modules/js-yaml/lib/js-yaml/type/js/function.js +0 -93
- package/test262/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +0 -60
- package/test262/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +0 -28
- package/test262/node_modules/js-yaml/lib/js-yaml/type/map.js +0 -8
- package/test262/node_modules/js-yaml/lib/js-yaml/type/merge.js +0 -12
- package/test262/node_modules/js-yaml/lib/js-yaml/type/null.js +0 -34
- package/test262/node_modules/js-yaml/lib/js-yaml/type/omap.js +0 -44
- package/test262/node_modules/js-yaml/lib/js-yaml/type/pairs.js +0 -53
- package/test262/node_modules/js-yaml/lib/js-yaml/type/seq.js +0 -8
- package/test262/node_modules/js-yaml/lib/js-yaml/type/set.js +0 -29
- package/test262/node_modules/js-yaml/lib/js-yaml/type/str.js +0 -8
- package/test262/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +0 -88
- package/test262/node_modules/js-yaml/lib/js-yaml/type.js +0 -61
- package/test262/node_modules/js-yaml/lib/js-yaml.js +0 -39
- package/test262/node_modules/js-yaml/package.json +0 -49
- package/test262/node_modules/klaw/CHANGELOG.md +0 -62
- package/test262/node_modules/klaw/LICENSE +0 -15
- package/test262/node_modules/klaw/README.md +0 -252
- package/test262/node_modules/klaw/package.json +0 -40
- package/test262/node_modules/klaw/src/index.js +0 -56
- package/test262/node_modules/merge2/LICENSE +0 -21
- package/test262/node_modules/merge2/README.md +0 -144
- package/test262/node_modules/merge2/index.js +0 -144
- package/test262/node_modules/merge2/package.json +0 -43
- package/test262/node_modules/micromatch/LICENSE +0 -21
- package/test262/node_modules/micromatch/README.md +0 -1011
- package/test262/node_modules/micromatch/index.js +0 -467
- package/test262/node_modules/micromatch/package.json +0 -119
- package/test262/node_modules/picomatch/CHANGELOG.md +0 -136
- package/test262/node_modules/picomatch/LICENSE +0 -21
- package/test262/node_modules/picomatch/README.md +0 -708
- package/test262/node_modules/picomatch/index.js +0 -3
- package/test262/node_modules/picomatch/lib/constants.js +0 -179
- package/test262/node_modules/picomatch/lib/parse.js +0 -1091
- package/test262/node_modules/picomatch/lib/picomatch.js +0 -342
- package/test262/node_modules/picomatch/lib/scan.js +0 -391
- package/test262/node_modules/picomatch/lib/utils.js +0 -64
- package/test262/node_modules/picomatch/package.json +0 -81
- package/test262/node_modules/queue-microtask/LICENSE +0 -20
- package/test262/node_modules/queue-microtask/README.md +0 -90
- package/test262/node_modules/queue-microtask/index.d.ts +0 -2
- package/test262/node_modules/queue-microtask/index.js +0 -9
- package/test262/node_modules/queue-microtask/package.json +0 -55
- package/test262/node_modules/reusify/.coveralls.yml +0 -1
- package/test262/node_modules/reusify/.travis.yml +0 -28
- package/test262/node_modules/reusify/LICENSE +0 -22
- package/test262/node_modules/reusify/README.md +0 -145
- package/test262/node_modules/reusify/benchmarks/createNoCodeFunction.js +0 -30
- package/test262/node_modules/reusify/benchmarks/fib.js +0 -13
- package/test262/node_modules/reusify/benchmarks/reuseNoCodeFunction.js +0 -38
- package/test262/node_modules/reusify/package.json +0 -45
- package/test262/node_modules/reusify/reusify.js +0 -33
- package/test262/node_modules/reusify/test.js +0 -66
- package/test262/node_modules/run-parallel/LICENSE +0 -20
- package/test262/node_modules/run-parallel/README.md +0 -85
- package/test262/node_modules/run-parallel/index.js +0 -51
- package/test262/node_modules/run-parallel/package.json +0 -58
- package/test262/node_modules/sprintf-js/LICENSE +0 -24
- package/test262/node_modules/sprintf-js/README.md +0 -88
- package/test262/node_modules/sprintf-js/bower.json +0 -14
- package/test262/node_modules/sprintf-js/demo/angular.html +0 -20
- package/test262/node_modules/sprintf-js/dist/angular-sprintf.min.js +0 -4
- package/test262/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +0 -1
- package/test262/node_modules/sprintf-js/dist/angular-sprintf.min.map +0 -1
- package/test262/node_modules/sprintf-js/dist/sprintf.min.js +0 -4
- package/test262/node_modules/sprintf-js/dist/sprintf.min.js.map +0 -1
- package/test262/node_modules/sprintf-js/dist/sprintf.min.map +0 -1
- package/test262/node_modules/sprintf-js/gruntfile.js +0 -36
- package/test262/node_modules/sprintf-js/package.json +0 -22
- package/test262/node_modules/sprintf-js/src/angular-sprintf.js +0 -18
- package/test262/node_modules/sprintf-js/src/sprintf.js +0 -208
- package/test262/node_modules/sprintf-js/test/test.js +0 -82
- package/test262/node_modules/test262-stream/.jshintignore +0 -2
- package/test262/node_modules/test262-stream/.jshintrc +0 -6
- package/test262/node_modules/test262-stream/.travis.yml +0 -5
- package/test262/node_modules/test262-stream/CONTRIBUTING.md +0 -37
- package/test262/node_modules/test262-stream/LICENSE-MICROSOFT.txt +0 -27
- package/test262/node_modules/test262-stream/LICENSE.txt +0 -27
- package/test262/node_modules/test262-stream/README.md +0 -71
- package/test262/node_modules/test262-stream/lib/builder.js +0 -46
- package/test262/node_modules/test262-stream/lib/compile.js +0 -24
- package/test262/node_modules/test262-stream/lib/create-scenarios.js +0 -29
- package/test262/node_modules/test262-stream/lib/index.js +0 -187
- package/test262/node_modules/test262-stream/lib/test-file.js +0 -150
- package/test262/node_modules/test262-stream/package.json +0 -26
- package/test262/node_modules/test262-stream/test/collateral/invalid-missing-harness/fake-test262/test/a-test-file.js +0 -16
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-other-accepted/fake-test262/harness/assert.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-other-accepted/fake-test262/harness/doneprintHandle.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-other-accepted/fake-test262/harness/sta.js +0 -12
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-other-accepted/fake-test262/package.json +0 -3
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-other-accepted/fake-test262/test/strict.js +0 -9
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-unsupported/fake-test262/harness/assert.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-unsupported/fake-test262/harness/doneprintHandle.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-unsupported/fake-test262/harness/sta.js +0 -12
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-unsupported/fake-test262/package.json +0 -3
- package/test262/node_modules/test262-stream/test/collateral/invalid-version-unsupported/fake-test262/test/strict.js +0 -9
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/asyncNegative_default.js +0 -49
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/asyncNegative_strict_mode.js +0 -50
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/async_default.js +0 -48
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/async_strict_mode.js +0 -49
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/bothStrict_default.js +0 -46
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/bothStrict_strict_mode.js +0 -47
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/error_default.js +0 -39
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/error_strict_mode.js +0 -40
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/module_default.js +0 -37
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/module_strict_mode.js +0 -38
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/negative-empty_default.js +0 -37
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/negative-empty_strict_mode.js +0 -38
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/noStrict_default.js +0 -36
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/rawNoStrict_default.js +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/rawStrict_default.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-content/test/strict_strict_mode.js +0 -41
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/asyncNegative_default.json +0 -22
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/asyncNegative_strict_mode.json +0 -22
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/async_default.json +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/async_strict_mode.json +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/bothStrict_default.json +0 -24
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/bothStrict_strict_mode.json +0 -24
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/error_default.json +0 -19
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/error_strict_mode.json +0 -19
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/module_default.json +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/module_strict_mode.json +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/negative-empty_default.json +0 -19
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/negative-empty_strict_mode.json +0 -19
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/noStrict_default.json +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/rawNoStrict_default.json +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/rawStrict_default.json +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-default/expected-metadata/test/strict_strict_mode.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/harness/assert.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/harness/doneprintHandle.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/harness/sta.js +0 -12
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/async.js +0 -10
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/asyncNegative.js +0 -11
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/bothStrict.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/error.js +0 -8
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/module.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/module_FIXTURE.js +0 -2
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/negative-empty.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/noStrict.js +0 -5
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/rawNoStrict.js +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/rawStrict.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-default/fake-test262/test/strict.js +0 -9
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/expected-content/test/bothStrict_default.js +0 -46
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/expected-content/test/bothStrict_strict_mode.js +0 -47
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/expected-metadata/test/bothStrict_default.json +0 -24
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/expected-metadata/test/bothStrict_strict_mode.json +0 -24
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/harness/assert.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/harness/doneprintHandle.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/harness/sta.js +0 -12
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/bothStrict.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-0_FIXTURE.js +0 -2
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-1_FIXTURE.js +0 -2
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-2_FIXTURE.js +0 -2
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-3_FIXTURE.js +0 -2
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-4_FIXTURE.js +0 -2
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-5_FIXTURE.js +0 -2
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-6_FIXTURE.js +0 -2
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-7_FIXTURE.js +0 -2
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-8_FIXTURE.js +0 -2
- package/test262/node_modules/test262-stream/test/collateral/valid-extra-files/fake-test262/test/zzz-9_FIXTURE.txt +0 -2
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/expected-content/test/raw_default.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/expected-content/test/runtime_default.js +0 -38
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/expected-content/test/runtime_strict_mode.js +0 -39
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/expected-metadata/test/raw_default.json +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/expected-metadata/test/runtime_default.json +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/expected-metadata/test/runtime_strict_mode.json +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/fake-test262/harness/assert.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/fake-test262/harness/sta.js +0 -12
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/fake-test262/test/raw.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-insertionindex-with-copyright/fake-test262/test/runtime.js +0 -7
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/asyncNegative_default.js +0 -11
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/asyncNegative_strict_mode.js +0 -12
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/async_default.js +0 -10
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/async_strict_mode.js +0 -11
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/bothStrict_default.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/bothStrict_strict_mode.js +0 -16
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/error_default.js +0 -8
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/error_strict_mode.js +0 -9
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/module_default.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/module_strict_mode.js +0 -7
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/negative-empty_default.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/negative-empty_strict_mode.js +0 -7
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/noStrict_default.js +0 -5
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/rawNoStrict_default.js +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/rawStrict_default.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-content/test/strict_strict_mode.js +0 -10
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/asyncNegative_default.json +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/asyncNegative_strict_mode.json +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/async_default.json +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/async_strict_mode.json +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/bothStrict_default.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/bothStrict_strict_mode.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/error_default.json +0 -16
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/error_strict_mode.json +0 -16
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/module_default.json +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/module_strict_mode.json +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/negative-empty_default.json +0 -16
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/negative-empty_strict_mode.json +0 -16
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/noStrict_default.json +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/rawNoStrict_default.json +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/rawStrict_default.json +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/expected-metadata/test/strict_strict_mode.json +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/harness/assert.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/harness/doneprintHandle.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/harness/sta.js +0 -12
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/async.js +0 -10
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/asyncNegative.js +0 -11
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/bothStrict.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/error.js +0 -8
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/module.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/module_FIXTURE.js +0 -2
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/negative-empty.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/noStrict.js +0 -5
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/rawNoStrict.js +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/rawStrict.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-omit-runtime/fake-test262/test/strict.js +0 -9
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/expected-content/test/strict_strict_mode.js +0 -41
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/expected-metadata/test/strict_strict_mode.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/fake-test262/harness/assert.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/fake-test262/harness/doneprintHandle.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/fake-test262/harness/sta.js +0 -12
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/fake-test262/package.json +0 -3
- package/test262/node_modules/test262-stream/test/collateral/valid-version-ignored/fake-test262/test/strict.js +0 -9
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/expected-content/test/strict_strict_mode.js +0 -41
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/expected-metadata/test/strict_strict_mode.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/fake-test262/harness/assert.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/fake-test262/harness/doneprintHandle.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/fake-test262/harness/sta.js +0 -12
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/fake-test262/package.json +0 -3
- package/test262/node_modules/test262-stream/test/collateral/valid-version-supported/fake-test262/test/strict.js +0 -9
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/missing-raw-flag_default.js +0 -44
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/missing-raw-flag_strict_mode.js +0 -45
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw-with-ls-and-license-on-same-line_default.js +0 -20
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw-with-ls-multiline-block_default.js +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw-with-ls_default.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw-with-ps-and-license-on-same-line_default.js +0 -20
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw-with-ps-multiline-block_default.js +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw-with-ps_default.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/rawWithLicense_default.js +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-content/test/raw_default.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/missing-raw-flag_default.json +0 -22
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/missing-raw-flag_strict_mode.json +0 -22
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw-with-ls-and-license-on-same-line_default.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw-with-ls-multiline-block_default.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw-with-ls_default.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw-with-ps-and-license-on-same-line_default.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw-with-ps-multiline-block_default.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw-with-ps_default.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/rawWithLicense_default.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/expected-metadata/test/raw_default.json +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/harness/assert.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/harness/doneprintHandle.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/harness/sta.js +0 -12
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/missing-raw-flag.js +0 -13
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw-with-ls-and-license-on-same-line.js +0 -20
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw-with-ls-multiline-block.js +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw-with-ls.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw-with-ps-and-license-on-same-line.js +0 -20
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw-with-ps-multiline-block.js +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw-with-ps.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/raw.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-with-hashbang/fake-test262/test/rawWithLicense.js +0 -21
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/custom-includes/assert.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/custom-includes/doneprintHandle.js +0 -9
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/custom-includes/sta.js +0 -13
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-content/test/async_default.js +0 -52
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-content/test/async_strict_mode.js +0 -53
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-content/test/bothStrict_default.js +0 -47
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-content/test/bothStrict_strict_mode.js +0 -48
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-metadata/test/async_default.json +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-metadata/test/async_strict_mode.json +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-metadata/test/bothStrict_default.json +0 -24
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/expected-metadata/test/bothStrict_strict_mode.json +0 -24
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/fake-test262/harness/assert.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/fake-test262/harness/doneprintHandle.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/fake-test262/test/async.js +0 -10
- package/test262/node_modules/test262-stream/test/collateral/valid-with-includes/fake-test262/test/bothStrict.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/async/asyncNegative_default.js +0 -49
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/async/asyncNegative_strict_mode.js +0 -50
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/async/async_default.js +0 -48
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/async/async_strict_mode.js +0 -49
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/bothStrict_default.js +0 -46
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/bothStrict_strict_mode.js +0 -47
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/strict/no/noStrict_default.js +0 -36
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-content/test/strict/no/rawNoStrict_default.js +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/async/asyncNegative_default.json +0 -22
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/async/asyncNegative_strict_mode.json +0 -22
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/async/async_default.json +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/async/async_strict_mode.json +0 -18
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/bothStrict_default.json +0 -24
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/bothStrict_strict_mode.json +0 -24
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/strict/no/noStrict_default.json +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/expected-metadata/test/strict/no/rawNoStrict_default.json +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/harness/assert.js +0 -17
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/harness/doneprintHandle.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/harness/sta.js +0 -12
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/async/async.js +0 -10
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/async/asyncNegative.js +0 -11
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/bothStrict.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/error.js +0 -8
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/negative-empty.js +0 -6
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/strict/no/noStrict.js +0 -5
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/strict/no/rawNoStrict.js +0 -14
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/strict/rawStrict.js +0 -15
- package/test262/node_modules/test262-stream/test/collateral/valid-with-paths/fake-test262/test/strict/strict.js +0 -9
- package/test262/node_modules/test262-stream/test/test.js +0 -319
- package/test262/node_modules/to-regex-range/LICENSE +0 -21
- package/test262/node_modules/to-regex-range/README.md +0 -305
- package/test262/node_modules/to-regex-range/index.js +0 -288
- package/test262/node_modules/to-regex-range/package.json +0 -88
- package/test262/package-lock.json +0 -279
- package/test262/package.json +0 -6
- package/test262/prelude.js +0 -75
- package/test262/results.json +0 -1
@@ -1,482 +0,0 @@
|
|
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
|
-
};
|
@@ -1,14 +0,0 @@
|
|
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;
|
@@ -1,50 +0,0 @@
|
|
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
|
-
};
|
@@ -1,54 +0,0 @@
|
|
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
|
-
|
@@ -1,75 +0,0 @@
|
|
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
|
-
|