opal 0.11.4 → 1.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +42 -10
- data/.rubocop.yml +398 -0
- data/.rubocop_todo.yml +44 -0
- data/.travis.yml +28 -34
- data/CHANGELOG.md +363 -142
- data/CONTRIBUTING.md +3 -5
- data/Gemfile +17 -12
- data/Guardfile +0 -1
- data/HACKING.md +1 -35
- data/LICENSE +2 -2
- data/README.md +42 -13
- data/Rakefile +1 -4
- data/UNRELEASED.md +133 -0
- data/benchmark-ips/README.md +6 -0
- data/benchmark-ips/bm_block_vs_yield.rb +21 -0
- data/benchmark-ips/bm_js_symbols_vs_strings.rb +28 -0
- data/benchmark-ips/bm_while_true_vs_loop.rb +19 -0
- data/bin/console +14 -0
- data/bin/opal +0 -1
- data/bin/opal-benchmark-ips +8 -0
- data/bin/opal-mspec +9 -1
- data/bin/opal-repl +2 -1
- data/bin/rake +7 -0
- data/bin/setup +8 -0
- data/docs/compiled_ruby.md +89 -8
- data/docs/compiler.md +3 -20
- data/docs/jquery.md +44 -11
- data/docs/promises.md +1 -1
- data/docs/rails.md +16 -12
- data/docs/sinatra.md +15 -8
- data/docs/using_sprockets.md +16 -11
- data/examples/rack/config.ru +1 -0
- data/examples/sinatra/Gemfile +1 -0
- data/examples/sinatra/config.ru +2 -11
- data/exe/opal-repl +3 -11
- data/lib/opal.rb +1 -0
- data/lib/opal/ast/builder.rb +4 -1
- data/lib/opal/ast/node.rb +1 -0
- data/lib/opal/builder.rb +84 -63
- data/lib/opal/builder_processors.rb +41 -56
- data/lib/opal/cli.rb +33 -49
- data/lib/opal/cli_options.rb +27 -17
- data/lib/opal/cli_runners.rb +73 -16
- data/lib/opal/cli_runners/applescript.rb +4 -4
- data/lib/opal/cli_runners/chrome.rb +29 -17
- data/lib/opal/cli_runners/nashorn.rb +5 -4
- data/lib/opal/cli_runners/nodejs.rb +8 -6
- data/lib/opal/cli_runners/server.rb +12 -11
- data/lib/opal/compiler.rb +85 -103
- data/lib/opal/config.rb +3 -3
- data/lib/opal/deprecations.rb +2 -1
- data/lib/opal/eof_content.rb +2 -2
- data/lib/opal/erb.rb +8 -7
- data/lib/opal/errors.rb +72 -1
- data/lib/opal/fragment.rb +23 -3
- data/lib/opal/hike.rb +305 -0
- data/lib/opal/nodes.rb +5 -10
- data/lib/opal/nodes/arglist.rb +7 -6
- data/lib/opal/nodes/args.rb +36 -0
- data/lib/opal/nodes/args/arg.rb +22 -0
- data/lib/opal/nodes/args/arity_check.rb +151 -0
- data/lib/opal/nodes/args/ensure_kwargs_are_kwargs.rb +28 -0
- data/lib/opal/nodes/args/extract_block_arg.rb +34 -0
- data/lib/opal/nodes/args/extract_kwarg.rb +32 -0
- data/lib/opal/nodes/args/extract_kwargs.rb +28 -0
- data/lib/opal/nodes/args/extract_kwoptarg.rb +35 -0
- data/lib/opal/nodes/args/extract_kwrestarg.rb +35 -0
- data/lib/opal/nodes/args/extract_optarg.rb +35 -0
- data/lib/opal/nodes/args/extract_post_arg.rb +28 -0
- data/lib/opal/nodes/args/extract_post_optarg.rb +41 -0
- data/lib/opal/nodes/args/extract_restarg.rb +40 -0
- data/lib/opal/nodes/args/fake_arg.rb +26 -0
- data/lib/opal/nodes/args/initialize_iterarg.rb +28 -0
- data/lib/opal/nodes/args/initialize_shadowarg.rb +24 -0
- data/lib/opal/nodes/args/parameters.rb +63 -0
- data/lib/opal/nodes/args/prepare_post_args.rb +22 -0
- data/lib/opal/nodes/array.rb +9 -8
- data/lib/opal/nodes/base.rb +20 -11
- data/lib/opal/nodes/call.rb +24 -25
- data/lib/opal/nodes/call_special.rb +4 -3
- data/lib/opal/nodes/case.rb +24 -26
- data/lib/opal/nodes/class.rb +4 -5
- data/lib/opal/nodes/constants.rb +8 -7
- data/lib/opal/nodes/csend.rb +2 -3
- data/lib/opal/nodes/def.rb +28 -74
- data/lib/opal/nodes/defined.rb +36 -36
- data/lib/opal/nodes/definitions.rb +10 -7
- data/lib/opal/nodes/defs.rb +8 -16
- data/lib/opal/nodes/hash.rb +5 -4
- data/lib/opal/nodes/helpers.rb +8 -8
- data/lib/opal/nodes/if.rb +10 -8
- data/lib/opal/nodes/iter.rb +16 -103
- data/lib/opal/nodes/lambda.rb +18 -0
- data/lib/opal/nodes/literal.rb +29 -63
- data/lib/opal/nodes/logic.rb +25 -24
- data/lib/opal/nodes/masgn.rb +8 -6
- data/lib/opal/nodes/module.rb +4 -4
- data/lib/opal/nodes/node_with_args.rb +14 -208
- data/lib/opal/nodes/rescue.rb +32 -32
- data/lib/opal/nodes/runtime_helpers.rb +5 -4
- data/lib/opal/nodes/scope.rb +18 -29
- data/lib/opal/nodes/singleton_class.rb +3 -3
- data/lib/opal/nodes/super.rb +12 -18
- data/lib/opal/nodes/top.rb +10 -8
- data/lib/opal/nodes/variables.rb +6 -6
- data/lib/opal/nodes/while.rb +7 -6
- data/lib/opal/nodes/x_string.rb +139 -0
- data/lib/opal/nodes/yield.rb +10 -7
- data/lib/opal/parser.rb +9 -46
- data/lib/opal/parser/default_config.rb +50 -0
- data/lib/opal/parser/patch.rb +26 -0
- data/lib/opal/parser/source_buffer.rb +11 -0
- data/lib/opal/parser/with_c_lexer.rb +14 -0
- data/lib/opal/parser/with_ruby_lexer.rb +6 -0
- data/lib/opal/path_reader.rb +6 -5
- data/lib/opal/paths.rb +9 -6
- data/lib/opal/regexp_anchors.rb +6 -5
- data/lib/opal/rewriter.rb +7 -0
- data/lib/opal/rewriters/arguments.rb +58 -0
- data/lib/opal/rewriters/base.rb +32 -12
- data/lib/opal/rewriters/binary_operator_assignment.rb +20 -20
- data/lib/opal/rewriters/block_to_iter.rb +2 -1
- data/lib/opal/rewriters/break_finder.rb +2 -0
- data/lib/opal/rewriters/dot_js_syntax.rb +3 -2
- data/lib/opal/rewriters/dump_args.rb +28 -0
- data/lib/opal/rewriters/explicit_writer_return.rb +4 -3
- data/lib/opal/rewriters/for_rewriter.rb +12 -12
- data/lib/opal/rewriters/hashes/key_duplicates_rewriter.rb +2 -1
- data/lib/opal/rewriters/inline_args.rb +220 -0
- data/lib/opal/rewriters/js_reserved_words.rb +21 -17
- data/lib/opal/rewriters/logical_operator_assignment.rb +24 -14
- data/lib/opal/rewriters/mlhs_args.rb +128 -0
- data/lib/opal/rewriters/opal_engine_check.rb +11 -6
- data/lib/opal/rewriters/rubyspec/filters_rewriter.rb +3 -2
- data/lib/opal/server.rb +1 -0
- data/lib/opal/simple_server.rb +15 -23
- data/lib/opal/source_map.rb +7 -70
- data/lib/opal/source_map/file.rb +199 -0
- data/lib/opal/source_map/index.rb +83 -0
- data/lib/opal/source_map/map.rb +26 -0
- data/lib/opal/source_map/vlq.rb +98 -0
- data/lib/opal/util.rb +7 -5
- data/lib/opal/version.rb +2 -1
- data/lib/tilt/opal.rb +3 -3
- data/opal.gemspec +18 -9
- data/opal/corelib/array.rb +135 -117
- data/opal/corelib/array/pack.rb +446 -0
- data/opal/corelib/basic_object.rb +23 -9
- data/opal/corelib/boolean.rb +3 -3
- data/opal/corelib/class.rb +4 -10
- data/opal/corelib/comparable.rb +36 -23
- data/opal/corelib/complex.rb +108 -14
- data/opal/corelib/constants.rb +4 -4
- data/opal/corelib/enumerable.rb +132 -135
- data/opal/corelib/enumerator.rb +47 -50
- data/opal/corelib/error.rb +65 -8
- data/opal/corelib/file.rb +37 -32
- data/opal/corelib/hash.rb +90 -21
- data/opal/corelib/helpers.rb +7 -6
- data/opal/corelib/kernel.rb +53 -586
- data/opal/corelib/kernel/format.rb +544 -0
- data/opal/corelib/marshal.rb +1 -13
- data/opal/corelib/marshal/read_buffer.rb +20 -23
- data/opal/corelib/marshal/write_buffer.rb +23 -15
- data/opal/corelib/math.rb +12 -16
- data/opal/corelib/method.rb +5 -3
- data/opal/corelib/module.rb +80 -109
- data/opal/corelib/nil.rb +2 -2
- data/opal/corelib/number.rb +177 -43
- data/opal/corelib/numeric.rb +22 -16
- data/opal/corelib/pack_unpack/format_string_parser.rb +135 -0
- data/opal/corelib/proc.rb +3 -4
- data/opal/corelib/process.rb +1 -1
- data/opal/corelib/random.rb +24 -16
- data/opal/corelib/random/MersenneTwister.js +137 -0
- data/opal/corelib/random/math_random.js.rb +9 -0
- data/opal/corelib/random/mersenne_twister.js.rb +13 -0
- data/opal/corelib/random/seedrandom.js.rb +12 -0
- data/opal/corelib/range.rb +25 -26
- data/opal/corelib/rational.rb +57 -17
- data/opal/corelib/regexp.rb +39 -43
- data/opal/corelib/runtime.js +806 -683
- data/opal/corelib/string.rb +213 -112
- data/opal/corelib/string/encoding.rb +14 -17
- data/opal/corelib/string/unpack.rb +793 -0
- data/opal/corelib/struct.rb +40 -24
- data/opal/corelib/time.rb +14 -15
- data/opal/corelib/unsupported.rb +26 -4
- data/opal/opal.rb +2 -1
- data/opal/opal/full.rb +2 -0
- data/stdlib/base64.rb +1 -1
- data/stdlib/bigdecimal.rb +11 -13
- data/stdlib/buffer.rb +9 -8
- data/stdlib/buffer/array.rb +46 -48
- data/stdlib/buffer/view.rb +85 -47
- data/stdlib/console.rb +18 -18
- data/stdlib/date.rb +85 -66
- data/stdlib/delegate.rb +2 -2
- data/stdlib/e2mmap.rb +176 -0
- data/stdlib/encoding.rb +1 -1
- data/stdlib/erb.rb +1 -1
- data/stdlib/forwardable.rb +14 -14
- data/stdlib/json.rb +1 -2
- data/stdlib/logger.rb +112 -0
- data/stdlib/math.rb +1 -1
- data/stdlib/matrix.rb +2169 -0
- data/stdlib/matrix/eigenvalue_decomposition.rb +883 -0
- data/stdlib/matrix/lup_decomposition.rb +219 -0
- data/stdlib/nashorn/file.rb +7 -9
- data/stdlib/native.rb +69 -63
- data/stdlib/nodejs.rb +3 -0
- data/stdlib/nodejs/dir.rb +25 -4
- data/stdlib/nodejs/env.rb +40 -0
- data/stdlib/nodejs/file.rb +184 -34
- data/stdlib/nodejs/fileutils.rb +4 -4
- data/stdlib/nodejs/io.rb +4 -46
- data/stdlib/nodejs/irb.rb +27 -29
- data/stdlib/nodejs/kernel.rb +2 -11
- data/stdlib/nodejs/node_modules/balanced-match/.npmignore +5 -0
- data/stdlib/nodejs/node_modules/balanced-match/LICENSE.md +21 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match → balanced-match}/README.md +13 -2
- data/stdlib/nodejs/node_modules/balanced-match/index.js +59 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match → balanced-match}/package.json +46 -42
- data/stdlib/nodejs/node_modules/brace-expansion/LICENSE +21 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch/node_modules/brace-expansion → brace-expansion}/README.md +9 -1
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch/node_modules/brace-expansion → brace-expansion}/index.js +12 -2
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch/node_modules/brace-expansion → brace-expansion}/package.json +48 -48
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/.travis.yml +0 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/LICENSE +0 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/README.markdown +0 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/example/map.js +0 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/index.js +0 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/package.json +47 -42
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map → concat-map}/test/map.js +0 -0
- data/stdlib/nodejs/node_modules/fs.realpath/LICENSE +43 -0
- data/stdlib/nodejs/node_modules/fs.realpath/README.md +33 -0
- data/stdlib/nodejs/node_modules/fs.realpath/index.js +66 -0
- data/stdlib/nodejs/node_modules/fs.realpath/old.js +303 -0
- data/stdlib/nodejs/node_modules/fs.realpath/package.json +59 -0
- data/stdlib/nodejs/node_modules/glob/README.md +57 -46
- data/stdlib/nodejs/node_modules/glob/changelog.md +67 -0
- data/stdlib/nodejs/node_modules/glob/common.js +91 -28
- data/stdlib/nodejs/node_modules/glob/glob.js +196 -55
- data/stdlib/nodejs/node_modules/glob/package.json +55 -51
- data/stdlib/nodejs/node_modules/glob/sync.js +116 -39
- data/stdlib/nodejs/node_modules/{glob/node_modules/inflight → inflight}/LICENSE +0 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/inflight → inflight}/README.md +0 -0
- data/stdlib/nodejs/node_modules/inflight/inflight.js +54 -0
- data/stdlib/nodejs/node_modules/inflight/package.json +58 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/inherits → inherits}/LICENSE +0 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/inherits → inherits}/README.md +0 -0
- data/stdlib/nodejs/node_modules/inherits/inherits.js +7 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/inherits → inherits}/inherits_browser.js +0 -0
- data/stdlib/nodejs/node_modules/inherits/package.json +61 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/inflight/node_modules/wrappy → minimatch}/LICENSE +0 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch → minimatch}/README.md +2 -9
- data/stdlib/nodejs/node_modules/{glob/node_modules/minimatch → minimatch}/minimatch.js +284 -206
- data/stdlib/nodejs/node_modules/minimatch/package.json +63 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/once/node_modules/wrappy → once}/LICENSE +0 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/once → once}/README.md +28 -0
- data/stdlib/nodejs/node_modules/once/once.js +42 -0
- data/stdlib/nodejs/node_modules/once/package.json +67 -0
- data/stdlib/nodejs/node_modules/path-is-absolute/index.js +20 -0
- data/stdlib/nodejs/node_modules/path-is-absolute/license +21 -0
- data/stdlib/nodejs/node_modules/path-is-absolute/package.json +75 -0
- data/stdlib/nodejs/node_modules/path-is-absolute/readme.md +59 -0
- data/stdlib/nodejs/node_modules/unxhr/LICENSE +22 -0
- data/stdlib/nodejs/node_modules/unxhr/README.md +41 -0
- data/stdlib/nodejs/node_modules/unxhr/lib/XMLHttpRequest.js +598 -0
- data/stdlib/nodejs/node_modules/unxhr/lib/browser.js +2 -0
- data/stdlib/nodejs/node_modules/unxhr/lib/request.js +63 -0
- data/stdlib/nodejs/node_modules/unxhr/package.json +75 -0
- data/stdlib/nodejs/node_modules/wrappy/LICENSE +15 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/inflight/node_modules/wrappy → wrappy}/README.md +0 -0
- data/stdlib/nodejs/node_modules/wrappy/package.json +59 -0
- data/stdlib/nodejs/node_modules/{glob/node_modules/inflight/node_modules/wrappy → wrappy}/wrappy.js +0 -0
- data/stdlib/nodejs/open-uri.rb +26 -0
- data/stdlib/nodejs/package-lock.json +88 -0
- data/stdlib/nodejs/package.json +2 -1
- data/stdlib/nodejs/pathname.rb +20 -0
- data/stdlib/nodejs/require.rb +3 -3
- data/stdlib/nodejs/stacktrace.rb +1 -1
- data/stdlib/nodejs/yaml.rb +1 -1
- data/stdlib/opal-builder.rb +1 -0
- data/stdlib/opal-parser.rb +4 -1
- data/stdlib/opal-platform.rb +8 -10
- data/stdlib/opal-source-maps.rb +0 -1
- data/stdlib/open-uri.rb +349 -0
- data/stdlib/ostruct.rb +19 -17
- data/stdlib/pathname.rb +22 -22
- data/stdlib/pp.rb +5 -5
- data/stdlib/promise.rb +30 -26
- data/stdlib/rbconfig/sizeof.rb +50 -0
- data/stdlib/securerandom.rb +1 -1
- data/stdlib/set.rb +21 -23
- data/stdlib/singleton.rb +3 -4
- data/stdlib/stringio.rb +33 -0
- data/stdlib/strscan.rb +55 -55
- data/stdlib/template.rb +1 -2
- data/stdlib/thread.rb +6 -7
- data/tasks/benchmarking.rake +1 -1
- data/tasks/building.rake +4 -12
- data/tasks/linting.rake +17 -2
- data/tasks/releasing.rake +84 -0
- data/tasks/testing.rake +57 -15
- data/tasks/testing/mspec_special_calls.rb +23 -4
- data/vendored-minitest/minitest.rb +1 -1
- metadata +169 -168
- data/bin/opal-build +0 -3
- data/exe/opal-mspec +0 -10
- data/lib/opal/nodes/args/initialize_kwargs.rb +0 -29
- data/lib/opal/nodes/args/kwarg.rb +0 -31
- data/lib/opal/nodes/args/kwoptarg.rb +0 -34
- data/lib/opal/nodes/args/kwrestarg.rb +0 -39
- data/lib/opal/nodes/args/mlhsarg.rb +0 -78
- data/lib/opal/nodes/args/normarg.rb +0 -29
- data/lib/opal/nodes/args/optarg.rb +0 -25
- data/lib/opal/nodes/args/post_args.rb +0 -201
- data/lib/opal/nodes/args/post_kwargs.rb +0 -32
- data/lib/opal/nodes/args/restarg.rb +0 -38
- data/lib/opal/nodes/inline_args.rb +0 -60
- data/opal/corelib/string/inheritance.rb +0 -123
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/.eslintrc +0 -17
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/inflight.js +0 -44
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +0 -52
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +0 -51
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/package.json +0 -61
- data/stdlib/nodejs/node_modules/glob/node_modules/inflight/test.js +0 -97
- data/stdlib/nodejs/node_modules/glob/node_modules/inherits/inherits.js +0 -1
- data/stdlib/nodejs/node_modules/glob/node_modules/inherits/package.json +0 -51
- data/stdlib/nodejs/node_modules/glob/node_modules/inherits/test.js +0 -25
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/.npmignore +0 -1
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/.travis.yml +0 -4
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/LICENSE +0 -23
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/benchmark.js +0 -15
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/browser.js +0 -1181
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +0 -2
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +0 -3
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +0 -8
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +0 -2
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +0 -4
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +0 -6
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +0 -5
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +0 -38
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +0 -56
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +0 -32
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +0 -1075
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +0 -182
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +0 -9
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +0 -10
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +0 -24
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +0 -15
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +0 -16
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +0 -10
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +0 -13
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +0 -7
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +0 -50
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/package.json +0 -60
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/test/basic.js +0 -399
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/test/brace-expand.js +0 -45
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/test/defaults.js +0 -274
- data/stdlib/nodejs/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js +0 -8
- data/stdlib/nodejs/node_modules/glob/node_modules/once/LICENSE +0 -27
- data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +0 -36
- data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +0 -52
- data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +0 -51
- data/stdlib/nodejs/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +0 -33
- data/stdlib/nodejs/node_modules/glob/node_modules/once/once.js +0 -21
- data/stdlib/nodejs/node_modules/glob/node_modules/once/package.json +0 -60
- data/stdlib/nodejs/node_modules/glob/node_modules/once/test/once.js +0 -23
- data/stdlib/nodejs/rubygems.rb +0 -68
- data/stdlib/source_map.rb +0 -5
- data/stdlib/source_map/map.rb +0 -220
- data/stdlib/source_map/mapping.rb +0 -26
- data/stdlib/source_map/offset.rb +0 -88
- data/stdlib/source_map/version.rb +0 -3
- data/stdlib/source_map/vlq.rb +0 -99
- data/stdlib/sourcemap.rb +0 -1
@@ -1,182 +0,0 @@
|
|
1
|
-
# skip quotes for now
|
2
|
-
# "{x,x}"
|
3
|
-
# {"x,x"}
|
4
|
-
# {x","x}
|
5
|
-
# '{a,b}{{a,b},a,b}'
|
6
|
-
A{b,{d,e},{f,g}}Z
|
7
|
-
PRE-{a,b}{{a,b},a,b}-POST
|
8
|
-
\\{a,b}{{a,b},a,b}
|
9
|
-
{{a,b}
|
10
|
-
{a,b}}
|
11
|
-
{,}
|
12
|
-
a{,}
|
13
|
-
{,}b
|
14
|
-
a{,}b
|
15
|
-
a{b}c
|
16
|
-
a{1..5}b
|
17
|
-
a{01..5}b
|
18
|
-
a{-01..5}b
|
19
|
-
a{-01..5..3}b
|
20
|
-
a{001..9}b
|
21
|
-
a{b,c{d,e},{f,g}h}x{y,z
|
22
|
-
a{b,c{d,e},{f,g}h}x{y,z\\}
|
23
|
-
a{b,c{d,e},{f,g}h}x{y,z}
|
24
|
-
a{b{c{d,e}f{x,y{{g}h
|
25
|
-
a{b{c{d,e}f{x,y{}g}h
|
26
|
-
a{b{c{d,e}f{x,y}}g}h
|
27
|
-
a{b{c{d,e}f}g}h
|
28
|
-
a{{x,y},z}b
|
29
|
-
f{x,y{g,z}}h
|
30
|
-
f{x,y{{g,z}}h
|
31
|
-
f{x,y{{g,z}}h}
|
32
|
-
f{x,y{{g}h
|
33
|
-
f{x,y{{g}}h
|
34
|
-
f{x,y{}g}h
|
35
|
-
z{a,b{,c}d
|
36
|
-
z{a,b},c}d
|
37
|
-
{-01..5}
|
38
|
-
{-05..100..5}
|
39
|
-
{-05..100}
|
40
|
-
{0..5..2}
|
41
|
-
{0001..05..2}
|
42
|
-
{0001..-5..2}
|
43
|
-
{0001..-5..-2}
|
44
|
-
{0001..5..-2}
|
45
|
-
{01..5}
|
46
|
-
{1..05}
|
47
|
-
{1..05..3}
|
48
|
-
{05..100}
|
49
|
-
{0a..0z}
|
50
|
-
{a,b\\}c,d}
|
51
|
-
{a,b{c,d}
|
52
|
-
{a,b}c,d}
|
53
|
-
{a..F}
|
54
|
-
{A..f}
|
55
|
-
{a..Z}
|
56
|
-
{A..z}
|
57
|
-
{z..A}
|
58
|
-
{Z..a}
|
59
|
-
{a..F..2}
|
60
|
-
{A..f..02}
|
61
|
-
{a..Z..5}
|
62
|
-
d{a..Z..5}b
|
63
|
-
{A..z..10}
|
64
|
-
{z..A..-2}
|
65
|
-
{Z..a..20}
|
66
|
-
{a{,b}
|
67
|
-
{a},b}
|
68
|
-
{x,y{,}g}
|
69
|
-
{x,y{}g}
|
70
|
-
{{a,b}
|
71
|
-
{{a,b},c}
|
72
|
-
{{a,b}c}
|
73
|
-
{{a,b},}
|
74
|
-
X{{a,b},}X
|
75
|
-
{{a,b},}c
|
76
|
-
{{a,b}.}
|
77
|
-
{{a,b}}
|
78
|
-
X{a..#}X
|
79
|
-
# this next one is an empty string
|
80
|
-
|
81
|
-
{-10..00}
|
82
|
-
# Need to escape slashes in here for reasons i guess.
|
83
|
-
{a,\\\\{a,b}c}
|
84
|
-
{a,\\{a,b}c}
|
85
|
-
a,\\{b,c}
|
86
|
-
{-10.\\.00}
|
87
|
-
#### bash tests/braces.tests
|
88
|
-
# Note that some tests are edited out because some features of
|
89
|
-
# bash are intentionally not supported in this brace expander.
|
90
|
-
ff{c,b,a}
|
91
|
-
f{d,e,f}g
|
92
|
-
{l,n,m}xyz
|
93
|
-
{abc\\,def}
|
94
|
-
{abc}
|
95
|
-
{x\\,y,\\{abc\\},trie}
|
96
|
-
# not impementing back-ticks obviously
|
97
|
-
# XXXX\\{`echo a b c | tr ' ' ','`\\}
|
98
|
-
{}
|
99
|
-
# We only ever have to worry about parsing a single argument,
|
100
|
-
# not a command line, so spaces have a different meaning than bash.
|
101
|
-
# { }
|
102
|
-
}
|
103
|
-
{
|
104
|
-
abcd{efgh
|
105
|
-
# spaces
|
106
|
-
# foo {1,2} bar
|
107
|
-
# not impementing back-ticks obviously
|
108
|
-
# `zecho foo {1,2} bar`
|
109
|
-
# $(zecho foo {1,2} bar)
|
110
|
-
# ${var} is not a variable here, like it is in bash. omit.
|
111
|
-
# foo{bar,${var}.}
|
112
|
-
# foo{bar,${var}}
|
113
|
-
# isaacs: skip quotes for now
|
114
|
-
# "${var}"{x,y}
|
115
|
-
# $var{x,y}
|
116
|
-
# ${var}{x,y}
|
117
|
-
# new sequence brace operators
|
118
|
-
{1..10}
|
119
|
-
# this doesn't work yet
|
120
|
-
{0..10,braces}
|
121
|
-
# but this does
|
122
|
-
{{0..10},braces}
|
123
|
-
x{{0..10},braces}y
|
124
|
-
{3..3}
|
125
|
-
x{3..3}y
|
126
|
-
{10..1}
|
127
|
-
{10..1}y
|
128
|
-
x{10..1}y
|
129
|
-
{a..f}
|
130
|
-
{f..a}
|
131
|
-
{a..A}
|
132
|
-
{A..a}
|
133
|
-
{f..f}
|
134
|
-
# mixes are incorrectly-formed brace expansions
|
135
|
-
{1..f}
|
136
|
-
{f..1}
|
137
|
-
# spaces
|
138
|
-
# 0{1..9} {10..20}
|
139
|
-
# do negative numbers work?
|
140
|
-
{-1..-10}
|
141
|
-
{-20..0}
|
142
|
-
# weirdly-formed brace expansions -- fixed in post-bash-3.1
|
143
|
-
a-{b{d,e}}-c
|
144
|
-
a-{bdef-{g,i}-c
|
145
|
-
# isaacs: skip quotes for now
|
146
|
-
# {"klklkl"}{1,2,3}
|
147
|
-
# isaacs: this is a valid test, though
|
148
|
-
{klklkl}{1,2,3}
|
149
|
-
# {"x,x"}
|
150
|
-
{1..10..2}
|
151
|
-
{-1..-10..2}
|
152
|
-
{-1..-10..-2}
|
153
|
-
{10..1..-2}
|
154
|
-
{10..1..2}
|
155
|
-
{1..20..2}
|
156
|
-
{1..20..20}
|
157
|
-
{100..0..5}
|
158
|
-
{100..0..-5}
|
159
|
-
{a..z}
|
160
|
-
{a..z..2}
|
161
|
-
{z..a..-2}
|
162
|
-
# make sure brace expansion handles ints > 2**31 - 1 using intmax_t
|
163
|
-
{2147483645..2147483649}
|
164
|
-
# unwanted zero-padding -- fixed post-bash-4.0
|
165
|
-
{10..0..2}
|
166
|
-
{10..0..-2}
|
167
|
-
{-50..-0..5}
|
168
|
-
# bad
|
169
|
-
{1..10.f}
|
170
|
-
{1..ff}
|
171
|
-
{1..10..ff}
|
172
|
-
{1.20..2}
|
173
|
-
{1..20..f2}
|
174
|
-
{1..20..2f}
|
175
|
-
{1..2f..2}
|
176
|
-
{1..ff..2}
|
177
|
-
{1..ff}
|
178
|
-
{1..f}
|
179
|
-
{1..0f}
|
180
|
-
{1..10f}
|
181
|
-
{1..10.f}
|
182
|
-
{1..10.f}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
var test = require('tape');
|
2
|
-
var expand = require('..');
|
3
|
-
|
4
|
-
test('ignores ${', function(t) {
|
5
|
-
t.deepEqual(expand('${1..3}'), ['${1..3}']);
|
6
|
-
t.deepEqual(expand('${a,b}${c,d}'), ['${a,b}${c,d}']);
|
7
|
-
t.deepEqual(expand('x${a,b}x${c,d}x'), ['x${a,b}x${c,d}x']);
|
8
|
-
t.end();
|
9
|
-
});
|
@@ -1,24 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
set -e
|
4
|
-
|
5
|
-
# Bash 4.3 because of arbitrary need to pick a single standard.
|
6
|
-
|
7
|
-
if [ "${BASH_VERSINFO[0]}" != "4" ] || [ "${BASH_VERSINFO[1]}" != "3" ]; then
|
8
|
-
echo "this script requires bash 4.3" >&2
|
9
|
-
exit 1
|
10
|
-
fi
|
11
|
-
|
12
|
-
CDPATH= cd "$(dirname "$0")"
|
13
|
-
|
14
|
-
js='require("./")(process.argv[1]).join(" ")'
|
15
|
-
|
16
|
-
cat cases.txt | \
|
17
|
-
while read case; do
|
18
|
-
if [ "${case:0:1}" = "#" ]; then
|
19
|
-
continue;
|
20
|
-
fi;
|
21
|
-
b="$($BASH -c 'for c in '"$case"'; do echo ["$c"]; done')"
|
22
|
-
echo "$case"
|
23
|
-
echo -n "$b><><><><";
|
24
|
-
done > bash-results.txt
|
@@ -1,15 +0,0 @@
|
|
1
|
-
var test = require('tape');
|
2
|
-
var expand = require('..');
|
3
|
-
|
4
|
-
test('negative increment', function(t) {
|
5
|
-
t.deepEqual(expand('{3..1}'), ['3', '2', '1']);
|
6
|
-
t.deepEqual(expand('{10..8}'), ['10', '9', '8']);
|
7
|
-
t.deepEqual(expand('{10..08}'), ['10', '09', '08']);
|
8
|
-
t.deepEqual(expand('{c..a}'), ['c', 'b', 'a']);
|
9
|
-
|
10
|
-
t.deepEqual(expand('{4..0..2}'), ['4', '2', '0']);
|
11
|
-
t.deepEqual(expand('{4..0..-2}'), ['4', '2', '0']);
|
12
|
-
t.deepEqual(expand('{e..a..2}'), ['e', 'c', 'a']);
|
13
|
-
|
14
|
-
t.end();
|
15
|
-
});
|
@@ -1,16 +0,0 @@
|
|
1
|
-
var test = require('tape');
|
2
|
-
var expand = require('..');
|
3
|
-
|
4
|
-
test('nested', function(t) {
|
5
|
-
t.deepEqual(expand('{a,b{1..3},c}'), [
|
6
|
-
'a', 'b1', 'b2', 'b3', 'c'
|
7
|
-
]);
|
8
|
-
t.deepEqual(expand('{{A..Z},{a..z}}'),
|
9
|
-
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('')
|
10
|
-
);
|
11
|
-
t.deepEqual(expand('ppp{,config,oe{,conf}}'), [
|
12
|
-
'ppp', 'pppconfig', 'pppoe', 'pppoeconf'
|
13
|
-
]);
|
14
|
-
t.end();
|
15
|
-
});
|
16
|
-
|
@@ -1,50 +0,0 @@
|
|
1
|
-
var test = require('tape');
|
2
|
-
var expand = require('..');
|
3
|
-
|
4
|
-
test('numeric sequences', function(t) {
|
5
|
-
t.deepEqual(expand('a{1..2}b{2..3}c'), [
|
6
|
-
'a1b2c', 'a1b3c', 'a2b2c', 'a2b3c'
|
7
|
-
]);
|
8
|
-
t.deepEqual(expand('{1..2}{2..3}'), [
|
9
|
-
'12', '13', '22', '23'
|
10
|
-
]);
|
11
|
-
t.end();
|
12
|
-
});
|
13
|
-
|
14
|
-
test('numeric sequences with step count', function(t) {
|
15
|
-
t.deepEqual(expand('{0..8..2}'), [
|
16
|
-
'0', '2', '4', '6', '8'
|
17
|
-
]);
|
18
|
-
t.deepEqual(expand('{1..8..2}'), [
|
19
|
-
'1', '3', '5', '7'
|
20
|
-
]);
|
21
|
-
t.end();
|
22
|
-
});
|
23
|
-
|
24
|
-
test('numeric sequence with negative x / y', function(t) {
|
25
|
-
t.deepEqual(expand('{3..-2}'), [
|
26
|
-
'3', '2', '1', '0', '-1', '-2'
|
27
|
-
]);
|
28
|
-
t.end();
|
29
|
-
});
|
30
|
-
|
31
|
-
test('alphabetic sequences', function(t) {
|
32
|
-
t.deepEqual(expand('1{a..b}2{b..c}3'), [
|
33
|
-
'1a2b3', '1a2c3', '1b2b3', '1b2c3'
|
34
|
-
]);
|
35
|
-
t.deepEqual(expand('{a..b}{b..c}'), [
|
36
|
-
'ab', 'ac', 'bb', 'bc'
|
37
|
-
]);
|
38
|
-
t.end();
|
39
|
-
});
|
40
|
-
|
41
|
-
test('alphabetic sequences with step count', function(t) {
|
42
|
-
t.deepEqual(expand('{a..k..2}'), [
|
43
|
-
'a', 'c', 'e', 'g', 'i', 'k'
|
44
|
-
]);
|
45
|
-
t.deepEqual(expand('{b..k..2}'), [
|
46
|
-
'b', 'd', 'f', 'h', 'j'
|
47
|
-
]);
|
48
|
-
t.end();
|
49
|
-
});
|
50
|
-
|
@@ -1,60 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"author": {
|
3
|
-
"name": "Isaac Z. Schlueter",
|
4
|
-
"email": "i@izs.me",
|
5
|
-
"url": "http://blog.izs.me"
|
6
|
-
},
|
7
|
-
"name": "minimatch",
|
8
|
-
"description": "a glob matcher in javascript",
|
9
|
-
"version": "2.0.1",
|
10
|
-
"repository": {
|
11
|
-
"type": "git",
|
12
|
-
"url": "git://github.com/isaacs/minimatch.git"
|
13
|
-
},
|
14
|
-
"main": "minimatch.js",
|
15
|
-
"scripts": {
|
16
|
-
"test": "tap test/*.js",
|
17
|
-
"prepublish": "browserify -o browser.js -e minimatch.js"
|
18
|
-
},
|
19
|
-
"engines": {
|
20
|
-
"node": "*"
|
21
|
-
},
|
22
|
-
"dependencies": {
|
23
|
-
"brace-expansion": "^1.0.0"
|
24
|
-
},
|
25
|
-
"devDependencies": {
|
26
|
-
"browserify": "^6.3.3",
|
27
|
-
"tap": ""
|
28
|
-
},
|
29
|
-
"license": {
|
30
|
-
"type": "MIT",
|
31
|
-
"url": "http://github.com/isaacs/minimatch/raw/master/LICENSE"
|
32
|
-
},
|
33
|
-
"gitHead": "eac219d8f665c8043fda9a1cd34eab9b006fae01",
|
34
|
-
"bugs": {
|
35
|
-
"url": "https://github.com/isaacs/minimatch/issues"
|
36
|
-
},
|
37
|
-
"homepage": "https://github.com/isaacs/minimatch",
|
38
|
-
"_id": "minimatch@2.0.1",
|
39
|
-
"_shasum": "6c3760b45f66ed1cd5803143ee8d372488f02c37",
|
40
|
-
"_from": "minimatch@>=2.0.1 <3.0.0",
|
41
|
-
"_npmVersion": "2.1.11",
|
42
|
-
"_nodeVersion": "0.10.16",
|
43
|
-
"_npmUser": {
|
44
|
-
"name": "isaacs",
|
45
|
-
"email": "i@izs.me"
|
46
|
-
},
|
47
|
-
"maintainers": [
|
48
|
-
{
|
49
|
-
"name": "isaacs",
|
50
|
-
"email": "i@izs.me"
|
51
|
-
}
|
52
|
-
],
|
53
|
-
"dist": {
|
54
|
-
"shasum": "6c3760b45f66ed1cd5803143ee8d372488f02c37",
|
55
|
-
"tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz"
|
56
|
-
},
|
57
|
-
"directories": {},
|
58
|
-
"_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.1.tgz",
|
59
|
-
"readme": "ERROR: No README data found!"
|
60
|
-
}
|
@@ -1,399 +0,0 @@
|
|
1
|
-
// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test
|
2
|
-
//
|
3
|
-
// TODO: Some of these tests do very bad things with backslashes, and will
|
4
|
-
// most likely fail badly on windows. They should probably be skipped.
|
5
|
-
|
6
|
-
var tap = require("tap")
|
7
|
-
, globalBefore = Object.keys(global)
|
8
|
-
, mm = require("../")
|
9
|
-
, files = [ "a", "b", "c", "d", "abc"
|
10
|
-
, "abd", "abe", "bb", "bcd"
|
11
|
-
, "ca", "cb", "dd", "de"
|
12
|
-
, "bdir/", "bdir/cfile"]
|
13
|
-
, next = files.concat([ "a-b", "aXb"
|
14
|
-
, ".x", ".y" ])
|
15
|
-
|
16
|
-
|
17
|
-
var patterns =
|
18
|
-
[ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test"
|
19
|
-
, ["a*", ["a", "abc", "abd", "abe"]]
|
20
|
-
, ["X*", ["X*"], {nonull: true}]
|
21
|
-
|
22
|
-
// allow null glob expansion
|
23
|
-
, ["X*", []]
|
24
|
-
|
25
|
-
// isaacs: Slightly different than bash/sh/ksh
|
26
|
-
// \\* is not un-escaped to literal "*" in a failed match,
|
27
|
-
// but it does make it get treated as a literal star
|
28
|
-
, ["\\*", ["\\*"], {nonull: true}]
|
29
|
-
, ["\\**", ["\\**"], {nonull: true}]
|
30
|
-
, ["\\*\\*", ["\\*\\*"], {nonull: true}]
|
31
|
-
|
32
|
-
, ["b*/", ["bdir/"]]
|
33
|
-
, ["c*", ["c", "ca", "cb"]]
|
34
|
-
, ["**", files]
|
35
|
-
|
36
|
-
, ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}]
|
37
|
-
, ["s/\\..*//", ["s/\\..*//"], {nonull: true}]
|
38
|
-
|
39
|
-
, "legendary larry crashes bashes"
|
40
|
-
, ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"
|
41
|
-
, ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}]
|
42
|
-
, ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"
|
43
|
-
, ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}]
|
44
|
-
|
45
|
-
, "character classes"
|
46
|
-
, ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]]
|
47
|
-
, ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd",
|
48
|
-
"bdir/", "ca", "cb", "dd", "de"]]
|
49
|
-
, ["a*[^c]", ["abd", "abe"]]
|
50
|
-
, function () { files.push("a-b", "aXb") }
|
51
|
-
, ["a[X-]b", ["a-b", "aXb"]]
|
52
|
-
, function () { files.push(".x", ".y") }
|
53
|
-
, ["[^a-c]*", ["d", "dd", "de"]]
|
54
|
-
, function () { files.push("a*b/", "a*b/ooo") }
|
55
|
-
, ["a\\*b/*", ["a*b/ooo"]]
|
56
|
-
, ["a\\*?/*", ["a*b/ooo"]]
|
57
|
-
, ["*\\\\!*", [], {null: true}, ["echo !7"]]
|
58
|
-
, ["*\\!*", ["echo !7"], null, ["echo !7"]]
|
59
|
-
, ["*.\\*", ["r.*"], null, ["r.*"]]
|
60
|
-
, ["a[b]c", ["abc"]]
|
61
|
-
, ["a[\\b]c", ["abc"]]
|
62
|
-
, ["a?c", ["abc"]]
|
63
|
-
, ["a\\*c", [], {null: true}, ["abc"]]
|
64
|
-
, ["", [""], { null: true }, [""]]
|
65
|
-
|
66
|
-
, "http://www.opensource.apple.com/source/bash/bash-23/" +
|
67
|
-
"bash/tests/glob-test"
|
68
|
-
, function () { files.push("man/", "man/man1/", "man/man1/bash.1") }
|
69
|
-
, ["*/man*/bash.*", ["man/man1/bash.1"]]
|
70
|
-
, ["man/man1/bash.1", ["man/man1/bash.1"]]
|
71
|
-
, ["a***c", ["abc"], null, ["abc"]]
|
72
|
-
, ["a*****?c", ["abc"], null, ["abc"]]
|
73
|
-
, ["?*****??", ["abc"], null, ["abc"]]
|
74
|
-
, ["*****??", ["abc"], null, ["abc"]]
|
75
|
-
, ["?*****?c", ["abc"], null, ["abc"]]
|
76
|
-
, ["?***?****c", ["abc"], null, ["abc"]]
|
77
|
-
, ["?***?****?", ["abc"], null, ["abc"]]
|
78
|
-
, ["?***?****", ["abc"], null, ["abc"]]
|
79
|
-
, ["*******c", ["abc"], null, ["abc"]]
|
80
|
-
, ["*******?", ["abc"], null, ["abc"]]
|
81
|
-
, ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
82
|
-
, ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
83
|
-
, ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
84
|
-
, ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
85
|
-
, ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
86
|
-
, ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]]
|
87
|
-
, ["[-abc]", ["-"], null, ["-"]]
|
88
|
-
, ["[abc-]", ["-"], null, ["-"]]
|
89
|
-
, ["\\", ["\\"], null, ["\\"]]
|
90
|
-
, ["[\\\\]", ["\\"], null, ["\\"]]
|
91
|
-
, ["[[]", ["["], null, ["["]]
|
92
|
-
, ["[", ["["], null, ["["]]
|
93
|
-
, ["[*", ["[abc"], null, ["[abc"]]
|
94
|
-
, "a right bracket shall lose its special meaning and\n" +
|
95
|
-
"represent itself in a bracket expression if it occurs\n" +
|
96
|
-
"first in the list. -- POSIX.2 2.8.3.2"
|
97
|
-
, ["[]]", ["]"], null, ["]"]]
|
98
|
-
, ["[]-]", ["]"], null, ["]"]]
|
99
|
-
, ["[a-\z]", ["p"], null, ["p"]]
|
100
|
-
, ["??**********?****?", [], { null: true }, ["abc"]]
|
101
|
-
, ["??**********?****c", [], { null: true }, ["abc"]]
|
102
|
-
, ["?************c****?****", [], { null: true }, ["abc"]]
|
103
|
-
, ["*c*?**", [], { null: true }, ["abc"]]
|
104
|
-
, ["a*****c*?**", [], { null: true }, ["abc"]]
|
105
|
-
, ["a********???*******", [], { null: true }, ["abc"]]
|
106
|
-
, ["[]", [], { null: true }, ["a"]]
|
107
|
-
, ["[abc", [], { null: true }, ["["]]
|
108
|
-
|
109
|
-
, "nocase tests"
|
110
|
-
, ["XYZ", ["xYz"], { nocase: true, null: true }
|
111
|
-
, ["xYz", "ABC", "IjK"]]
|
112
|
-
, ["ab*", ["ABC"], { nocase: true, null: true }
|
113
|
-
, ["xYz", "ABC", "IjK"]]
|
114
|
-
, ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true }
|
115
|
-
, ["xYz", "ABC", "IjK"]]
|
116
|
-
|
117
|
-
// [ pattern, [matches], MM opts, files, TAP opts]
|
118
|
-
, "onestar/twostar"
|
119
|
-
, ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]]
|
120
|
-
, ["{/?,*}", ["/a", "bb"], {null: true}
|
121
|
-
, ["/a", "/b/b", "/a/b/c", "bb"]]
|
122
|
-
|
123
|
-
, "dots should not match unless requested"
|
124
|
-
, ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]]
|
125
|
-
|
126
|
-
// .. and . can only match patterns starting with .,
|
127
|
-
// even when options.dot is set.
|
128
|
-
, function () {
|
129
|
-
files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"]
|
130
|
-
}
|
131
|
-
, ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}]
|
132
|
-
, ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}]
|
133
|
-
, ["a/*/b", ["a/c/b"], {dot:false}]
|
134
|
-
, ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}]
|
135
|
-
|
136
|
-
|
137
|
-
// this also tests that changing the options needs
|
138
|
-
// to change the cache key, even if the pattern is
|
139
|
-
// the same!
|
140
|
-
, ["**", ["a/b","a/.d",".a/.d"], { dot: true }
|
141
|
-
, [ ".a/.d", "a/.d", "a/b"]]
|
142
|
-
|
143
|
-
, "paren sets cannot contain slashes"
|
144
|
-
, ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]]
|
145
|
-
|
146
|
-
// brace sets trump all else.
|
147
|
-
//
|
148
|
-
// invalid glob pattern. fails on bash4 and bsdglob.
|
149
|
-
// however, in this implementation, it's easier just
|
150
|
-
// to do the intuitive thing, and let brace-expansion
|
151
|
-
// actually come before parsing any extglob patterns,
|
152
|
-
// like the documentation seems to say.
|
153
|
-
//
|
154
|
-
// XXX: if anyone complains about this, either fix it
|
155
|
-
// or tell them to grow up and stop complaining.
|
156
|
-
//
|
157
|
-
// bash/bsdglob says this:
|
158
|
-
// , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]]
|
159
|
-
// but we do this instead:
|
160
|
-
, ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]]
|
161
|
-
|
162
|
-
// test partial parsing in the presence of comment/negation chars
|
163
|
-
, ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]]
|
164
|
-
, ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]]
|
165
|
-
|
166
|
-
// like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped.
|
167
|
-
, ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g"
|
168
|
-
, ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"]
|
169
|
-
, {}
|
170
|
-
, ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]]
|
171
|
-
|
172
|
-
|
173
|
-
// crazy nested {,,} and *(||) tests.
|
174
|
-
, function () {
|
175
|
-
files = [ "a", "b", "c", "d"
|
176
|
-
, "ab", "ac", "ad"
|
177
|
-
, "bc", "cb"
|
178
|
-
, "bc,d", "c,db", "c,d"
|
179
|
-
, "d)", "(b|c", "*(b|c"
|
180
|
-
, "b|c", "b|cc", "cb|c"
|
181
|
-
, "x(a|b|c)", "x(a|c)"
|
182
|
-
, "(a|b|c)", "(a|c)"]
|
183
|
-
}
|
184
|
-
, ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]]
|
185
|
-
, ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]]
|
186
|
-
// a
|
187
|
-
// *(b|c)
|
188
|
-
// *(b|d)
|
189
|
-
, ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]]
|
190
|
-
, ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]]
|
191
|
-
|
192
|
-
|
193
|
-
// test various flag settings.
|
194
|
-
, [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"]
|
195
|
-
, { noext: true } ]
|
196
|
-
, ["a?b", ["x/y/acb", "acb/"], {matchBase: true}
|
197
|
-
, ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ]
|
198
|
-
, ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]]
|
199
|
-
|
200
|
-
|
201
|
-
// begin channelling Boole and deMorgan...
|
202
|
-
, "negation tests"
|
203
|
-
, function () {
|
204
|
-
files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"]
|
205
|
-
}
|
206
|
-
|
207
|
-
// anything that is NOT a* matches.
|
208
|
-
, ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]]
|
209
|
-
|
210
|
-
// anything that IS !a* matches.
|
211
|
-
, ["!a*", ["!ab", "!abc"], {nonegate: true}]
|
212
|
-
|
213
|
-
// anything that IS a* matches
|
214
|
-
, ["!!a*", ["a!b"]]
|
215
|
-
|
216
|
-
// anything that is NOT !a* matches
|
217
|
-
, ["!\\!a*", ["a!b", "d", "e", "\\!a"]]
|
218
|
-
|
219
|
-
// negation nestled within a pattern
|
220
|
-
, function () {
|
221
|
-
files = [ "foo.js"
|
222
|
-
, "foo.bar"
|
223
|
-
// can't match this one without negative lookbehind.
|
224
|
-
, "foo.js.js"
|
225
|
-
, "blar.js"
|
226
|
-
, "foo."
|
227
|
-
, "boo.js.boo" ]
|
228
|
-
}
|
229
|
-
, ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ]
|
230
|
-
|
231
|
-
// https://github.com/isaacs/minimatch/issues/5
|
232
|
-
, function () {
|
233
|
-
files = [ 'a/b/.x/c'
|
234
|
-
, 'a/b/.x/c/d'
|
235
|
-
, 'a/b/.x/c/d/e'
|
236
|
-
, 'a/b/.x'
|
237
|
-
, 'a/b/.x/'
|
238
|
-
, 'a/.x/b'
|
239
|
-
, '.x'
|
240
|
-
, '.x/'
|
241
|
-
, '.x/a'
|
242
|
-
, '.x/a/b'
|
243
|
-
, 'a/.x/b/.x/c'
|
244
|
-
, '.x/.x' ]
|
245
|
-
}
|
246
|
-
, ["**/.x/**", [ '.x/'
|
247
|
-
, '.x/a'
|
248
|
-
, '.x/a/b'
|
249
|
-
, 'a/.x/b'
|
250
|
-
, 'a/b/.x/'
|
251
|
-
, 'a/b/.x/c'
|
252
|
-
, 'a/b/.x/c/d'
|
253
|
-
, 'a/b/.x/c/d/e' ] ]
|
254
|
-
|
255
|
-
]
|
256
|
-
|
257
|
-
var regexps =
|
258
|
-
[ '/^(?:(?=.)a[^/]*?)$/',
|
259
|
-
'/^(?:(?=.)X[^/]*?)$/',
|
260
|
-
'/^(?:(?=.)X[^/]*?)$/',
|
261
|
-
'/^(?:\\*)$/',
|
262
|
-
'/^(?:(?=.)\\*[^/]*?)$/',
|
263
|
-
'/^(?:\\*\\*)$/',
|
264
|
-
'/^(?:(?=.)b[^/]*?\\/)$/',
|
265
|
-
'/^(?:(?=.)c[^/]*?)$/',
|
266
|
-
'/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/',
|
267
|
-
'/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/',
|
268
|
-
'/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/',
|
269
|
-
'/^(?:\\/\\^root:\\/\\{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d\\))$/',
|
340
|
-
'/^(?:a|(?!\\.)(?=.)(?:b|c)*|(?!\\.)(?=.)(?:b|d)*)$/',
|
341
|
-
'/^(?:(?!\\.)(?=.)(?:a|b|c)*|(?!\\.)(?=.)(?:a|c)*)$/',
|
342
|
-
'/^(?:(?!\\.)(?=.)[^/]*?\\(a\\|b\\|c\\)|(?!\\.)(?=.)[^/]*?\\(a\\|c\\))$/',
|
343
|
-
'/^(?:(?=.)a[^/]b)$/',
|
344
|
-
'/^(?:(?=.)#[^/]*?)$/',
|
345
|
-
'/^(?!^(?:(?=.)a[^/]*?)$).*$/',
|
346
|
-
'/^(?:(?=.)\\!a[^/]*?)$/',
|
347
|
-
'/^(?:(?=.)a[^/]*?)$/',
|
348
|
-
'/^(?!^(?:(?=.)\\!a[^/]*?)$).*$/',
|
349
|
-
'/^(?:(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/',
|
350
|
-
'/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ]
|
351
|
-
var re = 0;
|
352
|
-
|
353
|
-
tap.test("basic tests", function (t) {
|
354
|
-
var start = Date.now()
|
355
|
-
|
356
|
-
// [ pattern, [matches], MM opts, files, TAP opts]
|
357
|
-
patterns.forEach(function (c) {
|
358
|
-
if (typeof c === "function") return c()
|
359
|
-
if (typeof c === "string") return t.comment(c)
|
360
|
-
|
361
|
-
var pattern = c[0]
|
362
|
-
, expect = c[1].sort(alpha)
|
363
|
-
, options = c[2] || {}
|
364
|
-
, f = c[3] || files
|
365
|
-
, tapOpts = c[4] || {}
|
366
|
-
|
367
|
-
// options.debug = true
|
368
|
-
var m = new mm.Minimatch(pattern, options)
|
369
|
-
var r = m.makeRe()
|
370
|
-
var expectRe = regexps[re++]
|
371
|
-
tapOpts.re = String(r) || JSON.stringify(r)
|
372
|
-
tapOpts.files = JSON.stringify(f)
|
373
|
-
tapOpts.pattern = pattern
|
374
|
-
tapOpts.set = m.set
|
375
|
-
tapOpts.negated = m.negate
|
376
|
-
|
377
|
-
var actual = mm.match(f, pattern, options)
|
378
|
-
actual.sort(alpha)
|
379
|
-
|
380
|
-
t.equivalent( actual, expect
|
381
|
-
, JSON.stringify(pattern) + " " + JSON.stringify(expect)
|
382
|
-
, tapOpts )
|
383
|
-
|
384
|
-
t.equal(tapOpts.re, expectRe, null, tapOpts)
|
385
|
-
})
|
386
|
-
|
387
|
-
t.comment("time=" + (Date.now() - start) + "ms")
|
388
|
-
t.end()
|
389
|
-
})
|
390
|
-
|
391
|
-
tap.test("global leak test", function (t) {
|
392
|
-
var globalAfter = Object.keys(global)
|
393
|
-
t.equivalent(globalAfter, globalBefore, "no new globals, please")
|
394
|
-
t.end()
|
395
|
-
})
|
396
|
-
|
397
|
-
function alpha (a, b) {
|
398
|
-
return a > b ? 1 : -1
|
399
|
-
}
|