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,78 @@
|
|
1
|
+
// Copyright 2014 Traceur Authors.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
// Node.js API
|
16
|
+
//
|
17
|
+
// This is what you get when you `require('traceur')`.
|
18
|
+
// It's suppose to be used by custom scripts or tools such as Grunt or Karma.
|
19
|
+
|
20
|
+
'use strict';
|
21
|
+
|
22
|
+
var path = require('path');
|
23
|
+
var fs = require('fs');
|
24
|
+
var util = require('./file-util.js');
|
25
|
+
var writeFile = util.writeFile;
|
26
|
+
var traceur = require('./traceur.js');
|
27
|
+
|
28
|
+
var Compiler = traceur.Compiler;
|
29
|
+
|
30
|
+
function NodeCompiler(options, sourceRoot) {
|
31
|
+
sourceRoot = sourceRoot || process.cwd();
|
32
|
+
Compiler.call(this, options, sourceRoot);
|
33
|
+
}
|
34
|
+
|
35
|
+
NodeCompiler.prototype = {
|
36
|
+
__proto__: Compiler.prototype,
|
37
|
+
|
38
|
+
writeTreeToFile: function(tree, filename) {
|
39
|
+
filename = this.normalize(filename);
|
40
|
+
var compiledCode = this.write(tree, filename);
|
41
|
+
if (this.options_.sourceMaps === 'file') {
|
42
|
+
var sourcemap = this.getSourceMap();
|
43
|
+
if (sourcemap) {
|
44
|
+
writeFile(this.sourceMappingURL(filename), sourcemap);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
writeFile(filename, compiledCode);
|
49
|
+
},
|
50
|
+
|
51
|
+
compileSingleFile: function(inputFilePath, outputFilePath, errback) {
|
52
|
+
inputFilePath = this.normalize(inputFilePath);
|
53
|
+
outputFilePath = this.normalize(outputFilePath);
|
54
|
+
fs.readFile(inputFilePath, function(err, contents) {
|
55
|
+
if (err) {
|
56
|
+
errback(err);
|
57
|
+
return;
|
58
|
+
}
|
59
|
+
|
60
|
+
var parsed = this.parse(contents.toString(), inputFilePath);
|
61
|
+
this.writeTreeToFile(this.transform(parsed, undefined, inputFilePath),
|
62
|
+
outputFilePath);
|
63
|
+
}.bind(this));
|
64
|
+
},
|
65
|
+
|
66
|
+
sourceMappingURL: function(filename) {
|
67
|
+
if (this.options_.sourceMaps === 'inline') {
|
68
|
+
var base64sm = new Buffer(this.getSourceMap()).toString('base64');
|
69
|
+
return 'data:application/json;base64,' + base64sm;
|
70
|
+
}
|
71
|
+
return Compiler.prototype.sourceMappingURL.call(this, filename);
|
72
|
+
}
|
73
|
+
};
|
74
|
+
|
75
|
+
|
76
|
+
module.exports = {
|
77
|
+
NodeCompiler: NodeCompiler
|
78
|
+
};
|
@@ -16,14 +16,41 @@
|
|
16
16
|
|
17
17
|
var fs = require('fs');
|
18
18
|
var traceur = require('./traceur.js');
|
19
|
-
var nodeLoader = require('./nodeLoader.js');
|
20
19
|
var path = require('path');
|
21
|
-
|
22
|
-
var
|
20
|
+
|
21
|
+
var nodeLoader = require('./nodeLoader.js');
|
23
22
|
var url = (path.resolve('./') + '/').replace(/\\/g, '/');
|
24
|
-
var loaderHooks = new LoaderHooks(reporter, url, nodeLoader);
|
25
23
|
|
26
|
-
|
24
|
+
|
25
|
+
var LoaderCompiler = traceur.runtime.LoaderCompiler;
|
26
|
+
var NodeLoaderCompiler = function() {
|
27
|
+
LoaderCompiler.call(this);
|
28
|
+
};
|
29
|
+
|
30
|
+
NodeLoaderCompiler.prototype = {
|
31
|
+
__proto__: LoaderCompiler.prototype,
|
32
|
+
evaluateCodeUnit: function(codeUnit) {
|
33
|
+
var result = module._compile(codeUnit.metadata.transcoded,
|
34
|
+
codeUnit.address || codeUnit.normalizedName);
|
35
|
+
codeUnit.metadata.transformedTree = null;
|
36
|
+
return result;
|
37
|
+
}
|
38
|
+
};
|
39
|
+
|
40
|
+
var System = new traceur.runtime.TraceurLoader(nodeLoader, url,
|
41
|
+
new NodeLoaderCompiler());
|
42
|
+
|
43
|
+
require('source-map-support').install({
|
44
|
+
retrieveSourceMap: function(filename) {
|
45
|
+
var map = System.getSourceMap(filename);
|
46
|
+
if (map) {
|
47
|
+
return {
|
48
|
+
url: filename,
|
49
|
+
map: map
|
50
|
+
};
|
51
|
+
}
|
52
|
+
}
|
53
|
+
});
|
27
54
|
|
28
55
|
Reflect.global.System = System;
|
29
56
|
System.map = System.semverMap(System.version);
|
@@ -21,104 +21,39 @@
|
|
21
21
|
|
22
22
|
var path = require('path');
|
23
23
|
var traceur = require('./traceur.js');
|
24
|
-
var AttachModuleNameTransformer =
|
25
|
-
traceur.codegeneration.module.AttachModuleNameTransformer;
|
26
|
-
var ErrorReporter = traceur.util.CollectingErrorReporter;
|
27
|
-
var FromOptionsTransformer = traceur.codegeneration.FromOptionsTransformer;
|
28
|
-
var PureES6Transformer = traceur.codegeneration.PureES6Transformer;
|
29
|
-
var Parser = traceur.syntax.Parser;
|
30
|
-
var SourceFile = traceur.syntax.SourceFile;
|
31
|
-
var SourceMapGenerator = traceur.outputgeneration.SourceMapGenerator;
|
32
|
-
var TreeWriter = traceur.outputgeneration.TreeWriter;
|
33
|
-
var traceurOptions = traceur.options;
|
34
24
|
|
35
|
-
|
36
|
-
|
37
|
-
for (i = 1; i < arguments.length; i++) {
|
38
|
-
src = arguments[i];
|
39
|
-
Object.keys(src).forEach(function(key) {
|
40
|
-
dest[key] = src[key];
|
41
|
-
});
|
42
|
-
}
|
25
|
+
var NodeCompilerModule = require('./NodeCompiler.js');
|
26
|
+
var NodeCompiler = NodeCompilerModule.NodeCompiler;
|
43
27
|
|
44
|
-
|
28
|
+
var recursiveModuleCompile = require('./recursiveModuleCompile.js');
|
29
|
+
var compileAllJsFilesInDir = require('./compileAllJsFilesInDir.js');
|
30
|
+
|
31
|
+
var Compiler = traceur.Compiler;
|
32
|
+
|
33
|
+
function compile(src, options, sourceName, outputName) {
|
34
|
+
sourceName = sourceName || '<compile-source>';
|
35
|
+
outputName = outputName || '<compile-output>';
|
36
|
+
return new NodeCompiler(Compiler.commonJSOptions(options)).
|
37
|
+
compile(src, sourceName, outputName);
|
45
38
|
}
|
46
39
|
|
47
40
|
// The absolute path to traceur-runtime.js -- the file that should be executed
|
48
41
|
// if you want to run Traceur-compiled scripts when the compiler isn't present.
|
49
|
-
var RUNTIME_PATH = path.join(__dirname, '../../bin/traceur-runtime.js');
|
50
|
-
|
51
|
-
/**
|
52
|
-
* Compile ES6 source code with Traceur.
|
53
|
-
*
|
54
|
-
* TODO(vojta): Support source maps.
|
55
|
-
*
|
56
|
-
* @param {string} content ES6 source code.
|
57
|
-
* @param {Object=} options Traceur options.
|
58
|
-
* @return {string} Transpiled ES5 code.
|
59
|
-
*/
|
60
|
-
function compile(content, options) {
|
61
|
-
options = merge({
|
62
|
-
outputLanguage: 'es5',
|
63
|
-
modules: 'commonjs',
|
64
|
-
filename: '<unknown file>',
|
65
|
-
sourceMap: false,
|
66
|
-
cwd: process.cwd(),
|
67
|
-
moduleName: false
|
68
|
-
}, options || {});
|
69
|
-
|
70
|
-
var moduleName = options.moduleName;
|
71
|
-
|
72
|
-
traceurOptions.reset();
|
73
|
-
merge(traceurOptions, options);
|
74
|
-
|
75
|
-
var errorReporter = new ErrorReporter();
|
76
|
-
var sourceFile = new SourceFile(options.filename, content);
|
77
|
-
var parser = new Parser(sourceFile, errorReporter);
|
78
|
-
var tree = parser.parseModule();
|
79
|
-
var transformer;
|
80
|
-
if (moduleName === true || options.modules == 'register' || options.modules == 'inline') {
|
81
|
-
moduleName = options.filename.replace(/\.js$/, '');
|
82
|
-
moduleName = path.relative(options.cwd, moduleName).replace(/\\/g,'/');
|
83
|
-
}
|
84
|
-
if (moduleName) {
|
85
|
-
transformer = new AttachModuleNameTransformer(moduleName);
|
86
|
-
tree = transformer.transformAny(tree);
|
87
|
-
}
|
88
|
-
|
89
|
-
if (options.outputLanguage.toLowerCase() === 'es6') {
|
90
|
-
transformer = new PureES6Transformer(errorReporter);
|
91
|
-
} else {
|
92
|
-
transformer = new FromOptionsTransformer(errorReporter);
|
93
|
-
}
|
94
|
-
|
95
|
-
var transformedTree = transformer.transform(tree);
|
96
|
-
|
97
|
-
if (errorReporter.hadError()) {
|
98
|
-
return {
|
99
|
-
js: null,
|
100
|
-
errors: errorReporter.errors,
|
101
|
-
sourceMap: null
|
102
|
-
};
|
103
|
-
}
|
104
|
-
|
105
|
-
var treeWriterOptions = {};
|
106
|
-
|
107
|
-
if (options.sourceMap) {
|
108
|
-
treeWriterOptions.sourceMapGenerator = new SourceMapGenerator({
|
109
|
-
file: options.filename,
|
110
|
-
sourceRoot: null
|
111
|
-
});
|
112
|
-
}
|
113
|
-
|
114
|
-
return {
|
115
|
-
js: TreeWriter.write(transformedTree, treeWriterOptions),
|
116
|
-
errors: errorReporter.errors,
|
117
|
-
sourceMap: treeWriterOptions.sourceMap || null
|
118
|
-
};
|
119
|
-
};
|
42
|
+
var RUNTIME_PATH = path.join(__dirname, '../../bin/traceur-runtime.js').replace(/\\/g, '/');
|
120
43
|
|
121
44
|
// extend traceur module
|
122
|
-
module.exports =
|
123
|
-
|
124
|
-
|
45
|
+
module.exports = {
|
46
|
+
__proto__: traceur,
|
47
|
+
recursiveModuleCompileToSingleFile:
|
48
|
+
recursiveModuleCompile.recursiveModuleCompileToSingleFile,
|
49
|
+
forEachRecursiveModuleCompile:
|
50
|
+
recursiveModuleCompile.forEachRecursiveModuleCompile,
|
51
|
+
compileAllJsFilesInDir:
|
52
|
+
compileAllJsFilesInDir.compileAllJsFilesInDir,
|
53
|
+
NodeCompiler: NodeCompiler,
|
54
|
+
compile: compile,
|
55
|
+
commonJSOptions: Compiler.commonJSOptions,
|
56
|
+
amdOptions: Compiler.amdOptions,
|
57
|
+
closureOptions: Compiler.closureOptions,
|
58
|
+
RUNTIME_PATH: RUNTIME_PATH
|
59
|
+
};
|
@@ -15,6 +15,7 @@
|
|
15
15
|
'use strict';
|
16
16
|
|
17
17
|
var path = require('path');
|
18
|
+
var glob = require('glob');
|
18
19
|
var commandLine;
|
19
20
|
var cmdName = path.basename(process.argv[1]);
|
20
21
|
try {
|
@@ -26,7 +27,7 @@ try {
|
|
26
27
|
}
|
27
28
|
commandLine.setMaxListeners(100);
|
28
29
|
|
29
|
-
var
|
30
|
+
var traceurAPI = require('./api.js');
|
30
31
|
var interpret = require('./interpreter.js');
|
31
32
|
|
32
33
|
// The System object requires traceur, but we want it set for everything that
|
@@ -42,14 +43,15 @@ commandLine.option('--module <fileName>', 'Parse as Module', function(fileName)
|
|
42
43
|
rootSources.push({name: fileName, type: 'module'});
|
43
44
|
});
|
44
45
|
|
46
|
+
commandLine.option('--inline <fileName>', 'Parse as Module, format \'inline\'',
|
47
|
+
function(fileName) {
|
48
|
+
rootSources.push({name: fileName, type: 'module', format: 'inline'});
|
49
|
+
}
|
50
|
+
);
|
51
|
+
|
45
52
|
commandLine.option('--out <FILE>', 'Compile all input files into a single file');
|
46
53
|
commandLine.option('--dir <INDIR> <OUTDIR>', 'Compile an input directory of modules into an output directory');
|
47
54
|
|
48
|
-
commandLine.option('--sourcemap', 'Generate source maps');
|
49
|
-
commandLine.on('sourcemap', function() {
|
50
|
-
commandLine.sourceMaps = traceur.options.sourceMaps = true;
|
51
|
-
});
|
52
|
-
|
53
55
|
commandLine.option('--longhelp', 'Show all known options');
|
54
56
|
commandLine.on('longhelp', function() {
|
55
57
|
commandLine.help();
|
@@ -95,7 +97,8 @@ commandLine.on('--help', function() {
|
|
95
97
|
console.log('');
|
96
98
|
});
|
97
99
|
|
98
|
-
|
100
|
+
var commandOptions = new traceurAPI.util.CommandOptions();
|
101
|
+
traceurAPI.util.addOptions(commandLine, commandOptions);
|
99
102
|
|
100
103
|
commandLine.usage('[options] [files]');
|
101
104
|
|
@@ -106,8 +109,17 @@ commandLine.command('*').action(function() {
|
|
106
109
|
}
|
107
110
|
});
|
108
111
|
|
112
|
+
commandLine.sourceMaps = false;
|
109
113
|
commandLine.parse(process.argv);
|
110
114
|
|
115
|
+
// commanderjs sets self[name]=defaultValue if the argument is null.
|
116
|
+
// To support --source-maps a legacy boolean we need to transfer the
|
117
|
+
// the self value here.
|
118
|
+
commandOptions.sourceMaps = commandLine.sourceMaps;
|
119
|
+
|
120
|
+
// Set the global options for back compat, but try to use options by argument.
|
121
|
+
traceurAPI.options.setFromObject(commandOptions);
|
122
|
+
|
111
123
|
if (!shouldExit && !rootSources.length) {
|
112
124
|
// TODO: Start trepl
|
113
125
|
console.error('\n Error: At least one input file is needed');
|
@@ -115,27 +127,80 @@ if (!shouldExit && !rootSources.length) {
|
|
115
127
|
process.exit(1);
|
116
128
|
}
|
117
129
|
|
118
|
-
var compiler = require('./compiler.js');
|
119
|
-
var compileToSingleFile = compiler.compileToSingleFile;
|
120
|
-
var compileToDirectory = compiler.compileToDirectory;
|
121
130
|
var out = commandLine.out;
|
122
131
|
var dir = commandLine.dir;
|
132
|
+
|
133
|
+
function compileAll(out, sources, options) {
|
134
|
+
var isSingleFileCompile = /\.js$/.test(out);
|
135
|
+
if (!isSingleFileCompile) {
|
136
|
+
traceurAPI.forEachRecursiveModuleCompile(out, sources, options);
|
137
|
+
} else {
|
138
|
+
traceurAPI.recursiveModuleCompileToSingleFile(out, sources, options).then(function() {
|
139
|
+
process.exit(0);
|
140
|
+
}).catch(function(err) {
|
141
|
+
var errors = err.errors || [err];
|
142
|
+
errors.forEach(function(err) {
|
143
|
+
console.error(err.stack || err);
|
144
|
+
});
|
145
|
+
process.exit(1);
|
146
|
+
});
|
147
|
+
}
|
148
|
+
}
|
149
|
+
|
150
|
+
function globSources(sourcesToGlob, cb) {
|
151
|
+
var processedCount = 0;
|
152
|
+
var globbedSources = [];
|
153
|
+
sourcesToGlob.forEach(function(item) {
|
154
|
+
glob(item.name, {}, function(err, matches) {
|
155
|
+
if (err)
|
156
|
+
throw new Error('While scanning ' + item.name + ': ' + err);
|
157
|
+
for (var i = matches.length - 1; i >= 0; i--) {
|
158
|
+
var globbedSource = {
|
159
|
+
name: matches[i],
|
160
|
+
type: item.type,
|
161
|
+
format: item.format
|
162
|
+
};
|
163
|
+
globbedSources.push(globbedSource);
|
164
|
+
}
|
165
|
+
processedCount++;
|
166
|
+
if (processedCount === sourcesToGlob.length) {
|
167
|
+
cb(null, globbedSources);
|
168
|
+
}
|
169
|
+
});
|
170
|
+
});
|
171
|
+
}
|
172
|
+
|
123
173
|
if (!shouldExit) {
|
124
174
|
if (out) {
|
125
|
-
var
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
175
|
+
var sourcesToGlob = [];
|
176
|
+
var processedSources = [];
|
177
|
+
|
178
|
+
for (var i = 0; i < rootSources.length; i++) {
|
179
|
+
if (glob.hasMagic(rootSources[i].name)) {
|
180
|
+
sourcesToGlob.push(rootSources[i]);
|
181
|
+
} else {
|
182
|
+
processedSources.push(rootSources[i]);
|
183
|
+
}
|
184
|
+
}
|
185
|
+
if (!sourcesToGlob.length) {
|
186
|
+
compileAll(out, processedSources, commandOptions);
|
187
|
+
} else {
|
188
|
+
globSources(sourcesToGlob, function(err, globbedSources) {
|
189
|
+
processedSources.push.apply(processedSources, globbedSources);
|
190
|
+
if (processedSources.length) {
|
191
|
+
compileAll(out, processedSources, commandOptions);
|
192
|
+
} else {
|
193
|
+
process.exit(0);
|
194
|
+
}
|
195
|
+
});
|
196
|
+
}
|
130
197
|
} else if (dir) {
|
131
198
|
if (rootSources.length !== 1)
|
132
199
|
throw new Error('Compile all in directory requires exactly one input filename');
|
133
|
-
|
134
|
-
require('./compile-single-file.js').compileAllJsFilesInDir;
|
135
|
-
compileAllJsFilesInDir(dir, rootSources[0].name, true);
|
200
|
+
traceurAPI.compileAllJsFilesInDir(dir, rootSources[0].name, commandOptions);
|
136
201
|
} else {
|
137
202
|
rootSources.forEach(function(obj) {
|
138
|
-
interpret(path.resolve(obj.name));
|
203
|
+
interpret(path.resolve(obj.name), commandOptions);
|
139
204
|
});
|
140
205
|
}
|
141
206
|
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
// Copyright 2013 Traceur Authors.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
'use strict';
|
16
|
+
|
17
|
+
var glob = require('glob');
|
18
|
+
var path = require('path');
|
19
|
+
var NodeCompiler = require('./NodeCompiler.js').NodeCompiler;
|
20
|
+
|
21
|
+
function compileAllJsFilesInDir(inputDir, outputDir, options) {
|
22
|
+
inputDir = path.normalize(inputDir).replace(/\\/g, '/');
|
23
|
+
outputDir = path.normalize(outputDir).replace(/\\/g, '/');
|
24
|
+
glob(inputDir + '/**/*.js', {}, function (er, files) {
|
25
|
+
if (er)
|
26
|
+
throw new Error('While scanning ' + inputDir + ': ' + er);
|
27
|
+
|
28
|
+
files.forEach(function(inputFilePath) {
|
29
|
+
var outputFilePath = inputFilePath.replace(inputDir, outputDir);
|
30
|
+
var compiler = new NodeCompiler(options);
|
31
|
+
compiler.compileSingleFile(inputFilePath, outputFilePath, function(err) {
|
32
|
+
throw new Error('While reading ' + inputFilePath + ': ' + err);
|
33
|
+
});
|
34
|
+
});
|
35
|
+
});
|
36
|
+
}
|
37
|
+
|
38
|
+
module.exports = {
|
39
|
+
compileAllJsFilesInDir: compileAllJsFilesInDir
|
40
|
+
};
|