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,15 @@
|
|
1
|
+
import Promise from "./promise";
|
2
|
+
|
3
|
+
/**
|
4
|
+
This is a convenient alias for `RSVP.Promise.all`.
|
5
|
+
|
6
|
+
@method all
|
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 all(array, label) {
|
14
|
+
return Promise.all(array, label);
|
15
|
+
}
|
@@ -0,0 +1,109 @@
|
|
1
|
+
var len = 0;
|
2
|
+
|
3
|
+
export default function asap(callback, arg) {
|
4
|
+
queue[len] = callback;
|
5
|
+
queue[len + 1] = arg;
|
6
|
+
len += 2;
|
7
|
+
if (len === 2) {
|
8
|
+
// If len is 1, that means that we need to schedule an async flush.
|
9
|
+
// If additional callbacks are queued before the queue is flushed, they
|
10
|
+
// will be processed by this flush that we are scheduling.
|
11
|
+
scheduleFlush();
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
var browserWindow = (typeof window !== 'undefined') ? window : undefined
|
16
|
+
var browserGlobal = browserWindow || {};
|
17
|
+
var BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;
|
18
|
+
var isNode = typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';
|
19
|
+
|
20
|
+
// test for web worker but not in IE10
|
21
|
+
var isWorker = typeof Uint8ClampedArray !== 'undefined' &&
|
22
|
+
typeof importScripts !== 'undefined' &&
|
23
|
+
typeof MessageChannel !== 'undefined';
|
24
|
+
|
25
|
+
// node
|
26
|
+
function useNextTick() {
|
27
|
+
var nextTick = process.nextTick;
|
28
|
+
// node version 0.10.x displays a deprecation warning when nextTick is used recursively
|
29
|
+
// setImmediate should be used instead instead
|
30
|
+
var version = process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);
|
31
|
+
if (Array.isArray(version) && version[1] === '0' && version[2] === '10') {
|
32
|
+
nextTick = setImmediate;
|
33
|
+
}
|
34
|
+
return function() {
|
35
|
+
nextTick(flush);
|
36
|
+
};
|
37
|
+
}
|
38
|
+
|
39
|
+
// vertx
|
40
|
+
function useVertxTimer() {
|
41
|
+
return function() {
|
42
|
+
vertxNext(flush);
|
43
|
+
};
|
44
|
+
}
|
45
|
+
|
46
|
+
function useMutationObserver() {
|
47
|
+
var iterations = 0;
|
48
|
+
var observer = new BrowserMutationObserver(flush);
|
49
|
+
var node = document.createTextNode('');
|
50
|
+
observer.observe(node, { characterData: true });
|
51
|
+
|
52
|
+
return function() {
|
53
|
+
node.data = (iterations = ++iterations % 2);
|
54
|
+
};
|
55
|
+
}
|
56
|
+
|
57
|
+
// web worker
|
58
|
+
function useMessageChannel() {
|
59
|
+
var channel = new MessageChannel();
|
60
|
+
channel.port1.onmessage = flush;
|
61
|
+
return function () {
|
62
|
+
channel.port2.postMessage(0);
|
63
|
+
};
|
64
|
+
}
|
65
|
+
|
66
|
+
function useSetTimeout() {
|
67
|
+
return function() {
|
68
|
+
setTimeout(flush, 1);
|
69
|
+
};
|
70
|
+
}
|
71
|
+
|
72
|
+
var queue = new Array(1000);
|
73
|
+
function flush() {
|
74
|
+
for (var i = 0; i < len; i+=2) {
|
75
|
+
var callback = queue[i];
|
76
|
+
var arg = queue[i+1];
|
77
|
+
|
78
|
+
callback(arg);
|
79
|
+
|
80
|
+
queue[i] = undefined;
|
81
|
+
queue[i+1] = undefined;
|
82
|
+
}
|
83
|
+
|
84
|
+
len = 0;
|
85
|
+
}
|
86
|
+
|
87
|
+
function attemptVertex() {
|
88
|
+
try {
|
89
|
+
var vertx = require('vertx');
|
90
|
+
var vertxNext = vertx.runOnLoop || vertx.runOnContext;
|
91
|
+
return useVertxTimer();
|
92
|
+
} catch(e) {
|
93
|
+
return useSetTimeout();
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
var scheduleFlush;
|
98
|
+
// Decide what async method to use to triggering processing of queued callbacks:
|
99
|
+
if (isNode) {
|
100
|
+
scheduleFlush = useNextTick();
|
101
|
+
} else if (BrowserMutationObserver) {
|
102
|
+
scheduleFlush = useMutationObserver();
|
103
|
+
} else if (isWorker) {
|
104
|
+
scheduleFlush = useMessageChannel();
|
105
|
+
} else if (browserWindow === undefined && typeof require === 'function') {
|
106
|
+
scheduleFlush = attemptVertex();
|
107
|
+
} else {
|
108
|
+
scheduleFlush = useSetTimeout();
|
109
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import EventTarget from './events';
|
2
|
+
|
3
|
+
var config = {
|
4
|
+
instrument: false
|
5
|
+
};
|
6
|
+
|
7
|
+
EventTarget['mixin'](config);
|
8
|
+
|
9
|
+
function configure(name, value) {
|
10
|
+
if (name === 'onerror') {
|
11
|
+
// handle for legacy users that expect the actual
|
12
|
+
// error to be passed to their function added via
|
13
|
+
// `RSVP.configure('onerror', someFunctionHere);`
|
14
|
+
config['on']('error', value);
|
15
|
+
return;
|
16
|
+
}
|
17
|
+
|
18
|
+
if (arguments.length === 2) {
|
19
|
+
config[name] = value;
|
20
|
+
} else {
|
21
|
+
return config[name];
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
export {
|
26
|
+
config,
|
27
|
+
configure
|
28
|
+
};
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import Promise from "./promise";
|
2
|
+
|
3
|
+
/**
|
4
|
+
`RSVP.defer` returns an object similar to jQuery's `$.Deferred`.
|
5
|
+
`RSVP.defer` should be used when porting over code reliant on `$.Deferred`'s
|
6
|
+
interface. New code should use the `RSVP.Promise` constructor instead.
|
7
|
+
|
8
|
+
The object returned from `RSVP.defer` is a plain object with three properties:
|
9
|
+
|
10
|
+
* promise - an `RSVP.Promise`.
|
11
|
+
* reject - a function that causes the `promise` property on this object to
|
12
|
+
become rejected
|
13
|
+
* resolve - a function that causes the `promise` property on this object to
|
14
|
+
become fulfilled.
|
15
|
+
|
16
|
+
Example:
|
17
|
+
|
18
|
+
```javascript
|
19
|
+
var deferred = RSVP.defer();
|
20
|
+
|
21
|
+
deferred.resolve("Success!");
|
22
|
+
|
23
|
+
deferred.promise.then(function(value){
|
24
|
+
// value here is "Success!"
|
25
|
+
});
|
26
|
+
```
|
27
|
+
|
28
|
+
@method defer
|
29
|
+
@static
|
30
|
+
@for RSVP
|
31
|
+
@param {String} label optional string for labeling the promise.
|
32
|
+
Useful for tooling.
|
33
|
+
@return {Object}
|
34
|
+
*/
|
35
|
+
|
36
|
+
export default function defer(label) {
|
37
|
+
var deferred = { };
|
38
|
+
|
39
|
+
deferred['promise'] = new Promise(function(resolve, reject) {
|
40
|
+
deferred['resolve'] = resolve;
|
41
|
+
deferred['reject'] = reject;
|
42
|
+
}, label);
|
43
|
+
|
44
|
+
return deferred;
|
45
|
+
}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
import {
|
2
|
+
isArray,
|
3
|
+
isMaybeThenable
|
4
|
+
} from './utils';
|
5
|
+
|
6
|
+
import {
|
7
|
+
noop,
|
8
|
+
reject,
|
9
|
+
fulfill,
|
10
|
+
subscribe,
|
11
|
+
FULFILLED,
|
12
|
+
REJECTED,
|
13
|
+
PENDING
|
14
|
+
} from './-internal';
|
15
|
+
|
16
|
+
export function makeSettledResult(state, position, value) {
|
17
|
+
if (state === FULFILLED) {
|
18
|
+
return {
|
19
|
+
state: 'fulfilled',
|
20
|
+
value: value
|
21
|
+
};
|
22
|
+
} else {
|
23
|
+
return {
|
24
|
+
state: 'rejected',
|
25
|
+
reason: value
|
26
|
+
};
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
function Enumerator(Constructor, input, abortOnReject, label) {
|
31
|
+
this._instanceConstructor = Constructor;
|
32
|
+
this.promise = new Constructor(noop, label);
|
33
|
+
this._abortOnReject = abortOnReject;
|
34
|
+
|
35
|
+
if (this._validateInput(input)) {
|
36
|
+
this._input = input;
|
37
|
+
this.length = input.length;
|
38
|
+
this._remaining = input.length;
|
39
|
+
|
40
|
+
this._init();
|
41
|
+
|
42
|
+
if (this.length === 0) {
|
43
|
+
fulfill(this.promise, this._result);
|
44
|
+
} else {
|
45
|
+
this.length = this.length || 0;
|
46
|
+
this._enumerate();
|
47
|
+
if (this._remaining === 0) {
|
48
|
+
fulfill(this.promise, this._result);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
} else {
|
52
|
+
reject(this.promise, this._validationError());
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
export default Enumerator;
|
57
|
+
|
58
|
+
Enumerator.prototype._validateInput = function(input) {
|
59
|
+
return isArray(input);
|
60
|
+
};
|
61
|
+
|
62
|
+
Enumerator.prototype._validationError = function() {
|
63
|
+
return new Error('Array Methods must be provided an Array');
|
64
|
+
};
|
65
|
+
|
66
|
+
Enumerator.prototype._init = function() {
|
67
|
+
this._result = new Array(this.length);
|
68
|
+
};
|
69
|
+
|
70
|
+
Enumerator.prototype._enumerate = function() {
|
71
|
+
var length = this.length;
|
72
|
+
var promise = this.promise;
|
73
|
+
var input = this._input;
|
74
|
+
|
75
|
+
for (var i = 0; promise._state === PENDING && i < length; i++) {
|
76
|
+
this._eachEntry(input[i], i);
|
77
|
+
}
|
78
|
+
};
|
79
|
+
|
80
|
+
Enumerator.prototype._eachEntry = function(entry, i) {
|
81
|
+
var c = this._instanceConstructor;
|
82
|
+
if (isMaybeThenable(entry)) {
|
83
|
+
if (entry.constructor === c && entry._state !== PENDING) {
|
84
|
+
entry._onError = null;
|
85
|
+
this._settledAt(entry._state, i, entry._result);
|
86
|
+
} else {
|
87
|
+
this._willSettleAt(c.resolve(entry), i);
|
88
|
+
}
|
89
|
+
} else {
|
90
|
+
this._remaining--;
|
91
|
+
this._result[i] = this._makeResult(FULFILLED, i, entry);
|
92
|
+
}
|
93
|
+
};
|
94
|
+
|
95
|
+
Enumerator.prototype._settledAt = function(state, i, value) {
|
96
|
+
var promise = this.promise;
|
97
|
+
|
98
|
+
if (promise._state === PENDING) {
|
99
|
+
this._remaining--;
|
100
|
+
|
101
|
+
if (this._abortOnReject && state === REJECTED) {
|
102
|
+
reject(promise, value);
|
103
|
+
} else {
|
104
|
+
this._result[i] = this._makeResult(state, i, value);
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
if (this._remaining === 0) {
|
109
|
+
fulfill(promise, this._result);
|
110
|
+
}
|
111
|
+
};
|
112
|
+
|
113
|
+
Enumerator.prototype._makeResult = function(state, i, value) {
|
114
|
+
return value;
|
115
|
+
};
|
116
|
+
|
117
|
+
Enumerator.prototype._willSettleAt = function(promise, i) {
|
118
|
+
var enumerator = this;
|
119
|
+
|
120
|
+
subscribe(promise, undefined, function(value) {
|
121
|
+
enumerator._settledAt(FULFILLED, i, value);
|
122
|
+
}, function(reason) {
|
123
|
+
enumerator._settledAt(REJECTED, i, reason);
|
124
|
+
});
|
125
|
+
};
|
@@ -0,0 +1,201 @@
|
|
1
|
+
function indexOf(callbacks, callback) {
|
2
|
+
for (var i=0, l=callbacks.length; i<l; i++) {
|
3
|
+
if (callbacks[i] === callback) { return i; }
|
4
|
+
}
|
5
|
+
|
6
|
+
return -1;
|
7
|
+
}
|
8
|
+
|
9
|
+
function callbacksFor(object) {
|
10
|
+
var callbacks = object._promiseCallbacks;
|
11
|
+
|
12
|
+
if (!callbacks) {
|
13
|
+
callbacks = object._promiseCallbacks = {};
|
14
|
+
}
|
15
|
+
|
16
|
+
return callbacks;
|
17
|
+
}
|
18
|
+
|
19
|
+
/**
|
20
|
+
@class RSVP.EventTarget
|
21
|
+
*/
|
22
|
+
export default {
|
23
|
+
|
24
|
+
/**
|
25
|
+
`RSVP.EventTarget.mixin` extends an object with EventTarget methods. For
|
26
|
+
Example:
|
27
|
+
|
28
|
+
```javascript
|
29
|
+
var object = {};
|
30
|
+
|
31
|
+
RSVP.EventTarget.mixin(object);
|
32
|
+
|
33
|
+
object.on('finished', function(event) {
|
34
|
+
// handle event
|
35
|
+
});
|
36
|
+
|
37
|
+
object.trigger('finished', { detail: value });
|
38
|
+
```
|
39
|
+
|
40
|
+
`EventTarget.mixin` also works with prototypes:
|
41
|
+
|
42
|
+
```javascript
|
43
|
+
var Person = function() {};
|
44
|
+
RSVP.EventTarget.mixin(Person.prototype);
|
45
|
+
|
46
|
+
var yehuda = new Person();
|
47
|
+
var tom = new Person();
|
48
|
+
|
49
|
+
yehuda.on('poke', function(event) {
|
50
|
+
console.log('Yehuda says OW');
|
51
|
+
});
|
52
|
+
|
53
|
+
tom.on('poke', function(event) {
|
54
|
+
console.log('Tom says OW');
|
55
|
+
});
|
56
|
+
|
57
|
+
yehuda.trigger('poke');
|
58
|
+
tom.trigger('poke');
|
59
|
+
```
|
60
|
+
|
61
|
+
@method mixin
|
62
|
+
@for RSVP.EventTarget
|
63
|
+
@private
|
64
|
+
@param {Object} object object to extend with EventTarget methods
|
65
|
+
*/
|
66
|
+
'mixin': function(object) {
|
67
|
+
object['on'] = this['on'];
|
68
|
+
object['off'] = this['off'];
|
69
|
+
object['trigger'] = this['trigger'];
|
70
|
+
object._promiseCallbacks = undefined;
|
71
|
+
return object;
|
72
|
+
},
|
73
|
+
|
74
|
+
/**
|
75
|
+
Registers a callback to be executed when `eventName` is triggered
|
76
|
+
|
77
|
+
```javascript
|
78
|
+
object.on('event', function(eventInfo){
|
79
|
+
// handle the event
|
80
|
+
});
|
81
|
+
|
82
|
+
object.trigger('event');
|
83
|
+
```
|
84
|
+
|
85
|
+
@method on
|
86
|
+
@for RSVP.EventTarget
|
87
|
+
@private
|
88
|
+
@param {String} eventName name of the event to listen for
|
89
|
+
@param {Function} callback function to be called when the event is triggered.
|
90
|
+
*/
|
91
|
+
'on': function(eventName, callback) {
|
92
|
+
var allCallbacks = callbacksFor(this), callbacks;
|
93
|
+
|
94
|
+
callbacks = allCallbacks[eventName];
|
95
|
+
|
96
|
+
if (!callbacks) {
|
97
|
+
callbacks = allCallbacks[eventName] = [];
|
98
|
+
}
|
99
|
+
|
100
|
+
if (indexOf(callbacks, callback) === -1) {
|
101
|
+
callbacks.push(callback);
|
102
|
+
}
|
103
|
+
},
|
104
|
+
|
105
|
+
/**
|
106
|
+
You can use `off` to stop firing a particular callback for an event:
|
107
|
+
|
108
|
+
```javascript
|
109
|
+
function doStuff() { // do stuff! }
|
110
|
+
object.on('stuff', doStuff);
|
111
|
+
|
112
|
+
object.trigger('stuff'); // doStuff will be called
|
113
|
+
|
114
|
+
// Unregister ONLY the doStuff callback
|
115
|
+
object.off('stuff', doStuff);
|
116
|
+
object.trigger('stuff'); // doStuff will NOT be called
|
117
|
+
```
|
118
|
+
|
119
|
+
If you don't pass a `callback` argument to `off`, ALL callbacks for the
|
120
|
+
event will not be executed when the event fires. For example:
|
121
|
+
|
122
|
+
```javascript
|
123
|
+
var callback1 = function(){};
|
124
|
+
var callback2 = function(){};
|
125
|
+
|
126
|
+
object.on('stuff', callback1);
|
127
|
+
object.on('stuff', callback2);
|
128
|
+
|
129
|
+
object.trigger('stuff'); // callback1 and callback2 will be executed.
|
130
|
+
|
131
|
+
object.off('stuff');
|
132
|
+
object.trigger('stuff'); // callback1 and callback2 will not be executed!
|
133
|
+
```
|
134
|
+
|
135
|
+
@method off
|
136
|
+
@for RSVP.EventTarget
|
137
|
+
@private
|
138
|
+
@param {String} eventName event to stop listening to
|
139
|
+
@param {Function} callback optional argument. If given, only the function
|
140
|
+
given will be removed from the event's callback queue. If no `callback`
|
141
|
+
argument is given, all callbacks will be removed from the event's callback
|
142
|
+
queue.
|
143
|
+
*/
|
144
|
+
'off': function(eventName, callback) {
|
145
|
+
var allCallbacks = callbacksFor(this), callbacks, index;
|
146
|
+
|
147
|
+
if (!callback) {
|
148
|
+
allCallbacks[eventName] = [];
|
149
|
+
return;
|
150
|
+
}
|
151
|
+
|
152
|
+
callbacks = allCallbacks[eventName];
|
153
|
+
|
154
|
+
index = indexOf(callbacks, callback);
|
155
|
+
|
156
|
+
if (index !== -1) { callbacks.splice(index, 1); }
|
157
|
+
},
|
158
|
+
|
159
|
+
/**
|
160
|
+
Use `trigger` to fire custom events. For example:
|
161
|
+
|
162
|
+
```javascript
|
163
|
+
object.on('foo', function(){
|
164
|
+
console.log('foo event happened!');
|
165
|
+
});
|
166
|
+
object.trigger('foo');
|
167
|
+
// 'foo event happened!' logged to the console
|
168
|
+
```
|
169
|
+
|
170
|
+
You can also pass a value as a second argument to `trigger` that will be
|
171
|
+
passed as an argument to all event listeners for the event:
|
172
|
+
|
173
|
+
```javascript
|
174
|
+
object.on('foo', function(value){
|
175
|
+
console.log(value.name);
|
176
|
+
});
|
177
|
+
|
178
|
+
object.trigger('foo', { name: 'bar' });
|
179
|
+
// 'bar' logged to the console
|
180
|
+
```
|
181
|
+
|
182
|
+
@method trigger
|
183
|
+
@for RSVP.EventTarget
|
184
|
+
@private
|
185
|
+
@param {String} eventName name of the event to be triggered
|
186
|
+
@param {Any} options optional value to be passed to any event handlers for
|
187
|
+
the given `eventName`
|
188
|
+
*/
|
189
|
+
'trigger': function(eventName, options) {
|
190
|
+
var allCallbacks = callbacksFor(this), callbacks, callback;
|
191
|
+
|
192
|
+
if (callbacks = allCallbacks[eventName]) {
|
193
|
+
// Don't cache the callbacks.length since it may grow
|
194
|
+
for (var i=0; i<callbacks.length; i++) {
|
195
|
+
callback = callbacks[i];
|
196
|
+
|
197
|
+
callback(options);
|
198
|
+
}
|
199
|
+
}
|
200
|
+
}
|
201
|
+
};
|