traceur-rb 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +2 -2
- data/lib/js/compile.js +7 -15
- data/lib/traceur.rb +2 -1
- data/lib/traceur/compilation_error.rb +27 -0
- data/lib/traceur/compiler.rb +4 -1
- data/lib/traceur/configuration.rb +1 -1
- data/lib/traceur/node/runner.rb +1 -1
- data/lib/traceur/version.rb +1 -1
- data/spec/examples/syntax_error.js +3 -0
- data/spec/integration/examples_spec.rb +6 -0
- data/vendor/node_modules/traceur/LICENSE +202 -0
- data/vendor/node_modules/traceur/README.md +5 -5
- data/vendor/node_modules/traceur/bin/traceur-runtime.js +1392 -623
- data/vendor/node_modules/traceur/bin/traceur.js +24749 -17990
- data/vendor/node_modules/traceur/node_modules/.bin/semver +2 -2
- data/vendor/node_modules/traceur/node_modules/commander/History.md +222 -0
- data/vendor/node_modules/traceur/node_modules/commander/Readme.md +127 -35
- data/vendor/node_modules/traceur/node_modules/commander/index.js +261 -93
- data/vendor/node_modules/traceur/node_modules/commander/package.json +41 -9
- data/vendor/node_modules/traceur/node_modules/glob/LICENSE +15 -0
- data/vendor/node_modules/traceur/node_modules/glob/README.md +357 -0
- data/vendor/node_modules/traceur/node_modules/glob/common.js +177 -0
- data/vendor/node_modules/traceur/node_modules/glob/glob.js +649 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/.eslintrc +17 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/LICENSE +15 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/README.md +37 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/inflight.js +44 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE +15 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md +36 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +34 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +51 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js +33 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/package.json +61 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inflight/test.js +97 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/LICENSE +16 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/README.md +42 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/inherits.js +1 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/package.json +33 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/inherits/test.js +25 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/.npmignore +1 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/.travis.yml +4 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/LICENSE +23 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/README.md +216 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/benchmark.js +15 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/browser.js +1181 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/minimatch.js +845 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +2 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +3 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +121 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +8 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +191 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +2 -0
- data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/collections → glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match}/.travis.yml +0 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +6 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +80 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +5 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +38 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +73 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +56 -0
- data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/url2 → glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map}/.travis.yml +1 -1
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +18 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +62 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +6 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +13 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +83 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +39 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +75 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +32 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +1075 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +182 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +9 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +10 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +24 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +15 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +16 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +10 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +13 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +7 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +50 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/package.json +60 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/basic.js +399 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/brace-expand.js +45 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/defaults.js +274 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/LICENSE +27 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/README.md +51 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +15 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +36 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +34 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +51 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +33 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/once.js +21 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/package.json +42 -0
- data/vendor/node_modules/traceur/node_modules/glob/node_modules/once/test/once.js +23 -0
- data/vendor/node_modules/traceur/node_modules/glob/package.json +72 -0
- data/vendor/node_modules/traceur/node_modules/glob/sync.js +409 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/.release.json +17 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/CHANGELOG.md +165 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/README.md +364 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/dist/rsvp.js +1671 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/dist/rsvp.min.js +9 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp.js +66 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp.umd.js +50 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/-internal.js +265 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/all-settled.js +71 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/all.js +15 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/asap.js +109 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/config.js +28 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/defer.js +45 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/enumerator.js +125 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/events.js +201 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/filter.js +120 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/hash-settled.js +124 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/hash.js +94 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/instrument.js +41 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/map.js +99 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/node.js +281 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise-hash.js +51 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise.js +496 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/all.js +52 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/race.js +105 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/reject.js +47 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/promise/resolve.js +49 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/race.js +15 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/reject.js +16 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/resolve.js +17 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/rethrow.js +46 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/lib/rsvp/utils.js +39 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/package.json +100 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/README.md +9 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/bower.json +22 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/composer.json +18 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/package.json +52 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.amd.js +1607 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.js +1566 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/rsvp.js/rsvp.min.js +26 -0
- data/vendor/node_modules/traceur/node_modules/rsvp/vertx.js +1 -0
- data/vendor/node_modules/traceur/node_modules/semver/bin/semver +2 -2
- data/vendor/node_modules/traceur/node_modules/semver/package.json +4 -3
- data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js +7 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js.gz +0 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.js +7 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.min.js +1 -1
- data/vendor/node_modules/traceur/node_modules/semver/semver.min.js.gz +0 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/index.js +8 -4
- data/vendor/node_modules/traceur/node_modules/semver/test/ltr.js +2 -1
- data/vendor/node_modules/traceur/node_modules/source-map-support/.npmignore +1 -0
- data/vendor/node_modules/traceur/node_modules/{q-io/node_modules/mime/LICENSE → source-map-support/LICENSE.md} +7 -5
- data/vendor/node_modules/traceur/node_modules/source-map-support/README.md +165 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/browser-source-map-support.js +89 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/index.html +6 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/require.js +36 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.coffee +13 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.js +24 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/amd-test/script.map +10 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/browser-source-map-support.js +89 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/index.html +6 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.coffee +12 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.js +25 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/browser-test/script.map +10 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/build.js +69 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/index.html +6 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.coffee +12 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.js +25 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/script.map +10 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/header-test/server.js +45 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/.npmignore +2 -0
- data/vendor/node_modules/traceur/node_modules/{q-io → source-map-support/node_modules/source-map}/.travis.yml +1 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/CHANGELOG.md +121 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/LICENSE +28 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/Makefile.dryice.js +166 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/README.md +434 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/assert-shim.js +56 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/mini-require.js +152 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/prefix-source-map.jsm +20 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/prefix-utils.jsm +18 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-browser.js +8 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-source-map.jsm +6 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/suffix-utils.jsm +21 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/test-prefix.js +8 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/build/test-suffix.js +3 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map.js +8 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/array-set.js +97 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/base64.js +42 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/binary-search.js +81 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-consumer.js +478 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-generator.js +380 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-node.js +371 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/lib/source-map/util.js +205 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/README.md +171 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/intercept.js +36 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/node_modules/amdefine/package.json +37 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/package.json +142 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/run-tests.js +62 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-api.js +26 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-array-set.js +104 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-base64.js +35 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-dog-fooding.js +72 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-map-consumer.js +451 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-map-generator.js +417 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/test-source-node.js +365 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/node_modules/source-map/test/source-map/util.js +161 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/package.json +52 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/source-map-support.js +381 -0
- data/vendor/node_modules/traceur/node_modules/source-map-support/test.js +359 -0
- data/vendor/node_modules/traceur/package.json +234 -20
- data/vendor/node_modules/traceur/src/node/NodeCompiler.js +78 -0
- data/vendor/node_modules/traceur/src/node/System.js +32 -5
- data/vendor/node_modules/traceur/src/node/api.js +28 -93
- data/vendor/node_modules/traceur/src/node/command.js +84 -19
- data/vendor/node_modules/traceur/src/node/compileAllJsFilesInDir.js +40 -0
- data/vendor/node_modules/traceur/src/node/interpreter.js +11 -8
- data/vendor/node_modules/traceur/src/node/recursiveModuleCompile.js +171 -0
- data/vendor/node_modules/traceur/src/node/require.js +7 -21
- data/vendor/node_modules/traceur/src/node/to-amd-compiler.js +2 -7
- data/vendor/node_modules/traceur/src/node/to-closure-compiler.js +28 -0
- data/vendor/node_modules/traceur/src/node/to-commonjs-compiler.js +3 -7
- data/vendor/node_modules/traceur/src/node/traceur.js +1 -1
- metadata +196 -190
- data/vendor/node_modules/traceur/node_modules/q-io/.npmignore +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/CHANGES.md +0 -122
- data/vendor/node_modules/traceur/node_modules/q-io/LICENSE +0 -19
- data/vendor/node_modules/traceur/node_modules/q-io/README.md +0 -928
- data/vendor/node_modules/traceur/node_modules/q-io/buffer-stream.js +0 -59
- data/vendor/node_modules/traceur/node_modules/q-io/coverage-report.js +0 -44
- data/vendor/node_modules/traceur/node_modules/q-io/deprecate.js +0 -51
- data/vendor/node_modules/traceur/node_modules/q-io/fs-boot.js +0 -307
- data/vendor/node_modules/traceur/node_modules/q-io/fs-common.js +0 -499
- data/vendor/node_modules/traceur/node_modules/q-io/fs-mock.js +0 -547
- data/vendor/node_modules/traceur/node_modules/q-io/fs-root.js +0 -105
- data/vendor/node_modules/traceur/node_modules/q-io/fs.js +0 -355
- data/vendor/node_modules/traceur/node_modules/q-io/fs2http.js +0 -65
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps.js +0 -152
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/chain.js +0 -24
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/content.js +0 -93
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/cookie.js +0 -154
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/decorators.js +0 -178
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/fs.js +0 -417
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/html.js +0 -58
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/json.js +0 -78
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/negotiate.js +0 -120
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/proxy.js +0 -27
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/redirect.js +0 -209
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/route.js +0 -125
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/status.js +0 -175
- data/vendor/node_modules/traceur/node_modules/q-io/http-cookie.js +0 -75
- data/vendor/node_modules/traceur/node_modules/q-io/http.js +0 -378
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.npmignore +0 -11
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/CHANGES.md +0 -78
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/LICENSE.md +0 -21
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/README.md +0 -1285
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/collections.js +0 -22
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/dict.js +0 -142
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-map.js +0 -57
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-set.js +0 -183
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-collection.js +0 -261
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-map.js +0 -186
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-order.js +0 -55
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-set.js +0 -59
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/heap.js +0 -236
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/iterator.js +0 -371
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/list.js +0 -435
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/array-changes.js +0 -247
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/map-changes.js +0 -147
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/property-changes.js +0 -448
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/range-changes.js +0 -139
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-map.js +0 -79
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-set.js +0 -142
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/map.js +0 -60
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/multi-map.js +0 -41
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/package.json +0 -12
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync +0 -7
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync.patch +0 -48
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/weak-map.js +0 -590
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/package.json +0 -49
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/set.js +0 -173
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-array.js +0 -274
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-function.js +0 -59
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-object.js +0 -538
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-regexp.js +0 -14
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim.js +0 -6
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-map.js +0 -49
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-set.js +0 -51
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array.js +0 -269
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-map.js +0 -61
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-set.js +0 -736
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/tree-log.js +0 -40
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/weak-map.js +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/README.md +0 -66
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/mime.js +0 -114
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/package.json +0 -35
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/test.js +0 -84
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/mime.types +0 -1588
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/node.types +0 -77
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/CHANGES +0 -15
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/LICENSE +0 -19
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/README +0 -96
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/lib/mimeparse.js +0 -166
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/package.json +0 -43
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/CONTRIBUTING.md +0 -40
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/LICENSE +0 -19
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/README.md +0 -813
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/compare-with-callbacks.js +0 -71
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/scenarios.js +0 -36
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/package.json +0 -93
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/q.js +0 -1937
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/queue.js +0 -35
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/.gitmodules +0 -6
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/History.md +0 -36
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Makefile +0 -7
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Readme.md +0 -38
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/benchmark.js +0 -32
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/examples.js +0 -39
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/index.js +0 -2
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/lib/querystring.js +0 -123
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/package.json +0 -19
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.gitmodules +0 -3
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.npmignore +0 -3
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/History.md +0 -128
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Makefile +0 -53
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Readme.md +0 -61
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/bin/expresso +0 -856
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/api.html +0 -1080
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.html +0 -377
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.md +0 -290
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/foot.html +0 -3
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/head.html +0 -42
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/bar.js +0 -4
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/foo.js +0 -16
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/package.json +0 -12
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/assert.test.js +0 -91
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/async.test.js +0 -12
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/bar.test.js +0 -13
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/foo.test.js +0 -14
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/http.test.js +0 -146
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/async.test.js +0 -39
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/http.test.js +0 -48
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/.gitmodules +0 -3
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/History.md +0 -22
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Makefile +0 -6
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Readme.md +0 -248
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/examples/runner.js +0 -53
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/index.js +0 -2
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/eql.js +0 -91
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/should.js +0 -548
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/package.json +0 -8
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/test/should.test.js +0 -358
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/test/querystring.test.js +0 -133
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.npmignore +0 -3
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/LICENSE.md +0 -20
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/README.md +0 -33
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/package.json +0 -37
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/test/url2-spec.js +0 -125
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/url2.js +0 -151
- data/vendor/node_modules/traceur/node_modules/q-io/package.json +0 -51
- data/vendor/node_modules/traceur/node_modules/q-io/reader.js +0 -133
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/boot-directory-spec.js +0 -47
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/contains-spec.js +0 -11
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/fixtures/hello.txt +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/issues/1-spec.js +0 -33
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/make-tree-spec.js +0 -92
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/append-spec.js +0 -41
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/copy-tree-spec.js +0 -57
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/fixture/hello.txt +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/link-spec.js +0 -70
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/make-tree-spec.js +0 -109
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/merge-spec.js +0 -67
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/move-spec.js +0 -219
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/object-spec.js +0 -20
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/range-spec.js +0 -26
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/read-spec.js +0 -40
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-directory-spec.js +0 -37
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-tree-spec.js +0 -39
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/root-spec.js +0 -32
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/stat-spec.js +0 -26
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/symbolic-link-spec.js +0 -86
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/working-directory-spec.js +0 -31
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/write-spec.js +0 -73
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.js +0 -23
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.txt +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/read-spec.js +0 -22
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/relative-spec.js +0 -25
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/reroot-spec.js +0 -45
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/write-spec.js +0 -38
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/cookie-spec.js +0 -52
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/directory-list-spec.js +0 -86
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/01234.txt +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/1234.txt +0 -1
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/5678.txt +0 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/9012/3456.txt +0 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/hosts-spec.js +0 -49
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/interpret-range-spec.js +0 -47
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/partial-range-spec.js +0 -186
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/proxy-spec.js +0 -82
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/symbolic-link-spec.js +0 -110
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http/agent-spec.js +0 -96
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http/basic-spec.js +0 -96
- data/vendor/node_modules/traceur/node_modules/q-io/spec/lib/jasmine-promise.js +0 -42
- data/vendor/node_modules/traceur/node_modules/q-io/writer.js +0 -111
- data/vendor/node_modules/traceur/src/node/compile-single-file.js +0 -69
- data/vendor/node_modules/traceur/src/node/compiler.js +0 -116
- data/vendor/node_modules/traceur/src/node/inline-module.js +0 -149
@@ -0,0 +1,9 @@
|
|
1
|
+
/*!
|
2
|
+
* @overview RSVP - a tiny implementation of Promises/A+.
|
3
|
+
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors
|
4
|
+
* @license Licensed under MIT license
|
5
|
+
* See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE
|
6
|
+
* @version 3.0.16
|
7
|
+
*/
|
8
|
+
|
9
|
+
(function(){"use strict";function t(t,n){for(var r=0,e=t.length;e>r;r++)if(t[r]===n)return r;return-1}function n(t){var n=t._promiseCallbacks;return (n||(n=t._promiseCallbacks={}), n)}function r(t,n){return"onerror"===t?void mn.on("error",n):2!==arguments.length?mn[t]:void(mn[t]=n)}function e(t){return"function"==typeof t||"object"==typeof t&&null!==t}function o(t){return"function"==typeof t}function i(t){return"object"==typeof t&&null!==t}function u(){}function s(){setTimeout(function(){for(var t,n=0;n<An.length;n++){t=An[n];var r=t.payload;r.guid=r.key+r.id,r.childGuid=r.key+r.childId,r.error&&(r.stack=r.error.stack),mn.trigger(t.name,t.payload)}An.length=0},50)}function a(t,n,r){1===An.push({name:t,payload:{key:n._guidKey,id:n._id,eventName:t,detail:n._result,childId:r&&r._id,label:n._label,timeStamp:bn(),error:mn["instrument-with-stack"]?new Error(n._label):null}})&&s()}function c(){return new TypeError("A promises callback cannot return that same promise.")}function f(){}function l(t){try{return t.then}catch(n){return (Cn.error = n, Cn)}}function h(t,n,r,e){try{t.call(n,r,e)}catch(o){return o}}function p(t,n,r){mn.async(function(t){var e=!1,o=h(r,n,function(r){e||(e=!0,n!==r?d(t,r):m(t,r))},function(n){e||(e=!0,w(t,n))},"Settle: "+(t._label||" unknown promise"));!e&&o&&(e=!0,w(t,o))},t)}function _(t,n){n._state===kn?m(t,n._result):n._state===Sn?(n._onError=null,w(t,n._result)):g(n,void 0,function(r){n!==r?d(t,r):m(t,r)},function(n){w(t,n)})}function v(t,n){if(n.constructor===t.constructor)_(t,n);else{var r=l(n);r===Cn?w(t,Cn.error):void 0===r?m(t,n):o(r)?p(t,n,r):m(t,n)}}function d(t,n){t===n?m(t,n):e(n)?v(t,n):m(t,n)}function y(t){t._onError&&t._onError(t._result),b(t)}function m(t,n){t._state===Tn&&(t._result=n,t._state=kn,0===t._subscribers.length?mn.instrument&&jn("fulfilled",t):mn.async(b,t))}function w(t,n){t._state===Tn&&(t._state=Sn,t._result=n,mn.async(y,t))}function g(t,n,r,e){var o=t._subscribers,i=o.length;t._onError=null,o[i]=n,o[i+kn]=r,o[i+Sn]=e,0===i&&t._state&&mn.async(b,t)}function b(t){var n=t._subscribers,r=t._state;if(mn.instrument&&jn(r===kn?"fulfilled":"rejected",t),0!==n.length){for(var e,o,i=t._result,u=0;u<n.length;u+=3)e=n[u],o=n[u+r],e?j(r,e,o,i):o(i);t._subscribers.length=0}}function E(){this.error=null}function A(t,n){try{return t(n)}catch(r){return (On.error = r, On)}}function j(t,n,r,e){var i,u,s,a,f=o(r);if(f){if(i=A(r,e),i===On?(a=!0,u=i.error,i=null):s=!0,n===i)return void w(n,c())}else i=e,s=!0;n._state!==Tn||(f&&s?d(n,i):a?w(n,u):t===kn?m(n,i):t===Sn&&w(n,i))}function T(t,n){var r=!1;try{n(function(n){r||(r=!0,d(t,n))},function(n){r||(r=!0,w(t,n))})}catch(e){w(t,e)}}function k(t,n,r){return t===kn?{state:"fulfilled",value:r}:{state:"rejected",reason:r}}function S(t,n,r,e){this._instanceConstructor=t,this.promise=new t(f,e),this._abortOnReject=r,this._validateInput(n)?(this._input=n,this.length=n.length,this._remaining=n.length,this._init(),0===this.length?m(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&m(this.promise,this._result))):w(this.promise,this._validationError())}function C(t,n){return new In(this,t,!0,n).promise}function O(t,n){function r(t){d(i,t)}function e(t){w(i,t)}var o=this,i=new o(f,n);if(!gn(t))return (w(i,new TypeError("You must pass an array to race.")), i);for(var u=t.length,s=0;i._state===Tn&&u>s;s++)g(o.resolve(t[s]),void 0,r,e);return i}function I(t,n){var r=this;if(t&&"object"==typeof t&&t.constructor===r)return t;var e=new r(f,n);return (d(e,t), e)}function R(t,n){var r=this,e=new r(f,n);return (w(e,t), e)}function x(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function M(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function N(t,n){this._id=Yn++,this._label=n,this._state=void 0,this._result=void 0,this._subscribers=[],mn.instrument&&jn("created",this),f!==t&&(o(t)||x(),this instanceof N||M(),T(this,t))}function P(){this.value=void 0}function Y(t){try{return t.then}catch(n){return (Kn.value = n, Kn)}}function D(t,n,r){try{t.apply(n,r)}catch(e){return (Kn.value = e, Kn)}}function K(t,n){for(var r,e,o={},i=t.length,u=new Array(i),s=0;i>s;s++)u[s]=t[s];for(e=0;e<n.length;e++)r=n[e],o[r]=u[e+1];return o}function U(t){for(var n=t.length,r=new Array(n-1),e=1;n>e;e++)r[e-1]=t[e];return r}function q(t,n){return{then:function(r,e){return t.call(n,r,e)}}}function F(t,n){var r=function(){for(var r,e=this,o=arguments.length,i=new Array(o+1),u=!1,s=0;o>s;++s){if(r=arguments[s],!u){if(u=V(r),u===Un){var a=new Dn(f);return (w(a,Un.value), a)}u&&u!==!0&&(r=q(u,r))}i[s]=r}var c=new Dn(f);return (i[o]=function(t,r){t?w(c,t):void 0===n?d(c,r):n===!0?d(c,U(arguments)):gn(n)?d(c,K(arguments,n)):d(c,r)}, u?L(c,i,t,e):G(c,i,t,e))};return (r.__proto__=t, r)}function G(t,n,r,e){var o=D(r,e,n);return (o===Kn&&w(t,o.value), t)}function L(t,n,r,e){return Dn.all(n).then(function(n){var o=D(r,e,n);return (o===Kn&&w(t,o.value), t)})}function V(t){return t&&"object"==typeof t?t.constructor===Dn?!0:Y(t):!1}function W(t,n){return Dn.all(t,n)}function $(t,n,r){this._superConstructor(t,n,!1,r)}function z(t,n){return new $(Dn,t,n).promise}function B(t,n){return Dn.race(t,n)}function H(t,n,r){this._superConstructor(t,n,!0,r)}function J(t,n){return new Vn(Dn,t,n).promise}function Q(t,n,r){this._superConstructor(t,n,!1,r)}function X(t,n){return new Q(Dn,t,n).promise}function Z(t){throw (setTimeout(function(){throw t}), t)}function tn(t){var n={};return (n.promise=new Dn(function(t,r){n.resolve=t,n.reject=r},t), n)}function nn(t,n,r){return Dn.all(t,r).then(function(t){if(!o(n))throw new TypeError("You must pass a function as map's second argument.");for(var e=t.length,i=new Array(e),u=0;e>u;u++)i[u]=n(t[u]);return Dn.all(i,r)})}function rn(t,n){return Dn.resolve(t,n)}function en(t,n){return Dn.reject(t,n)}function on(t,n,r){return Dn.all(t,r).then(function(t){if(!o(n))throw new TypeError("You must pass a function as filter's second argument.");for(var e=t.length,i=new Array(e),u=0;e>u;u++)i[u]=n(t[u]);return Dn.all(i,r).then(function(n){for(var r=new Array(e),o=0,i=0;e>i;i++)n[i]&&(r[o]=t[i],o++);return (r.length=o, r)})})}function un(t,n){sr[tr]=t,sr[tr+1]=n,tr+=2,2===tr&&$n()}function sn(){var t=process.nextTick,n=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return (Array.isArray(n)&&"0"===n[1]&&"10"===n[2]&&(t=setImmediate), function(){t(hn)})}function an(){return function(){vertxNext(hn)}}function cn(){var t=0,n=new or(hn),r=document.createTextNode("");return (n.observe(r,{characterData:!0}), function(){r.data=t=++t%2})}function fn(){var t=new MessageChannel;return (t.port1.onmessage=hn, function(){t.port2.postMessage(0)})}function ln(){return function(){setTimeout(hn,1)}}function hn(){for(var t=0;tr>t;t+=2){var n=sr[t],r=sr[t+1];n(r),sr[t]=void 0,sr[t+1]=void 0}tr=0}function pn(){try{{var t=require("vertx");t.runOnLoop||t.runOnContext}return an()}catch(n){return ln()}}function _n(t,n){mn.async(t,n)}function vn(){mn.on.apply(mn,arguments)}function dn(){mn.off.apply(mn,arguments)}var yn={mixin:function(t){return (t.on=this.on, t.off=this.off, t.trigger=this.trigger, t._promiseCallbacks=void 0, t)},on:function(r,e){var o,i=n(this);o=i[r],o||(o=i[r]=[]),-1===t(o,e)&&o.push(e)},off:function(r,e){var o,i,u=n(this);return e?(o=u[r],i=t(o,e),void(-1!==i&&o.splice(i,1))):void(u[r]=[])},trigger:function(t,r){var e,o,i=n(this);if(e=i[t])for(var u=0;u<e.length;u++)(o=e[u])(r)}},mn={instrument:!1};yn.mixin(mn);var wn;wn=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var gn=wn,bn=Date.now||function(){return(new Date).getTime()},En=Object.create||function(t){if(arguments.length>1)throw new Error("Second argument not supported");if("object"!=typeof t)throw new TypeError("Argument must be an object");return (u.prototype=t, new u)},An=[],jn=a,Tn=void 0,kn=1,Sn=2,Cn=new E,On=new E,In=S;S.prototype._validateInput=function(t){return gn(t)},S.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},S.prototype._init=function(){this._result=new Array(this.length)},S.prototype._enumerate=function(){for(var t=this.length,n=this.promise,r=this._input,e=0;n._state===Tn&&t>e;e++)this._eachEntry(r[e],e)},S.prototype._eachEntry=function(t,n){var r=this._instanceConstructor;i(t)?t.constructor===r&&t._state!==Tn?(t._onError=null,this._settledAt(t._state,n,t._result)):this._willSettleAt(r.resolve(t),n):(this._remaining--,this._result[n]=this._makeResult(kn,n,t))},S.prototype._settledAt=function(t,n,r){var e=this.promise;e._state===Tn&&(this._remaining--,this._abortOnReject&&t===Sn?w(e,r):this._result[n]=this._makeResult(t,n,r)),0===this._remaining&&m(e,this._result)},S.prototype._makeResult=function(t,n,r){return r},S.prototype._willSettleAt=function(t,n){var r=this;g(t,void 0,function(t){r._settledAt(kn,n,t)},function(t){r._settledAt(Sn,n,t)})};var Rn=C,xn=O,Mn=I,Nn=R,Pn="rsvp_"+bn()+"-",Yn=0,Dn=N;N.cast=Mn,N.all=Rn,N.race=xn,N.resolve=Mn,N.reject=Nn,N.prototype={constructor:N,_guidKey:Pn,_onError:function(t){mn.async(function(n){setTimeout(function(){n._onError&&mn.trigger("error",t)},0)},this)},then:function(t,n,r){var e=this,o=e._state;if(o===kn&&!t||o===Sn&&!n)return (mn.instrument&&jn("chained",this,this), this);e._onError=null;var i=new this.constructor(f,r),u=e._result;if(mn.instrument&&jn("chained",e,i),o){var s=arguments[o-1];mn.async(function(){j(o,i,s,u)})}else g(e,i,t,n);return i},"catch":function(t,n){return this.then(null,t,n)},"finally":function(t,n){var r=this.constructor;return this.then(function(n){return r.resolve(t()).then(function(){return n})},function(n){return r.resolve(t()).then(function(){throw n})},n)}};var Kn=new P,Un=new P,qn=F,Fn=W;$.prototype=En(In.prototype),$.prototype._superConstructor=In,$.prototype._makeResult=k,$.prototype._validationError=function(){return new Error("allSettled must be called with an array")};var Gn=z,Ln=B,Vn=H;H.prototype=En(In.prototype),H.prototype._superConstructor=In,H.prototype._init=function(){this._result={}},H.prototype._validateInput=function(t){return t&&"object"==typeof t},H.prototype._validationError=function(){return new Error("Promise.hash must be called with an object")},H.prototype._enumerate=function(){var t=this.promise,n=this._input,r=[];for(var e in n)t._state===Tn&&n.hasOwnProperty(e)&&r.push({position:e,entry:n[e]});var o=r.length;this._remaining=o;for(var i,u=0;t._state===Tn&&o>u;u++)i=r[u],this._eachEntry(i.entry,i.position)};var Wn=J;Q.prototype=En(Vn.prototype),Q.prototype._superConstructor=In,Q.prototype._makeResult=k,Q.prototype._validationError=function(){return new Error("hashSettled must be called with an object")};var $n,zn=X,Bn=Z,Hn=tn,Jn=nn,Qn=rn,Xn=en,Zn=on,tr=0,nr=un,rr="undefined"!=typeof window?window:void 0,er=rr||{},or=er.MutationObserver||er.WebKitMutationObserver,ir="undefined"!=typeof process&&"[object process]"==={}.toString.call(process),ur="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,sr=new Array(1e3);$n=ir?sn():or?cn():ur?fn():void 0===rr&&"function"==typeof require?pn():ln(),mn.async=nr;if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){var ar=window.__PROMISE_INSTRUMENTATION__;r("instrument",!0);for(var cr in ar)ar.hasOwnProperty(cr)&&vn(cr,ar[cr])}var fr={race:Ln,Promise:Dn,allSettled:Gn,hash:Wn,hashSettled:zn,denodeify:qn,on:vn,off:dn,map:Jn,filter:Zn,resolve:Qn,reject:Xn,all:Fn,rethrow:Bn,defer:Hn,EventTarget:yn,configure:r,async:_n};"function"==typeof define&&define.amd?define(function(){return fr}):"undefined"!=typeof module&&module.exports?module.exports=fr:"undefined"!=typeof this&&(this.RSVP=fr)}).call(this);
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import Promise from './rsvp/promise';
|
2
|
+
import EventTarget from './rsvp/events';
|
3
|
+
import denodeify from './rsvp/node';
|
4
|
+
import all from './rsvp/all';
|
5
|
+
import allSettled from './rsvp/all-settled';
|
6
|
+
import race from './rsvp/race';
|
7
|
+
import hash from './rsvp/hash';
|
8
|
+
import hashSettled from './rsvp/hash-settled';
|
9
|
+
import rethrow from './rsvp/rethrow';
|
10
|
+
import defer from './rsvp/defer';
|
11
|
+
import {
|
12
|
+
config,
|
13
|
+
configure
|
14
|
+
} from './rsvp/config';
|
15
|
+
import map from './rsvp/map';
|
16
|
+
import resolve from './rsvp/resolve';
|
17
|
+
import reject from './rsvp/reject';
|
18
|
+
import filter from './rsvp/filter';
|
19
|
+
import asap from './rsvp/asap';
|
20
|
+
|
21
|
+
config.async = asap; // default async is asap;
|
22
|
+
var cast = resolve;
|
23
|
+
function async(callback, arg) {
|
24
|
+
config.async(callback, arg);
|
25
|
+
}
|
26
|
+
|
27
|
+
function on() {
|
28
|
+
config['on'].apply(config, arguments);
|
29
|
+
}
|
30
|
+
|
31
|
+
function off() {
|
32
|
+
config['off'].apply(config, arguments);
|
33
|
+
}
|
34
|
+
|
35
|
+
// Set up instrumentation through `window.__PROMISE_INTRUMENTATION__`
|
36
|
+
if (typeof window !== 'undefined' && typeof window['__PROMISE_INSTRUMENTATION__'] === 'object') {
|
37
|
+
var callbacks = window['__PROMISE_INSTRUMENTATION__'];
|
38
|
+
configure('instrument', true);
|
39
|
+
for (var eventName in callbacks) {
|
40
|
+
if (callbacks.hasOwnProperty(eventName)) {
|
41
|
+
on(eventName, callbacks[eventName]);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
export {
|
47
|
+
cast,
|
48
|
+
Promise,
|
49
|
+
EventTarget,
|
50
|
+
all,
|
51
|
+
allSettled,
|
52
|
+
race,
|
53
|
+
hash,
|
54
|
+
hashSettled,
|
55
|
+
rethrow,
|
56
|
+
defer,
|
57
|
+
denodeify,
|
58
|
+
configure,
|
59
|
+
on,
|
60
|
+
off,
|
61
|
+
resolve,
|
62
|
+
reject,
|
63
|
+
async,
|
64
|
+
map,
|
65
|
+
filter
|
66
|
+
};
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import {
|
2
|
+
Promise,
|
3
|
+
allSettled,
|
4
|
+
hash,
|
5
|
+
hashSettled,
|
6
|
+
denodeify,
|
7
|
+
on,
|
8
|
+
off,
|
9
|
+
map,
|
10
|
+
filter,
|
11
|
+
resolve,
|
12
|
+
reject,
|
13
|
+
rethrow,
|
14
|
+
all,
|
15
|
+
defer,
|
16
|
+
EventTarget,
|
17
|
+
configure,
|
18
|
+
race,
|
19
|
+
async
|
20
|
+
} from './rsvp';
|
21
|
+
|
22
|
+
var RSVP = {
|
23
|
+
'race': race,
|
24
|
+
'Promise': Promise,
|
25
|
+
'allSettled': allSettled,
|
26
|
+
'hash': hash,
|
27
|
+
'hashSettled': hashSettled,
|
28
|
+
'denodeify': denodeify,
|
29
|
+
'on': on,
|
30
|
+
'off': off,
|
31
|
+
'map': map,
|
32
|
+
'filter': filter,
|
33
|
+
'resolve': resolve,
|
34
|
+
'reject': reject,
|
35
|
+
'all': all,
|
36
|
+
'rethrow': rethrow,
|
37
|
+
'defer': defer,
|
38
|
+
'EventTarget': EventTarget,
|
39
|
+
'configure': configure,
|
40
|
+
'async': async
|
41
|
+
};
|
42
|
+
|
43
|
+
/* global define:true module:true window: true */
|
44
|
+
if (typeof define === 'function' && define['amd']) {
|
45
|
+
define(function() { return RSVP; });
|
46
|
+
} else if (typeof module !== 'undefined' && module['exports']) {
|
47
|
+
module['exports'] = RSVP;
|
48
|
+
} else if (typeof this !== 'undefined') {
|
49
|
+
this['RSVP'] = RSVP;
|
50
|
+
}
|
@@ -0,0 +1,265 @@
|
|
1
|
+
import {
|
2
|
+
objectOrFunction,
|
3
|
+
isFunction
|
4
|
+
} from './utils';
|
5
|
+
|
6
|
+
import instrument from './instrument';
|
7
|
+
|
8
|
+
import { config } from './config';
|
9
|
+
|
10
|
+
function withOwnPromise() {
|
11
|
+
return new TypeError('A promises callback cannot return that same promise.');
|
12
|
+
}
|
13
|
+
|
14
|
+
function noop() {}
|
15
|
+
|
16
|
+
var PENDING = void 0;
|
17
|
+
var FULFILLED = 1;
|
18
|
+
var REJECTED = 2;
|
19
|
+
|
20
|
+
var GET_THEN_ERROR = new ErrorObject();
|
21
|
+
|
22
|
+
function getThen(promise) {
|
23
|
+
try {
|
24
|
+
return promise.then;
|
25
|
+
} catch(error) {
|
26
|
+
GET_THEN_ERROR.error = error;
|
27
|
+
return GET_THEN_ERROR;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
function tryThen(then, value, fulfillmentHandler, rejectionHandler) {
|
32
|
+
try {
|
33
|
+
then.call(value, fulfillmentHandler, rejectionHandler);
|
34
|
+
} catch(e) {
|
35
|
+
return e;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
function handleForeignThenable(promise, thenable, then) {
|
40
|
+
config.async(function(promise) {
|
41
|
+
var sealed = false;
|
42
|
+
var error = tryThen(then, thenable, function(value) {
|
43
|
+
if (sealed) { return; }
|
44
|
+
sealed = true;
|
45
|
+
if (thenable !== value) {
|
46
|
+
resolve(promise, value);
|
47
|
+
} else {
|
48
|
+
fulfill(promise, value);
|
49
|
+
}
|
50
|
+
}, function(reason) {
|
51
|
+
if (sealed) { return; }
|
52
|
+
sealed = true;
|
53
|
+
|
54
|
+
reject(promise, reason);
|
55
|
+
}, 'Settle: ' + (promise._label || ' unknown promise'));
|
56
|
+
|
57
|
+
if (!sealed && error) {
|
58
|
+
sealed = true;
|
59
|
+
reject(promise, error);
|
60
|
+
}
|
61
|
+
}, promise);
|
62
|
+
}
|
63
|
+
|
64
|
+
function handleOwnThenable(promise, thenable) {
|
65
|
+
if (thenable._state === FULFILLED) {
|
66
|
+
fulfill(promise, thenable._result);
|
67
|
+
} else if (thenable._state === REJECTED) {
|
68
|
+
thenable._onError = null;
|
69
|
+
reject(promise, thenable._result);
|
70
|
+
} else {
|
71
|
+
subscribe(thenable, undefined, function(value) {
|
72
|
+
if (thenable !== value) {
|
73
|
+
resolve(promise, value);
|
74
|
+
} else {
|
75
|
+
fulfill(promise, value);
|
76
|
+
}
|
77
|
+
}, function(reason) {
|
78
|
+
reject(promise, reason);
|
79
|
+
});
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
function handleMaybeThenable(promise, maybeThenable) {
|
84
|
+
if (maybeThenable.constructor === promise.constructor) {
|
85
|
+
handleOwnThenable(promise, maybeThenable);
|
86
|
+
} else {
|
87
|
+
var then = getThen(maybeThenable);
|
88
|
+
|
89
|
+
if (then === GET_THEN_ERROR) {
|
90
|
+
reject(promise, GET_THEN_ERROR.error);
|
91
|
+
} else if (then === undefined) {
|
92
|
+
fulfill(promise, maybeThenable);
|
93
|
+
} else if (isFunction(then)) {
|
94
|
+
handleForeignThenable(promise, maybeThenable, then);
|
95
|
+
} else {
|
96
|
+
fulfill(promise, maybeThenable);
|
97
|
+
}
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
101
|
+
function resolve(promise, value) {
|
102
|
+
if (promise === value) {
|
103
|
+
fulfill(promise, value);
|
104
|
+
} else if (objectOrFunction(value)) {
|
105
|
+
handleMaybeThenable(promise, value);
|
106
|
+
} else {
|
107
|
+
fulfill(promise, value);
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
function publishRejection(promise) {
|
112
|
+
if (promise._onError) {
|
113
|
+
promise._onError(promise._result);
|
114
|
+
}
|
115
|
+
|
116
|
+
publish(promise);
|
117
|
+
}
|
118
|
+
|
119
|
+
function fulfill(promise, value) {
|
120
|
+
if (promise._state !== PENDING) { return; }
|
121
|
+
|
122
|
+
promise._result = value;
|
123
|
+
promise._state = FULFILLED;
|
124
|
+
|
125
|
+
if (promise._subscribers.length === 0) {
|
126
|
+
if (config.instrument) {
|
127
|
+
instrument('fulfilled', promise);
|
128
|
+
}
|
129
|
+
} else {
|
130
|
+
config.async(publish, promise);
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
function reject(promise, reason) {
|
135
|
+
if (promise._state !== PENDING) { return; }
|
136
|
+
promise._state = REJECTED;
|
137
|
+
promise._result = reason;
|
138
|
+
config.async(publishRejection, promise);
|
139
|
+
}
|
140
|
+
|
141
|
+
function subscribe(parent, child, onFulfillment, onRejection) {
|
142
|
+
var subscribers = parent._subscribers;
|
143
|
+
var length = subscribers.length;
|
144
|
+
|
145
|
+
parent._onError = null;
|
146
|
+
|
147
|
+
subscribers[length] = child;
|
148
|
+
subscribers[length + FULFILLED] = onFulfillment;
|
149
|
+
subscribers[length + REJECTED] = onRejection;
|
150
|
+
|
151
|
+
if (length === 0 && parent._state) {
|
152
|
+
config.async(publish, parent);
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
function publish(promise) {
|
157
|
+
var subscribers = promise._subscribers;
|
158
|
+
var settled = promise._state;
|
159
|
+
|
160
|
+
if (config.instrument) {
|
161
|
+
instrument(settled === FULFILLED ? 'fulfilled' : 'rejected', promise);
|
162
|
+
}
|
163
|
+
|
164
|
+
if (subscribers.length === 0) { return; }
|
165
|
+
|
166
|
+
var child, callback, detail = promise._result;
|
167
|
+
|
168
|
+
for (var i = 0; i < subscribers.length; i += 3) {
|
169
|
+
child = subscribers[i];
|
170
|
+
callback = subscribers[i + settled];
|
171
|
+
|
172
|
+
if (child) {
|
173
|
+
invokeCallback(settled, child, callback, detail);
|
174
|
+
} else {
|
175
|
+
callback(detail);
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
promise._subscribers.length = 0;
|
180
|
+
}
|
181
|
+
|
182
|
+
function ErrorObject() {
|
183
|
+
this.error = null;
|
184
|
+
}
|
185
|
+
|
186
|
+
var TRY_CATCH_ERROR = new ErrorObject();
|
187
|
+
|
188
|
+
function tryCatch(callback, detail) {
|
189
|
+
try {
|
190
|
+
return callback(detail);
|
191
|
+
} catch(e) {
|
192
|
+
TRY_CATCH_ERROR.error = e;
|
193
|
+
return TRY_CATCH_ERROR;
|
194
|
+
}
|
195
|
+
}
|
196
|
+
|
197
|
+
function invokeCallback(settled, promise, callback, detail) {
|
198
|
+
var hasCallback = isFunction(callback),
|
199
|
+
value, error, succeeded, failed;
|
200
|
+
|
201
|
+
if (hasCallback) {
|
202
|
+
value = tryCatch(callback, detail);
|
203
|
+
|
204
|
+
if (value === TRY_CATCH_ERROR) {
|
205
|
+
failed = true;
|
206
|
+
error = value.error;
|
207
|
+
value = null;
|
208
|
+
} else {
|
209
|
+
succeeded = true;
|
210
|
+
}
|
211
|
+
|
212
|
+
if (promise === value) {
|
213
|
+
reject(promise, withOwnPromise());
|
214
|
+
return;
|
215
|
+
}
|
216
|
+
|
217
|
+
} else {
|
218
|
+
value = detail;
|
219
|
+
succeeded = true;
|
220
|
+
}
|
221
|
+
|
222
|
+
if (promise._state !== PENDING) {
|
223
|
+
// noop
|
224
|
+
} else if (hasCallback && succeeded) {
|
225
|
+
resolve(promise, value);
|
226
|
+
} else if (failed) {
|
227
|
+
reject(promise, error);
|
228
|
+
} else if (settled === FULFILLED) {
|
229
|
+
fulfill(promise, value);
|
230
|
+
} else if (settled === REJECTED) {
|
231
|
+
reject(promise, value);
|
232
|
+
}
|
233
|
+
}
|
234
|
+
|
235
|
+
function initializePromise(promise, resolver) {
|
236
|
+
var resolved = false;
|
237
|
+
try {
|
238
|
+
resolver(function resolvePromise(value){
|
239
|
+
if (resolved) { return; }
|
240
|
+
resolved = true;
|
241
|
+
resolve(promise, value);
|
242
|
+
}, function rejectPromise(reason) {
|
243
|
+
if (resolved) { return; }
|
244
|
+
resolved = true;
|
245
|
+
reject(promise, reason);
|
246
|
+
});
|
247
|
+
} catch(e) {
|
248
|
+
reject(promise, e);
|
249
|
+
}
|
250
|
+
}
|
251
|
+
|
252
|
+
export {
|
253
|
+
noop,
|
254
|
+
resolve,
|
255
|
+
reject,
|
256
|
+
fulfill,
|
257
|
+
subscribe,
|
258
|
+
publish,
|
259
|
+
publishRejection,
|
260
|
+
initializePromise,
|
261
|
+
invokeCallback,
|
262
|
+
FULFILLED,
|
263
|
+
REJECTED,
|
264
|
+
PENDING
|
265
|
+
};
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import Enumerator from './enumerator';
|
2
|
+
import { makeSettledResult } from './enumerator';
|
3
|
+
import Promise from './promise';
|
4
|
+
import { o_create } from './utils';
|
5
|
+
|
6
|
+
function AllSettled(Constructor, entries, label) {
|
7
|
+
this._superConstructor(Constructor, entries, false /* don't abort on reject */, label);
|
8
|
+
}
|
9
|
+
|
10
|
+
AllSettled.prototype = o_create(Enumerator.prototype);
|
11
|
+
AllSettled.prototype._superConstructor = Enumerator;
|
12
|
+
AllSettled.prototype._makeResult = makeSettledResult;
|
13
|
+
AllSettled.prototype._validationError = function() {
|
14
|
+
return new Error('allSettled must be called with an array');
|
15
|
+
};
|
16
|
+
|
17
|
+
/**
|
18
|
+
`RSVP.allSettled` is similar to `RSVP.all`, but instead of implementing
|
19
|
+
a fail-fast method, it waits until all the promises have returned and
|
20
|
+
shows you all the results. This is useful if you want to handle multiple
|
21
|
+
promises' failure states together as a set.
|
22
|
+
|
23
|
+
Returns a promise that is fulfilled when all the given promises have been
|
24
|
+
settled. The return promise is fulfilled with an array of the states of
|
25
|
+
the promises passed into the `promises` array argument.
|
26
|
+
|
27
|
+
Each state object will either indicate fulfillment or rejection, and
|
28
|
+
provide the corresponding value or reason. The states will take one of
|
29
|
+
the following formats:
|
30
|
+
|
31
|
+
```javascript
|
32
|
+
{ state: 'fulfilled', value: value }
|
33
|
+
or
|
34
|
+
{ state: 'rejected', reason: reason }
|
35
|
+
```
|
36
|
+
|
37
|
+
Example:
|
38
|
+
|
39
|
+
```javascript
|
40
|
+
var promise1 = RSVP.Promise.resolve(1);
|
41
|
+
var promise2 = RSVP.Promise.reject(new Error('2'));
|
42
|
+
var promise3 = RSVP.Promise.reject(new Error('3'));
|
43
|
+
var promises = [ promise1, promise2, promise3 ];
|
44
|
+
|
45
|
+
RSVP.allSettled(promises).then(function(array){
|
46
|
+
// array == [
|
47
|
+
// { state: 'fulfilled', value: 1 },
|
48
|
+
// { state: 'rejected', reason: Error },
|
49
|
+
// { state: 'rejected', reason: Error }
|
50
|
+
// ]
|
51
|
+
// Note that for the second item, reason.message will be '2', and for the
|
52
|
+
// third item, reason.message will be '3'.
|
53
|
+
}, function(error) {
|
54
|
+
// Not run. (This block would only be called if allSettled had failed,
|
55
|
+
// for instance if passed an incorrect argument type.)
|
56
|
+
});
|
57
|
+
```
|
58
|
+
|
59
|
+
@method allSettled
|
60
|
+
@static
|
61
|
+
@for RSVP
|
62
|
+
@param {Array} promises
|
63
|
+
@param {String} label - optional string that describes the promise.
|
64
|
+
Useful for tooling.
|
65
|
+
@return {Promise} promise that is fulfilled with an array of the settled
|
66
|
+
states of the constituent promises.
|
67
|
+
*/
|
68
|
+
|
69
|
+
export default function allSettled(entries, label) {
|
70
|
+
return new AllSettled(Promise, entries, label).promise;
|
71
|
+
}
|