traceur-rb 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +22 -0
- data/.rspec +1 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -0
- data/Guardfile +8 -0
- data/LICENSE.txt +22 -0
- data/README.md +87 -0
- data/Rakefile +2 -0
- data/lib/js/compile.js +31 -0
- data/lib/traceur-rb.rb +1 -0
- data/lib/traceur.rb +43 -0
- data/lib/traceur/compilation_options.rb +65 -0
- data/lib/traceur/compiler.rb +33 -0
- data/lib/traceur/configuration.rb +47 -0
- data/lib/traceur/node.rb +26 -0
- data/lib/traceur/node/command_result.rb +28 -0
- data/lib/traceur/node/runner.rb +40 -0
- data/lib/traceur/version.rb +3 -0
- data/spec/examples/classes.js +12 -0
- data/spec/integration/examples_spec.rb +28 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/traceur/compilation_options_spec.rb +31 -0
- data/spec/traceur/configuration_spec.rb +54 -0
- data/spec/traceur/node_spec.rb +15 -0
- data/traceur-rb.gemspec +25 -0
- data/vendor/node_modules/.bin/traceur +3 -0
- data/vendor/node_modules/traceur/README.md +40 -0
- data/vendor/node_modules/traceur/bin/traceur-runtime.js +2101 -0
- data/vendor/node_modules/traceur/bin/traceur.js +23034 -0
- data/vendor/node_modules/traceur/node_modules/.bin/semver +125 -0
- data/vendor/node_modules/traceur/node_modules/commander/Readme.md +208 -0
- data/vendor/node_modules/traceur/node_modules/commander/index.js +852 -0
- data/vendor/node_modules/traceur/node_modules/commander/package.json +40 -0
- data/vendor/node_modules/traceur/node_modules/q-io/.npmignore +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/.travis.yml +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/CHANGES.md +122 -0
- data/vendor/node_modules/traceur/node_modules/q-io/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/README.md +928 -0
- data/vendor/node_modules/traceur/node_modules/q-io/buffer-stream.js +59 -0
- data/vendor/node_modules/traceur/node_modules/q-io/coverage-report.js +44 -0
- data/vendor/node_modules/traceur/node_modules/q-io/deprecate.js +51 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs-boot.js +307 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs-common.js +499 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs-mock.js +547 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs-root.js +105 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs.js +355 -0
- data/vendor/node_modules/traceur/node_modules/q-io/fs2http.js +65 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps.js +152 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/chain.js +24 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/content.js +93 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/cookie.js +154 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/decorators.js +178 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/fs.js +417 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/html.js +58 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/json.js +78 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/negotiate.js +120 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/proxy.js +27 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/redirect.js +209 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/route.js +125 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-apps/status.js +175 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http-cookie.js +75 -0
- data/vendor/node_modules/traceur/node_modules/q-io/http.js +378 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.npmignore +11 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/.travis.yml +4 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/CHANGES.md +78 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/LICENSE.md +21 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/README.md +1285 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/collections.js +22 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/dict.js +142 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-map.js +57 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/fast-set.js +183 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-collection.js +261 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-map.js +186 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-order.js +55 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/generic-set.js +59 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/heap.js +236 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/iterator.js +371 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/list.js +435 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/array-changes.js +247 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/map-changes.js +147 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/property-changes.js +448 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/range-changes.js +139 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-map.js +79 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/lru-set.js +142 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/map.js +60 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/multi-map.js +41 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/package.json +12 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync +7 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/sync.patch +48 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/node_modules/weak-map/weak-map.js +590 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/package.json +49 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/set.js +173 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-array.js +274 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-function.js +59 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-object.js +538 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim-regexp.js +14 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/shim.js +6 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-map.js +49 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array-set.js +51 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-array.js +269 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-map.js +61 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/sorted-set.js +736 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/tree-log.js +40 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/weak-map.js +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/README.md +66 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/mime.js +114 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/package.json +35 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/test.js +84 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/mime.types +1588 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mime/types/node.types +77 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/CHANGES +15 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/README +96 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/lib/mimeparse.js +166 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/mimeparse/package.json +43 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/CONTRIBUTING.md +40 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/LICENSE +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/README.md +813 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/compare-with-callbacks.js +71 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/benchmark/scenarios.js +36 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/package.json +93 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/q.js +1937 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/q/queue.js +35 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/.gitmodules +6 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/History.md +36 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Makefile +7 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/Readme.md +38 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/benchmark.js +32 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/examples.js +39 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/index.js +2 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/lib/querystring.js +123 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/package.json +19 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.gitmodules +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/.npmignore +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/History.md +128 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Makefile +53 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/Readme.md +61 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/bin/expresso +856 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/api.html +1080 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.html +377 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/index.md +290 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/foot.html +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/docs/layout/head.html +42 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/bar.js +4 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/lib/foo.js +16 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/package.json +12 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/assert.test.js +91 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/async.test.js +12 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/bar.test.js +13 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/foo.test.js +14 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/http.test.js +146 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/async.test.js +39 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/expresso/test/serial/http.test.js +48 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/.gitmodules +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/History.md +22 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Makefile +6 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/Readme.md +248 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/examples/runner.js +53 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/index.js +2 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/eql.js +91 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/lib/should.js +548 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/package.json +8 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/support/should/test/should.test.js +358 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/qs/test/querystring.test.js +133 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.npmignore +3 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/.travis.yml +4 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/LICENSE.md +20 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/README.md +33 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/package.json +37 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/test/url2-spec.js +125 -0
- data/vendor/node_modules/traceur/node_modules/q-io/node_modules/url2/url2.js +151 -0
- data/vendor/node_modules/traceur/node_modules/q-io/package.json +51 -0
- data/vendor/node_modules/traceur/node_modules/q-io/reader.js +133 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/boot-directory-spec.js +47 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/contains-spec.js +11 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/fixtures/hello.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/issues/1-spec.js +33 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/make-tree-spec.js +92 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/append-spec.js +41 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/copy-tree-spec.js +57 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/fixture/hello.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/link-spec.js +70 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/make-tree-spec.js +109 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/merge-spec.js +67 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/move-spec.js +219 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/object-spec.js +20 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/range-spec.js +26 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/read-spec.js +40 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-directory-spec.js +37 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/remove-tree-spec.js +39 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/root-spec.js +32 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/stat-spec.js +26 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/symbolic-link-spec.js +86 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/working-directory-spec.js +31 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/mock/write-spec.js +73 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.js +23 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/range-spec.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/read-spec.js +22 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/relative-spec.js +25 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/reroot-spec.js +45 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/fs/write-spec.js +38 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/cookie-spec.js +52 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/directory-list-spec.js +86 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/01234.txt +1 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/fixtures/1234.txt +1 -0
- 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 +49 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/interpret-range-spec.js +47 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/partial-range-spec.js +186 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/proxy-spec.js +82 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http-apps/symbolic-link-spec.js +110 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http/agent-spec.js +96 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/http/basic-spec.js +96 -0
- data/vendor/node_modules/traceur/node_modules/q-io/spec/lib/jasmine-promise.js +42 -0
- data/vendor/node_modules/traceur/node_modules/q-io/writer.js +111 -0
- data/vendor/node_modules/traceur/node_modules/semver/.npmignore +1 -0
- data/vendor/node_modules/traceur/node_modules/semver/LICENSE +27 -0
- data/vendor/node_modules/traceur/node_modules/semver/Makefile +24 -0
- data/vendor/node_modules/traceur/node_modules/semver/README.md +158 -0
- data/vendor/node_modules/traceur/node_modules/semver/bin/semver +125 -0
- data/vendor/node_modules/traceur/node_modules/semver/foot.js +6 -0
- data/vendor/node_modules/traceur/node_modules/semver/head.js +2 -0
- data/vendor/node_modules/traceur/node_modules/semver/package.json +31 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.browser.js +1039 -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 +1043 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.min.js +1 -0
- data/vendor/node_modules/traceur/node_modules/semver/semver.min.js.gz +0 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/amd.js +15 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/gtr.js +173 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/index.js +584 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/ltr.js +174 -0
- data/vendor/node_modules/traceur/node_modules/semver/test/no-module.js +19 -0
- data/vendor/node_modules/traceur/package.json +64 -0
- data/vendor/node_modules/traceur/src/node/System.js +31 -0
- data/vendor/node_modules/traceur/src/node/api.js +124 -0
- data/vendor/node_modules/traceur/src/node/command.js +141 -0
- data/vendor/node_modules/traceur/src/node/compile-single-file.js +69 -0
- data/vendor/node_modules/traceur/src/node/compiler.js +116 -0
- data/vendor/node_modules/traceur/src/node/deferred.js +110 -0
- data/vendor/node_modules/traceur/src/node/file-util.js +73 -0
- data/vendor/node_modules/traceur/src/node/getopt.js +147 -0
- data/vendor/node_modules/traceur/src/node/inline-module.js +149 -0
- data/vendor/node_modules/traceur/src/node/interpreter.js +33 -0
- data/vendor/node_modules/traceur/src/node/nodeLoader.js +41 -0
- data/vendor/node_modules/traceur/src/node/require.js +85 -0
- data/vendor/node_modules/traceur/src/node/to-amd-compiler.js +33 -0
- data/vendor/node_modules/traceur/src/node/to-commonjs-compiler.js +33 -0
- data/vendor/node_modules/traceur/src/node/traceur.js +32 -0
- data/vendor/node_modules/traceur/traceur +3 -0
- metadata +359 -0
data/vendor/node_modules/traceur/node_modules/q-io/node_modules/collections/listen/range-changes.js
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var WeakMap = require("weak-map");
|
4
|
+
var Dict = require("../dict");
|
5
|
+
|
6
|
+
var rangeChangeDescriptors = new WeakMap(); // {isActive, willChangeListeners, changeListeners}
|
7
|
+
|
8
|
+
module.exports = RangeChanges;
|
9
|
+
function RangeChanges() {
|
10
|
+
throw new Error("Can't construct. RangeChanges is a mixin.");
|
11
|
+
}
|
12
|
+
|
13
|
+
RangeChanges.prototype.getAllRangeChangeDescriptors = function () {
|
14
|
+
if (!rangeChangeDescriptors.has(this)) {
|
15
|
+
rangeChangeDescriptors.set(this, Dict());
|
16
|
+
}
|
17
|
+
return rangeChangeDescriptors.get(this);
|
18
|
+
};
|
19
|
+
|
20
|
+
RangeChanges.prototype.getRangeChangeDescriptor = function (token) {
|
21
|
+
var tokenChangeDescriptors = this.getAllRangeChangeDescriptors();
|
22
|
+
token = token || "";
|
23
|
+
if (!tokenChangeDescriptors.has(token)) {
|
24
|
+
tokenChangeDescriptors.set(token, {
|
25
|
+
isActive: false,
|
26
|
+
changeListeners: [],
|
27
|
+
willChangeListeners: []
|
28
|
+
});
|
29
|
+
}
|
30
|
+
return tokenChangeDescriptors.get(token);
|
31
|
+
};
|
32
|
+
|
33
|
+
RangeChanges.prototype.addRangeChangeListener = function (listener, token, beforeChange) {
|
34
|
+
// a concession for objects like Array that are not inherently observable
|
35
|
+
if (!this.isObservable && this.makeObservable) {
|
36
|
+
this.makeObservable();
|
37
|
+
}
|
38
|
+
|
39
|
+
var descriptor = this.getRangeChangeDescriptor(token);
|
40
|
+
|
41
|
+
var listeners;
|
42
|
+
if (beforeChange) {
|
43
|
+
listeners = descriptor.willChangeListeners;
|
44
|
+
} else {
|
45
|
+
listeners = descriptor.changeListeners;
|
46
|
+
}
|
47
|
+
|
48
|
+
// even if already registered
|
49
|
+
listeners.push(listener);
|
50
|
+
Object.defineProperty(this, "dispatchesRangeChanges", {
|
51
|
+
value: true,
|
52
|
+
writable: true,
|
53
|
+
configurable: true,
|
54
|
+
enumerable: false
|
55
|
+
});
|
56
|
+
|
57
|
+
var self = this;
|
58
|
+
return function cancelRangeChangeListener() {
|
59
|
+
if (!self) {
|
60
|
+
// TODO throw new Error("Range change listener " + JSON.stringify(token) + " has already been canceled");
|
61
|
+
return;
|
62
|
+
}
|
63
|
+
self.removeRangeChangeListener(listener, token, beforeChange);
|
64
|
+
self = null;
|
65
|
+
};
|
66
|
+
};
|
67
|
+
|
68
|
+
RangeChanges.prototype.removeRangeChangeListener = function (listener, token, beforeChange) {
|
69
|
+
var descriptor = this.getRangeChangeDescriptor(token);
|
70
|
+
|
71
|
+
var listeners;
|
72
|
+
if (beforeChange) {
|
73
|
+
listeners = descriptor.willChangeListeners;
|
74
|
+
} else {
|
75
|
+
listeners = descriptor.changeListeners;
|
76
|
+
}
|
77
|
+
|
78
|
+
var index = listeners.lastIndexOf(listener);
|
79
|
+
if (index === -1) {
|
80
|
+
throw new Error("Can't remove listener: does not exist.");
|
81
|
+
}
|
82
|
+
listeners.splice(index, 1);
|
83
|
+
};
|
84
|
+
|
85
|
+
RangeChanges.prototype.dispatchRangeChange = function (plus, minus, index, beforeChange) {
|
86
|
+
var descriptors = this.getAllRangeChangeDescriptors();
|
87
|
+
var changeName = "Range" + (beforeChange ? "WillChange" : "Change");
|
88
|
+
descriptors.forEach(function (descriptor, token) {
|
89
|
+
|
90
|
+
if (descriptor.isActive) {
|
91
|
+
return;
|
92
|
+
} else {
|
93
|
+
descriptor.isActive = true;
|
94
|
+
}
|
95
|
+
|
96
|
+
// before or after
|
97
|
+
var listeners;
|
98
|
+
if (beforeChange) {
|
99
|
+
listeners = descriptor.willChangeListeners;
|
100
|
+
} else {
|
101
|
+
listeners = descriptor.changeListeners;
|
102
|
+
}
|
103
|
+
|
104
|
+
var tokenName = "handle" + (
|
105
|
+
token.slice(0, 1).toUpperCase() +
|
106
|
+
token.slice(1)
|
107
|
+
) + changeName;
|
108
|
+
// notably, defaults to "handleRangeChange" or "handleRangeWillChange"
|
109
|
+
// if token is "" (the default)
|
110
|
+
|
111
|
+
// dispatch each listener
|
112
|
+
try {
|
113
|
+
listeners.forEach(function (listener) {
|
114
|
+
if (listener[tokenName]) {
|
115
|
+
listener[tokenName](plus, minus, index, this, beforeChange);
|
116
|
+
} else if (listener.call) {
|
117
|
+
listener.call(this, plus, minus, index, this, beforeChange);
|
118
|
+
} else {
|
119
|
+
throw new Error("Handler " + listener + " has no method " + tokenName + " and is not callable");
|
120
|
+
}
|
121
|
+
}, this);
|
122
|
+
} finally {
|
123
|
+
descriptor.isActive = false;
|
124
|
+
}
|
125
|
+
}, this);
|
126
|
+
};
|
127
|
+
|
128
|
+
RangeChanges.prototype.addBeforeRangeChangeListener = function (listener, token) {
|
129
|
+
return this.addRangeChangeListener(listener, token, true);
|
130
|
+
};
|
131
|
+
|
132
|
+
RangeChanges.prototype.removeBeforeRangeChangeListener = function (listener, token) {
|
133
|
+
return this.removeRangeChangeListener(listener, token, true);
|
134
|
+
};
|
135
|
+
|
136
|
+
RangeChanges.prototype.dispatchBeforeRangeChange = function (plus, minus, index) {
|
137
|
+
return this.dispatchRangeChange(plus, minus, index, true);
|
138
|
+
};
|
139
|
+
|
@@ -0,0 +1,79 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var Shim = require("./shim");
|
4
|
+
var LruSet = require("./lru-set");
|
5
|
+
var GenericCollection = require("./generic-collection");
|
6
|
+
var GenericMap = require("./generic-map");
|
7
|
+
var PropertyChanges = require("./listen/property-changes");
|
8
|
+
|
9
|
+
module.exports = LruMap;
|
10
|
+
|
11
|
+
function LruMap(values, maxLength, equals, hash, getDefault) {
|
12
|
+
if (!(this instanceof LruMap)) {
|
13
|
+
return new LruMap(values, maxLength, equals, hash, getDefault);
|
14
|
+
}
|
15
|
+
equals = equals || Object.equals;
|
16
|
+
hash = hash || Object.hash;
|
17
|
+
getDefault = getDefault || Function.noop;
|
18
|
+
this.contentEquals = equals;
|
19
|
+
this.contentHash = hash;
|
20
|
+
this.getDefault = getDefault;
|
21
|
+
this.store = new LruSet(
|
22
|
+
undefined,
|
23
|
+
maxLength,
|
24
|
+
function keysEqual(a, b) {
|
25
|
+
return equals(a.key, b.key);
|
26
|
+
},
|
27
|
+
function keyHash(item) {
|
28
|
+
return hash(item.key);
|
29
|
+
}
|
30
|
+
);
|
31
|
+
this.length = 0;
|
32
|
+
this.addEach(values);
|
33
|
+
}
|
34
|
+
|
35
|
+
LruMap.LruMap = LruMap; // hack so require("lru-map").LruMap will work in MontageJS
|
36
|
+
|
37
|
+
Object.addEach(LruMap.prototype, GenericCollection.prototype);
|
38
|
+
Object.addEach(LruMap.prototype, GenericMap.prototype);
|
39
|
+
Object.addEach(LruMap.prototype, PropertyChanges.prototype);
|
40
|
+
|
41
|
+
LruMap.prototype.constructClone = function (values) {
|
42
|
+
return new this.constructor(
|
43
|
+
values,
|
44
|
+
this.maxLength,
|
45
|
+
this.contentEquals,
|
46
|
+
this.contentHash,
|
47
|
+
this.getDefault
|
48
|
+
);
|
49
|
+
};
|
50
|
+
|
51
|
+
LruMap.prototype.log = function (charmap, stringify) {
|
52
|
+
stringify = stringify || this.stringify;
|
53
|
+
this.store.log(charmap, stringify);
|
54
|
+
};
|
55
|
+
|
56
|
+
LruMap.prototype.stringify = function (item, leader) {
|
57
|
+
return leader + JSON.stringify(item.key) + ": " + JSON.stringify(item.value);
|
58
|
+
};
|
59
|
+
|
60
|
+
LruMap.prototype.addMapChangeListener = function () {
|
61
|
+
if (!this.dispatchesMapChanges) {
|
62
|
+
// Detect LRU deletions in the LruSet and emit as MapChanges.
|
63
|
+
// Array and Heap have no store.
|
64
|
+
// Dict and FastMap define no listeners on their store.
|
65
|
+
var self = this;
|
66
|
+
this.store.addBeforeRangeChangeListener(function(plus, minus) {
|
67
|
+
if (plus.length && minus.length) { // LRU item pruned
|
68
|
+
self.dispatchBeforeMapChange(minus[0].key, undefined);
|
69
|
+
}
|
70
|
+
});
|
71
|
+
this.store.addRangeChangeListener(function(plus, minus) {
|
72
|
+
if (plus.length && minus.length) {
|
73
|
+
self.dispatchMapChange(minus[0].key, undefined);
|
74
|
+
}
|
75
|
+
});
|
76
|
+
}
|
77
|
+
GenericMap.prototype.addMapChangeListener.apply(this, arguments);
|
78
|
+
};
|
79
|
+
|
@@ -0,0 +1,142 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var Shim = require("./shim");
|
4
|
+
var Set = require("./set");
|
5
|
+
var GenericCollection = require("./generic-collection");
|
6
|
+
var GenericSet = require("./generic-set");
|
7
|
+
var PropertyChanges = require("./listen/property-changes");
|
8
|
+
var RangeChanges = require("./listen/range-changes");
|
9
|
+
|
10
|
+
module.exports = LruSet;
|
11
|
+
|
12
|
+
function LruSet(values, maxLength, equals, hash, getDefault) {
|
13
|
+
if (!(this instanceof LruSet)) {
|
14
|
+
return new LruSet(values, maxLength, equals, hash, getDefault);
|
15
|
+
}
|
16
|
+
maxLength = maxLength || Infinity;
|
17
|
+
equals = equals || Object.equals;
|
18
|
+
hash = hash || Object.hash;
|
19
|
+
getDefault = getDefault || Function.noop;
|
20
|
+
this.store = new Set(undefined, equals, hash);
|
21
|
+
this.contentEquals = equals;
|
22
|
+
this.contentHash = hash;
|
23
|
+
this.getDefault = getDefault;
|
24
|
+
this.maxLength = maxLength;
|
25
|
+
this.length = 0;
|
26
|
+
this.addEach(values);
|
27
|
+
}
|
28
|
+
|
29
|
+
LruSet.LruSet = LruSet; // hack so require("lru-set").LruSet will work in MontageJS
|
30
|
+
|
31
|
+
Object.addEach(LruSet.prototype, GenericCollection.prototype);
|
32
|
+
Object.addEach(LruSet.prototype, GenericSet.prototype);
|
33
|
+
Object.addEach(LruSet.prototype, PropertyChanges.prototype);
|
34
|
+
Object.addEach(LruSet.prototype, RangeChanges.prototype);
|
35
|
+
|
36
|
+
LruSet.prototype.constructClone = function (values) {
|
37
|
+
return new this.constructor(
|
38
|
+
values,
|
39
|
+
this.maxLength,
|
40
|
+
this.contentEquals,
|
41
|
+
this.contentHash,
|
42
|
+
this.getDefault
|
43
|
+
);
|
44
|
+
};
|
45
|
+
|
46
|
+
LruSet.prototype.has = function (value) {
|
47
|
+
return this.store.has(value);
|
48
|
+
};
|
49
|
+
|
50
|
+
LruSet.prototype.get = function (value) {
|
51
|
+
value = this.store.get(value);
|
52
|
+
if (value !== undefined) {
|
53
|
+
this.store["delete"](value);
|
54
|
+
this.store.add(value);
|
55
|
+
} else {
|
56
|
+
value = this.getDefault(value);
|
57
|
+
}
|
58
|
+
return value;
|
59
|
+
};
|
60
|
+
|
61
|
+
LruSet.prototype.add = function (value) {
|
62
|
+
var found = this.store.has(value);
|
63
|
+
var plus = [], minus = [], eldest;
|
64
|
+
// if the value already exists, we delete it and add it back again so it
|
65
|
+
// appears at the end of the list of values to truncate
|
66
|
+
if (found) { // update
|
67
|
+
this.store["delete"](value);
|
68
|
+
this.store.add(value);
|
69
|
+
} else if (this.maxLength > 0) { // add
|
70
|
+
// because minus is constructed before adding value, we must ensure the
|
71
|
+
// set has positive length. hence the maxLength check.
|
72
|
+
plus.push(value);
|
73
|
+
if (this.length >= this.maxLength) {
|
74
|
+
eldest = this.store.order.head.next;
|
75
|
+
minus.push(eldest.value);
|
76
|
+
}
|
77
|
+
if (this.dispatchesRangeChanges) {
|
78
|
+
this.dispatchBeforeRangeChange(plus, minus, 0);
|
79
|
+
}
|
80
|
+
this.store.add(value);
|
81
|
+
if (minus.length > 0) {
|
82
|
+
this.store['delete'](eldest.value);
|
83
|
+
}
|
84
|
+
// only assign to length once to avoid jitter on length observers
|
85
|
+
this.length = this.length + plus.length - minus.length;
|
86
|
+
// after change
|
87
|
+
if (this.dispatchesRangeChanges) {
|
88
|
+
this.dispatchRangeChange(plus, minus, 0);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
// whether it grew
|
92
|
+
return plus.length !== minus.length;
|
93
|
+
};
|
94
|
+
|
95
|
+
LruSet.prototype["delete"] = function (value) {
|
96
|
+
var found = this.store.has(value);
|
97
|
+
if (found) {
|
98
|
+
if (this.dispatchesRangeChanges) {
|
99
|
+
this.dispatchBeforeRangeChange([], [value], 0);
|
100
|
+
}
|
101
|
+
this.store["delete"](value);
|
102
|
+
this.length--;
|
103
|
+
if (this.dispatchesRangeChanges) {
|
104
|
+
this.dispatchRangeChange([], [value], 0);
|
105
|
+
}
|
106
|
+
}
|
107
|
+
return found;
|
108
|
+
};
|
109
|
+
|
110
|
+
LruSet.prototype.one = function () {
|
111
|
+
if (this.length > 0) {
|
112
|
+
return this.store.one();
|
113
|
+
}
|
114
|
+
};
|
115
|
+
|
116
|
+
LruSet.prototype.clear = function () {
|
117
|
+
this.store.clear();
|
118
|
+
this.length = 0;
|
119
|
+
};
|
120
|
+
|
121
|
+
LruSet.prototype.reduce = function (callback, basis /*, thisp*/) {
|
122
|
+
var thisp = arguments[2];
|
123
|
+
var set = this.store;
|
124
|
+
var index = 0;
|
125
|
+
return set.reduce(function (basis, value) {
|
126
|
+
return callback.call(thisp, basis, value, index++, this);
|
127
|
+
}, basis, this);
|
128
|
+
};
|
129
|
+
|
130
|
+
LruSet.prototype.reduceRight = function (callback, basis /*, thisp*/) {
|
131
|
+
var thisp = arguments[2];
|
132
|
+
var set = this.store;
|
133
|
+
var index = this.length - 1;
|
134
|
+
return set.reduceRight(function (basis, value) {
|
135
|
+
return callback.call(thisp, basis, value, index--, this);
|
136
|
+
}, basis, this);
|
137
|
+
};
|
138
|
+
|
139
|
+
LruSet.prototype.iterate = function () {
|
140
|
+
return this.store.iterate();
|
141
|
+
};
|
142
|
+
|
@@ -0,0 +1,60 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var Shim = require("./shim");
|
4
|
+
var Set = require("./set");
|
5
|
+
var GenericCollection = require("./generic-collection");
|
6
|
+
var GenericMap = require("./generic-map");
|
7
|
+
var PropertyChanges = require("./listen/property-changes");
|
8
|
+
|
9
|
+
module.exports = Map;
|
10
|
+
|
11
|
+
function Map(values, equals, hash, getDefault) {
|
12
|
+
if (!(this instanceof Map)) {
|
13
|
+
return new Map(values, equals, hash, getDefault);
|
14
|
+
}
|
15
|
+
equals = equals || Object.equals;
|
16
|
+
hash = hash || Object.hash;
|
17
|
+
getDefault = getDefault || Function.noop;
|
18
|
+
this.contentEquals = equals;
|
19
|
+
this.contentHash = hash;
|
20
|
+
this.getDefault = getDefault;
|
21
|
+
this.store = new Set(
|
22
|
+
undefined,
|
23
|
+
function keysEqual(a, b) {
|
24
|
+
return equals(a.key, b.key);
|
25
|
+
},
|
26
|
+
function keyHash(item) {
|
27
|
+
return hash(item.key);
|
28
|
+
}
|
29
|
+
);
|
30
|
+
this.length = 0;
|
31
|
+
this.addEach(values);
|
32
|
+
}
|
33
|
+
|
34
|
+
Map.Map = Map; // hack so require("map").Map will work in MontageJS
|
35
|
+
|
36
|
+
Object.addEach(Map.prototype, GenericCollection.prototype);
|
37
|
+
Object.addEach(Map.prototype, GenericMap.prototype); // overrides GenericCollection
|
38
|
+
Object.addEach(Map.prototype, PropertyChanges.prototype);
|
39
|
+
|
40
|
+
Map.prototype.constructClone = function (values) {
|
41
|
+
return new this.constructor(
|
42
|
+
values,
|
43
|
+
this.contentEquals,
|
44
|
+
this.contentHash,
|
45
|
+
this.getDefault
|
46
|
+
);
|
47
|
+
};
|
48
|
+
|
49
|
+
Map.prototype.log = function (charmap, logNode, callback, thisp) {
|
50
|
+
logNode = logNode || this.logNode;
|
51
|
+
this.store.log(charmap, function (node, log, logBefore) {
|
52
|
+
logNode(node.value.value, log, logBefore);
|
53
|
+
}, callback, thisp);
|
54
|
+
};
|
55
|
+
|
56
|
+
Map.prototype.logNode = function (node, log) {
|
57
|
+
log(' key: ' + node.key);
|
58
|
+
log(' value: ' + node.value);
|
59
|
+
};
|
60
|
+
|
@@ -0,0 +1,41 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var Map = require("./map");
|
4
|
+
|
5
|
+
module.exports = MultiMap;
|
6
|
+
function MultiMap(values, bucket, equals, hash) {
|
7
|
+
if (!(this instanceof MultiMap)) {
|
8
|
+
return new MultiMap(values, bucket, equals, hash);
|
9
|
+
}
|
10
|
+
this.bucket = bucket || this.bucket;
|
11
|
+
Map.call(this, values, equals, hash, function getDefault(key) {
|
12
|
+
var bucket = this.bucket();
|
13
|
+
Map.prototype.set.call(this, key, bucket);
|
14
|
+
return bucket;
|
15
|
+
});
|
16
|
+
}
|
17
|
+
|
18
|
+
MultiMap.MultiMap = MultiMap; // hack so require("multi-map").MultiMap will work in MontageJS
|
19
|
+
|
20
|
+
MultiMap.prototype = Object.create(Map.prototype);
|
21
|
+
|
22
|
+
MultiMap.prototype.constructor = MultiMap;
|
23
|
+
|
24
|
+
MultiMap.prototype.constructClone = function (values) {
|
25
|
+
return new this.constructor(
|
26
|
+
values,
|
27
|
+
this.bucket,
|
28
|
+
this.contentEquals,
|
29
|
+
this.contentHash
|
30
|
+
);
|
31
|
+
};
|
32
|
+
|
33
|
+
MultiMap.prototype.set = function (key, newValues) {
|
34
|
+
var values = this.get(key);
|
35
|
+
values.swap(0, values.length, newValues);
|
36
|
+
};
|
37
|
+
|
38
|
+
MultiMap.prototype.bucket = function (key) {
|
39
|
+
return [];
|
40
|
+
};
|
41
|
+
|