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,52 @@
|
|
1
|
+
import Enumerator from '../enumerator';
|
2
|
+
|
3
|
+
/**
|
4
|
+
`RSVP.Promise.all` accepts an array of promises, and returns a new promise which
|
5
|
+
is fulfilled with an array of fulfillment values for the passed promises, or
|
6
|
+
rejected with the reason of the first passed promise to be rejected. It casts all
|
7
|
+
elements of the passed iterable to promises as it runs this algorithm.
|
8
|
+
|
9
|
+
Example:
|
10
|
+
|
11
|
+
```javascript
|
12
|
+
var promise1 = RSVP.resolve(1);
|
13
|
+
var promise2 = RSVP.resolve(2);
|
14
|
+
var promise3 = RSVP.resolve(3);
|
15
|
+
var promises = [ promise1, promise2, promise3 ];
|
16
|
+
|
17
|
+
RSVP.Promise.all(promises).then(function(array){
|
18
|
+
// The array here would be [ 1, 2, 3 ];
|
19
|
+
});
|
20
|
+
```
|
21
|
+
|
22
|
+
If any of the `promises` given to `RSVP.all` are rejected, the first promise
|
23
|
+
that is rejected will be given as an argument to the returned promises's
|
24
|
+
rejection handler. For example:
|
25
|
+
|
26
|
+
Example:
|
27
|
+
|
28
|
+
```javascript
|
29
|
+
var promise1 = RSVP.resolve(1);
|
30
|
+
var promise2 = RSVP.reject(new Error("2"));
|
31
|
+
var promise3 = RSVP.reject(new Error("3"));
|
32
|
+
var promises = [ promise1, promise2, promise3 ];
|
33
|
+
|
34
|
+
RSVP.Promise.all(promises).then(function(array){
|
35
|
+
// Code here never runs because there are rejected promises!
|
36
|
+
}, function(error) {
|
37
|
+
// error.message === "2"
|
38
|
+
});
|
39
|
+
```
|
40
|
+
|
41
|
+
@method all
|
42
|
+
@static
|
43
|
+
@param {Array} entries array of promises
|
44
|
+
@param {String} label optional string for labeling the promise.
|
45
|
+
Useful for tooling.
|
46
|
+
@return {Promise} promise that is fulfilled when all `promises` have been
|
47
|
+
fulfilled, or rejected if any of them become rejected.
|
48
|
+
@static
|
49
|
+
*/
|
50
|
+
export default function all(entries, label) {
|
51
|
+
return new Enumerator(this, entries, true /* abort on reject */, label).promise;
|
52
|
+
}
|
@@ -0,0 +1,105 @@
|
|
1
|
+
import {
|
2
|
+
isArray
|
3
|
+
} from "../utils";
|
4
|
+
|
5
|
+
import {
|
6
|
+
noop,
|
7
|
+
resolve,
|
8
|
+
reject,
|
9
|
+
subscribe,
|
10
|
+
PENDING
|
11
|
+
} from '../-internal';
|
12
|
+
|
13
|
+
/**
|
14
|
+
`RSVP.Promise.race` returns a new promise which is settled in the same way as the
|
15
|
+
first passed promise to settle.
|
16
|
+
|
17
|
+
Example:
|
18
|
+
|
19
|
+
```javascript
|
20
|
+
var promise1 = new RSVP.Promise(function(resolve, reject){
|
21
|
+
setTimeout(function(){
|
22
|
+
resolve('promise 1');
|
23
|
+
}, 200);
|
24
|
+
});
|
25
|
+
|
26
|
+
var promise2 = new RSVP.Promise(function(resolve, reject){
|
27
|
+
setTimeout(function(){
|
28
|
+
resolve('promise 2');
|
29
|
+
}, 100);
|
30
|
+
});
|
31
|
+
|
32
|
+
RSVP.Promise.race([promise1, promise2]).then(function(result){
|
33
|
+
// result === 'promise 2' because it was resolved before promise1
|
34
|
+
// was resolved.
|
35
|
+
});
|
36
|
+
```
|
37
|
+
|
38
|
+
`RSVP.Promise.race` is deterministic in that only the state of the first
|
39
|
+
settled promise matters. For example, even if other promises given to the
|
40
|
+
`promises` array argument are resolved, but the first settled promise has
|
41
|
+
become rejected before the other promises became fulfilled, the returned
|
42
|
+
promise will become rejected:
|
43
|
+
|
44
|
+
```javascript
|
45
|
+
var promise1 = new RSVP.Promise(function(resolve, reject){
|
46
|
+
setTimeout(function(){
|
47
|
+
resolve('promise 1');
|
48
|
+
}, 200);
|
49
|
+
});
|
50
|
+
|
51
|
+
var promise2 = new RSVP.Promise(function(resolve, reject){
|
52
|
+
setTimeout(function(){
|
53
|
+
reject(new Error('promise 2'));
|
54
|
+
}, 100);
|
55
|
+
});
|
56
|
+
|
57
|
+
RSVP.Promise.race([promise1, promise2]).then(function(result){
|
58
|
+
// Code here never runs
|
59
|
+
}, function(reason){
|
60
|
+
// reason.message === 'promise 2' because promise 2 became rejected before
|
61
|
+
// promise 1 became fulfilled
|
62
|
+
});
|
63
|
+
```
|
64
|
+
|
65
|
+
An example real-world use case is implementing timeouts:
|
66
|
+
|
67
|
+
```javascript
|
68
|
+
RSVP.Promise.race([ajax('foo.json'), timeout(5000)])
|
69
|
+
```
|
70
|
+
|
71
|
+
@method race
|
72
|
+
@static
|
73
|
+
@param {Array} promises array of promises to observe
|
74
|
+
@param {String} label optional string for describing the promise returned.
|
75
|
+
Useful for tooling.
|
76
|
+
@return {Promise} a promise which settles in the same way as the first passed
|
77
|
+
promise to settle.
|
78
|
+
*/
|
79
|
+
export default function race(entries, label) {
|
80
|
+
/*jshint validthis:true */
|
81
|
+
var Constructor = this;
|
82
|
+
|
83
|
+
var promise = new Constructor(noop, label);
|
84
|
+
|
85
|
+
if (!isArray(entries)) {
|
86
|
+
reject(promise, new TypeError('You must pass an array to race.'));
|
87
|
+
return promise;
|
88
|
+
}
|
89
|
+
|
90
|
+
var length = entries.length;
|
91
|
+
|
92
|
+
function onFulfillment(value) {
|
93
|
+
resolve(promise, value);
|
94
|
+
}
|
95
|
+
|
96
|
+
function onRejection(reason) {
|
97
|
+
reject(promise, reason);
|
98
|
+
}
|
99
|
+
|
100
|
+
for (var i = 0; promise._state === PENDING && i < length; i++) {
|
101
|
+
subscribe(Constructor.resolve(entries[i]), undefined, onFulfillment, onRejection);
|
102
|
+
}
|
103
|
+
|
104
|
+
return promise;
|
105
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import {
|
2
|
+
noop,
|
3
|
+
reject as _reject
|
4
|
+
} from '../-internal';
|
5
|
+
|
6
|
+
/**
|
7
|
+
`RSVP.Promise.reject` returns a promise rejected with the passed `reason`.
|
8
|
+
It is shorthand for the following:
|
9
|
+
|
10
|
+
```javascript
|
11
|
+
var promise = new RSVP.Promise(function(resolve, reject){
|
12
|
+
reject(new Error('WHOOPS'));
|
13
|
+
});
|
14
|
+
|
15
|
+
promise.then(function(value){
|
16
|
+
// Code here doesn't run because the promise is rejected!
|
17
|
+
}, function(reason){
|
18
|
+
// reason.message === 'WHOOPS'
|
19
|
+
});
|
20
|
+
```
|
21
|
+
|
22
|
+
Instead of writing the above, your code now simply becomes the following:
|
23
|
+
|
24
|
+
```javascript
|
25
|
+
var promise = RSVP.Promise.reject(new Error('WHOOPS'));
|
26
|
+
|
27
|
+
promise.then(function(value){
|
28
|
+
// Code here doesn't run because the promise is rejected!
|
29
|
+
}, function(reason){
|
30
|
+
// reason.message === 'WHOOPS'
|
31
|
+
});
|
32
|
+
```
|
33
|
+
|
34
|
+
@method reject
|
35
|
+
@static
|
36
|
+
@param {Any} reason value that the returned promise will be rejected with.
|
37
|
+
@param {String} label optional string for identifying the returned promise.
|
38
|
+
Useful for tooling.
|
39
|
+
@return {Promise} a promise rejected with the given `reason`.
|
40
|
+
*/
|
41
|
+
export default function reject(reason, label) {
|
42
|
+
/*jshint validthis:true */
|
43
|
+
var Constructor = this;
|
44
|
+
var promise = new Constructor(noop, label);
|
45
|
+
_reject(promise, reason);
|
46
|
+
return promise;
|
47
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import {
|
2
|
+
noop,
|
3
|
+
resolve as _resolve
|
4
|
+
} from '../-internal';
|
5
|
+
|
6
|
+
/**
|
7
|
+
`RSVP.Promise.resolve` returns a promise that will become resolved with the
|
8
|
+
passed `value`. It is shorthand for the following:
|
9
|
+
|
10
|
+
```javascript
|
11
|
+
var promise = new RSVP.Promise(function(resolve, reject){
|
12
|
+
resolve(1);
|
13
|
+
});
|
14
|
+
|
15
|
+
promise.then(function(value){
|
16
|
+
// value === 1
|
17
|
+
});
|
18
|
+
```
|
19
|
+
|
20
|
+
Instead of writing the above, your code now simply becomes the following:
|
21
|
+
|
22
|
+
```javascript
|
23
|
+
var promise = RSVP.Promise.resolve(1);
|
24
|
+
|
25
|
+
promise.then(function(value){
|
26
|
+
// value === 1
|
27
|
+
});
|
28
|
+
```
|
29
|
+
|
30
|
+
@method resolve
|
31
|
+
@static
|
32
|
+
@param {Any} value value that the returned promise will be resolved with
|
33
|
+
@param {String} label optional string for identifying the returned promise.
|
34
|
+
Useful for tooling.
|
35
|
+
@return {Promise} a promise that will become fulfilled with the given
|
36
|
+
`value`
|
37
|
+
*/
|
38
|
+
export default function resolve(object, label) {
|
39
|
+
/*jshint validthis:true */
|
40
|
+
var Constructor = this;
|
41
|
+
|
42
|
+
if (object && typeof object === 'object' && object.constructor === Constructor) {
|
43
|
+
return object;
|
44
|
+
}
|
45
|
+
|
46
|
+
var promise = new Constructor(noop, label);
|
47
|
+
_resolve(promise, object);
|
48
|
+
return promise;
|
49
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import Promise from './promise';
|
2
|
+
|
3
|
+
/**
|
4
|
+
This is a convenient alias for `RSVP.Promise.race`.
|
5
|
+
|
6
|
+
@method race
|
7
|
+
@static
|
8
|
+
@for RSVP
|
9
|
+
@param {Array} array Array of promises.
|
10
|
+
@param {String} label An optional label. This is useful
|
11
|
+
for tooling.
|
12
|
+
*/
|
13
|
+
export default function race(array, label) {
|
14
|
+
return Promise.race(array, label);
|
15
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import Promise from './promise';
|
2
|
+
|
3
|
+
/**
|
4
|
+
This is a convenient alias for `RSVP.Promise.reject`.
|
5
|
+
|
6
|
+
@method reject
|
7
|
+
@static
|
8
|
+
@for RSVP
|
9
|
+
@param {Any} reason value that the returned promise will be rejected with.
|
10
|
+
@param {String} label optional string for identifying the returned promise.
|
11
|
+
Useful for tooling.
|
12
|
+
@return {Promise} a promise rejected with the given `reason`.
|
13
|
+
*/
|
14
|
+
export default function reject(reason, label) {
|
15
|
+
return Promise.reject(reason, label);
|
16
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import Promise from './promise';
|
2
|
+
|
3
|
+
/**
|
4
|
+
This is a convenient alias for `RSVP.Promise.resolve`.
|
5
|
+
|
6
|
+
@method resolve
|
7
|
+
@static
|
8
|
+
@for RSVP
|
9
|
+
@param {Any} value value that the returned promise will be resolved with
|
10
|
+
@param {String} label optional string for identifying the returned promise.
|
11
|
+
Useful for tooling.
|
12
|
+
@return {Promise} a promise that will become fulfilled with the given
|
13
|
+
`value`
|
14
|
+
*/
|
15
|
+
export default function resolve(value, label) {
|
16
|
+
return Promise.resolve(value, label);
|
17
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
/**
|
2
|
+
`RSVP.rethrow` will rethrow an error on the next turn of the JavaScript event
|
3
|
+
loop in order to aid debugging.
|
4
|
+
|
5
|
+
Promises A+ specifies that any exceptions that occur with a promise must be
|
6
|
+
caught by the promises implementation and bubbled to the last handler. For
|
7
|
+
this reason, it is recommended that you always specify a second rejection
|
8
|
+
handler function to `then`. However, `RSVP.rethrow` will throw the exception
|
9
|
+
outside of the promise, so it bubbles up to your console if in the browser,
|
10
|
+
or domain/cause uncaught exception in Node. `rethrow` will also throw the
|
11
|
+
error again so the error can be handled by the promise per the spec.
|
12
|
+
|
13
|
+
```javascript
|
14
|
+
function throws(){
|
15
|
+
throw new Error('Whoops!');
|
16
|
+
}
|
17
|
+
|
18
|
+
var promise = new RSVP.Promise(function(resolve, reject){
|
19
|
+
throws();
|
20
|
+
});
|
21
|
+
|
22
|
+
promise.catch(RSVP.rethrow).then(function(){
|
23
|
+
// Code here doesn't run because the promise became rejected due to an
|
24
|
+
// error!
|
25
|
+
}, function (err){
|
26
|
+
// handle the error here
|
27
|
+
});
|
28
|
+
```
|
29
|
+
|
30
|
+
The 'Whoops' error will be thrown on the next turn of the event loop
|
31
|
+
and you can watch for it in your console. You can also handle it using a
|
32
|
+
rejection handler given to `.then` or `.catch` on the returned promise.
|
33
|
+
|
34
|
+
@method rethrow
|
35
|
+
@static
|
36
|
+
@for RSVP
|
37
|
+
@param {Error} reason reason the promise became rejected.
|
38
|
+
@throws Error
|
39
|
+
@static
|
40
|
+
*/
|
41
|
+
export default function rethrow(reason) {
|
42
|
+
setTimeout(function() {
|
43
|
+
throw reason;
|
44
|
+
});
|
45
|
+
throw reason;
|
46
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
export function objectOrFunction(x) {
|
2
|
+
return typeof x === 'function' || (typeof x === 'object' && x !== null);
|
3
|
+
}
|
4
|
+
|
5
|
+
export function isFunction(x) {
|
6
|
+
return typeof x === 'function';
|
7
|
+
}
|
8
|
+
|
9
|
+
export function isMaybeThenable(x) {
|
10
|
+
return typeof x === 'object' && x !== null;
|
11
|
+
}
|
12
|
+
|
13
|
+
var _isArray;
|
14
|
+
if (!Array.isArray) {
|
15
|
+
_isArray = function (x) {
|
16
|
+
return Object.prototype.toString.call(x) === '[object Array]';
|
17
|
+
};
|
18
|
+
} else {
|
19
|
+
_isArray = Array.isArray;
|
20
|
+
}
|
21
|
+
|
22
|
+
export var isArray = _isArray;
|
23
|
+
|
24
|
+
// Date.now is not available in browsers < IE9
|
25
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Compatibility
|
26
|
+
export var now = Date.now || function() { return new Date().getTime(); };
|
27
|
+
|
28
|
+
function F() { }
|
29
|
+
|
30
|
+
export var o_create = (Object.create || function (o) {
|
31
|
+
if (arguments.length > 1) {
|
32
|
+
throw new Error('Second argument not supported');
|
33
|
+
}
|
34
|
+
if (typeof o !== 'object') {
|
35
|
+
throw new TypeError('Argument must be an object');
|
36
|
+
}
|
37
|
+
F.prototype = o;
|
38
|
+
return new F();
|
39
|
+
});
|
@@ -0,0 +1,100 @@
|
|
1
|
+
{
|
2
|
+
"name": "rsvp",
|
3
|
+
"namespace": "RSVP",
|
4
|
+
"version": "3.0.16",
|
5
|
+
"description": "A lightweight library that provides tools for organizing asynchronous code",
|
6
|
+
"main": "dist/rsvp.js",
|
7
|
+
"directories": {
|
8
|
+
"lib": "lib"
|
9
|
+
},
|
10
|
+
"devDependencies": {
|
11
|
+
"bower": "^1.3.9",
|
12
|
+
"brfs": "0.0.8",
|
13
|
+
"broccoli-compile-modules": "^1.0.0",
|
14
|
+
"broccoli-concat": "0.0.7",
|
15
|
+
"broccoli-es3-safe-recast": "0.0.8",
|
16
|
+
"broccoli-file-mover": "^0.4.0",
|
17
|
+
"broccoli-jshint": "^0.5.1",
|
18
|
+
"broccoli-merge-trees": "^0.1.4",
|
19
|
+
"broccoli-static-compiler": "^0.1.4",
|
20
|
+
"broccoli-string-replace": "0.0.1",
|
21
|
+
"broccoli-uglify-js": "^0.1.3",
|
22
|
+
"browserify": "^4.2.0",
|
23
|
+
"ember-cli": "0.1.4",
|
24
|
+
"ember-publisher": "0.0.7",
|
25
|
+
"es6-module-transpiler-amd-formatter": "0.2.2",
|
26
|
+
"express": "^4.5.0",
|
27
|
+
"git-repo-version": "0.0.2",
|
28
|
+
"jshint": "~0.9.1",
|
29
|
+
"json3": "^3.3.2",
|
30
|
+
"mkdirp": "^0.5.0",
|
31
|
+
"mocha": "^1.20.1",
|
32
|
+
"promises-aplus-tests-phantom": "^2.1.0-revise",
|
33
|
+
"release-it": "0.0.10",
|
34
|
+
"testem": "^0.6.17"
|
35
|
+
},
|
36
|
+
"scripts": {
|
37
|
+
"test": "testem ci -R dot",
|
38
|
+
"test-server": "testem",
|
39
|
+
"lint": "jshint lib",
|
40
|
+
"prepublish": "ember build --environment production",
|
41
|
+
"aplus": "browserify test/main.js -x vertx",
|
42
|
+
"build-all": "ember build --environment production && browserify ./test/main.js -x vertx -o tmp/test-bundle.js",
|
43
|
+
"dry-run-release": "ember build --environment production && release-it --dry-run --non-interactive"
|
44
|
+
},
|
45
|
+
"repository": {
|
46
|
+
"type": "git",
|
47
|
+
"url": "https://github.com/tildeio/rsvp.js.git",
|
48
|
+
"dist": "git@github.com:components/rsvp.js.git"
|
49
|
+
},
|
50
|
+
"bugs": {
|
51
|
+
"url": "https://github.com/tildeio/rsvp.js/issues"
|
52
|
+
},
|
53
|
+
"keywords": [
|
54
|
+
"promises",
|
55
|
+
"futures"
|
56
|
+
],
|
57
|
+
"author": {
|
58
|
+
"name": "Tilde, Inc. & Stefan Penner"
|
59
|
+
},
|
60
|
+
"license": "MIT",
|
61
|
+
"gitHead": "e12ab974272e50717c5e5d0e87c46673a6f2160b",
|
62
|
+
"homepage": "https://github.com/tildeio/rsvp.js",
|
63
|
+
"_id": "rsvp@3.0.16",
|
64
|
+
"_shasum": "56938ecc22a81add73676bdab7eb3d894059166a",
|
65
|
+
"_from": "rsvp@>=3.0.13 <4.0.0",
|
66
|
+
"_npmVersion": "2.1.12",
|
67
|
+
"_nodeVersion": "0.10.31",
|
68
|
+
"_npmUser": {
|
69
|
+
"name": "fivetanley",
|
70
|
+
"email": "stanley@stan.li"
|
71
|
+
},
|
72
|
+
"maintainers": [
|
73
|
+
{
|
74
|
+
"name": "wycats",
|
75
|
+
"email": "wycats@gmail.com"
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"name": "ryanflorence",
|
79
|
+
"email": "rpflorence@gmail.com"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"name": "stefanpenner",
|
83
|
+
"email": "stefan.penner@gmail.com"
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"name": "fivetanley",
|
87
|
+
"email": "dstanley.stuart@gmail.com"
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"name": "mixonic",
|
91
|
+
"email": "matt.beale@madhatted.com"
|
92
|
+
}
|
93
|
+
],
|
94
|
+
"dist": {
|
95
|
+
"shasum": "56938ecc22a81add73676bdab7eb3d894059166a",
|
96
|
+
"tarball": "http://registry.npmjs.org/rsvp/-/rsvp-3.0.16.tgz"
|
97
|
+
},
|
98
|
+
"_resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.0.16.tgz",
|
99
|
+
"readme": "ERROR: No README data found!"
|
100
|
+
}
|