├── examples └── bench │ ├── package.json │ └── json-parse.js ├── test ├── net │ ├── package.json │ ├── dns.js │ ├── http-get.js │ ├── http-get-query.js │ ├── http-req-ip.js │ └── http-md5.js ├── issues │ ├── 161 │ │ ├── examples │ │ │ └── foo.js │ │ ├── node_modules │ │ │ └── test │ │ │ │ └── package.json │ │ └── package.json │ ├── 170 │ │ ├── test.js │ │ ├── runtime-170 │ │ │ └── test-subfolder │ │ │ │ └── subfolder.js │ │ └── runtime_170 │ │ │ └── test-subfolder │ │ │ └── subfolder.js │ ├── issue-runtime-686.js │ ├── issue-beta-327.js │ ├── issue-beta-243.js │ ├── issue-beta-402.js │ ├── issue-beta-170.js │ ├── issue-runtime-420.js │ ├── issue-beta-351.js │ ├── issue-beta-356.js │ ├── issue-beta-245.js │ ├── issue-beta-294.js │ ├── issue-runtime-199.js │ ├── log-global.js │ ├── issue-beta-274.js │ ├── issue-beta-87.js │ ├── issue-runtime-173.js │ ├── issue-beta-200.js │ ├── issue-beta-251.js │ ├── issue-runtime-292.js │ ├── issue-runtime-305.js │ ├── issue-runtime-191.js │ ├── issue-runtime-159.js │ ├── issue-runtime-362.js │ ├── issue-runtime-190.js │ ├── issue-runtime-612.js │ ├── issue-runtime-117.js │ ├── issue-runtime-122.js │ ├── issue-beta-148.js │ ├── issue-runtime-385.js │ ├── issue-beta-244.js │ ├── issue-runtime-473.js │ ├── issue-beta-204.js │ ├── issue-beta-338.js │ ├── issue-beta-339.js │ ├── issue-beta-131.js │ ├── issue-runtime-419.js │ ├── issue-beta-221.js │ ├── issue-runtime-146.js │ ├── issue-runtime-297.js │ ├── issue-beta-352.js │ ├── issue-runtime-107.js │ ├── issue-runtime-150.js │ ├── issue-beta-93.js │ ├── issue-runtime-133.js │ ├── issue-runtime-244.js │ ├── issue-runtime-437.js │ ├── issue-runtime-434.js │ ├── issue-beta-100.js │ ├── issue-runtime-368.js │ ├── issue-beta-108.js │ ├── issue-beta-180b.js │ ├── issue-beta-366.js │ ├── issue-beta-440.js │ ├── issue-runtime-314.js │ ├── issue-runtime-276.js │ ├── issue-runtime-611.js │ ├── issue-runtime-652.js │ ├── issue-beta-98.js │ ├── issue-beta-451.js │ ├── issue-runtime-170.js │ ├── issue-runtime-246.js │ ├── issue-runtime-506.js │ ├── issue-beta-276.js │ ├── issue-runtime-109.js │ ├── issue-runtime-529.js │ ├── issue-beta-380.js │ ├── issue-runtime-296.js │ ├── issue-beta-207.js │ ├── issue-runtime-295.js │ ├── issue-runtime-307.js │ ├── issue-runtime-204.js │ ├── issue-beta-395.js │ ├── issue-runtime-360.js │ ├── issue-runtime-177.js │ ├── issue-beta-314.js │ ├── issue-beta-101.js │ ├── issue-beta-337.js │ ├── issue-runtime-298.js │ ├── issue-runtime-548.js │ ├── issue-beta-180.js │ ├── issue-beta-390.js │ ├── issue-runtime-628.js │ ├── issue-beta-159.js │ ├── issue-runtime-320.js │ ├── issue-beta-379.js │ ├── issue-runtime-134.js │ ├── issue-runtime-208.js │ ├── issue-runtime-185.js │ ├── issue-beta-446.js │ ├── issue-beta-77.js │ ├── issue-runtime-269.js │ ├── issue-runtime-337.js │ ├── issue-beta-317.js │ ├── issue-runtime-156.js │ ├── issue-runtime-158.js │ ├── issue-runtime-397.js │ ├── issue-runtime-186.js │ ├── issue-runtime-345.js │ ├── issue-runtime-450.js │ ├── issue-runtime-491.js │ ├── issue-beta-296.js │ ├── issue-beta-84.js │ ├── issue-runtime-234.js │ ├── issue-runtime-361.js │ ├── issue-beta-195.js │ ├── issue-runtime-487.js │ ├── issue-beta-340.js │ ├── issue-runtime-223.js │ ├── issue-beta-319.js │ ├── issue-beta-97.js │ ├── issue-runtime-534.js │ ├── issue-runtime-605.js │ ├── out.txt │ ├── issue-runtime-472.js │ ├── issue-runtime-659.js │ ├── issue-beta-213.js │ ├── issue-beta-162.js │ ├── issue-beta-140.js │ ├── issue-beta-342.js │ ├── issue-runtime-239.js │ ├── issue-beta-179.js │ ├── issue-beta-394.js │ ├── issue-beta-73.js │ ├── issue-beta-212.js │ ├── issue-runtime-303.js │ ├── issue-runtime-302.js │ ├── issue-runtime-306.js │ ├── issue-beta-81.js │ ├── issue-runtime-448.js │ ├── issue-runtime-304.js │ ├── issue-runtime-373.js │ ├── issue-runtime-287.js │ └── issue-beta-334.js ├── suite │ ├── jsonload-json.json │ ├── files_fs │ │ └── hello.txt │ ├── package.json │ ├── bug-regexreplace.js │ ├── unicode.js │ ├── bug-foreach-null.js │ ├── function.js │ ├── jsonload.js │ ├── delete.js │ ├── early-return.js │ ├── number.js │ ├── defineProperty.js │ ├── bug-bindnull.js │ ├── __proto__.js │ ├── builtin.js │ ├── arguments.js │ ├── https.js │ ├── string-decoder.js │ ├── console.js │ ├── bug-endwithcomments.js │ ├── try.js │ ├── bug-forinarray.js │ ├── require.js │ ├── event-error.js │ ├── keywords.js │ ├── process.js │ ├── tls.js │ ├── streams.js │ ├── parse-numbers.js │ ├── with.js │ ├── hash.js │ ├── etters.js │ ├── truthy.js │ ├── bind.js │ ├── hasOwnProperty.js │ ├── url.js │ ├── timers.js │ ├── math.js │ └── bug-underscores.js ├── modules │ ├── async │ │ └── index.js │ ├── express │ │ └── test.js │ ├── faye-websockets │ │ └── faye.js │ └── nodejs-websocket.js ├── todo │ ├── error.js │ ├── stdin.js │ ├── issue-beta-448.js │ ├── issue-beta-410.js │ ├── http-server.js │ ├── https-goodcert.js │ ├── https-badcert.js │ ├── https-baddomain.js │ ├── https-sni.js │ ├── https-req-ip.js │ ├── https-get.js │ └── https-fail-sni.js ├── colony │ ├── issue-runtime-620.js │ ├── buffer-limit.js │ ├── eval-fn.js │ ├── issue-runtime-627.js │ └── floatint.js └── tap.js ├── deps ├── axtls │ ├── .gitignore │ ├── ssl │ │ ├── test │ │ │ ├── axTLS.unencrypted.p8.pem │ │ │ ├── gnutls.cer │ │ │ ├── socgen.cer │ │ │ ├── killgnutls.sh │ │ │ ├── killopenssl.sh │ │ │ ├── axTLS.key_1024 │ │ │ ├── axTLS.key_1042 │ │ │ ├── axTLS.key_2048 │ │ │ ├── axTLS.key_4096 │ │ │ ├── axTLS.key_512 │ │ │ ├── equifax.x509_ca │ │ │ ├── thawte.x509_ca │ │ │ ├── axTLS.ca_x509.cer │ │ │ ├── axTLS.device_key │ │ │ ├── axTLS.noname.p12 │ │ │ ├── axTLS.withCA.p12 │ │ │ ├── header_issue.dat │ │ │ ├── microsoft.x509_ca │ │ │ ├── verisign.x509_ca │ │ │ ├── axTLS.encrypted.p8 │ │ │ ├── axTLS.unencrypted.p8 │ │ │ ├── axTLS.withoutCA.p12 │ │ │ ├── axTLS.x509_1024.cer │ │ │ ├── axTLS.x509_1042.cer │ │ │ ├── axTLS.x509_2048.cer │ │ │ ├── axTLS.x509_4096.cer │ │ │ ├── axTLS.x509_512.cer │ │ │ ├── qualityssl.com.der │ │ │ ├── axTLS.x509_device.cer │ │ │ ├── verisign.x509_my_cert │ │ │ ├── deutsche_telecom.x509_ca │ │ │ ├── .axTLS.unencrypted_pem.p8.swp │ │ │ ├── axTLS.key_512.pem │ │ │ ├── axTLS.unencrypted_pem.p8 │ │ │ ├── axTLS.key_aes128.pem │ │ │ ├── axTLS.encrypted_pem.p8 │ │ │ ├── axTLS.key_aes256.pem │ │ │ ├── axTLS.x509_512.pem │ │ │ ├── axTLS.x509_aes128.pem │ │ │ ├── axTLS.x509_aes256.pem │ │ │ ├── axTLS.x509_bad_after.pem │ │ │ ├── axTLS.x509_bad_before.pem │ │ │ ├── axTLS.x509_1024.pem │ │ │ ├── axTLS.x509_1042.pem │ │ │ ├── axTLS.ca_x509.pem │ │ │ ├── ms_iis.cer │ │ │ ├── axTLS.x509_2048.pem │ │ │ ├── axTLS.ca_key.pem │ │ │ ├── axTLS.device_key.pem │ │ │ ├── axTLS.key_1024.pem │ │ │ ├── axTLS.key_1042.pem │ │ │ ├── verisign.x509_ca.pem │ │ │ ├── cert.pem │ │ │ ├── axTLS.x509_4096.pem │ │ │ └── axTLS.x509_device.pem │ │ └── version.h │ ├── www │ │ ├── bin │ │ │ └── .htaccess │ │ ├── test_dir │ │ │ ├── bin │ │ │ │ └── .htaccess │ │ │ ├── no_ssl │ │ │ │ ├── .htaccess │ │ │ │ └── index.html │ │ │ └── no_http │ │ │ │ ├── .htaccess │ │ │ │ ├── .htpasswd │ │ │ │ └── index.html │ │ ├── favicon.ico │ │ └── lua │ │ │ ├── test_htk.lua │ │ │ ├── test_err.lua │ │ │ ├── test_cookies.lp │ │ │ ├── test_cookies.lua │ │ │ ├── test_sql.lua │ │ │ ├── test_main.lp │ │ │ ├── test_fs.lua │ │ │ ├── prepara_sql2.lua │ │ │ ├── test_sql2.lua │ │ │ ├── test_variables.lp │ │ │ ├── env.lua │ │ │ ├── test_conc.lua │ │ │ ├── test_lib.lua │ │ │ ├── test_session.lua │ │ │ └── test_main.lua │ ├── samples │ │ └── java │ │ │ └── manifest.mf │ ├── config │ │ ├── .gitignore │ │ ├── axtls.RES │ │ ├── scripts │ │ │ └── config │ │ │ │ └── lxdialog │ │ │ │ └── BIG.FAT.WARNING │ │ ├── makefile.post │ │ └── axtls.rc │ ├── README │ ├── docsrc │ │ ├── doco_footer.html │ │ └── images │ │ │ ├── axolotl.jpg │ │ │ └── tsbasbw.gif │ ├── httpd │ │ └── kepler-1.1-snapshot-20070521-1825.tar.gz │ └── binding.gyp ├── fortuna-inc │ └── malloc_np.h ├── cacert │ ├── .gitignore │ └── README.md ├── fatfs │ ├── doc │ │ ├── css_j.css │ │ ├── img │ │ │ ├── f1.png │ │ │ ├── f2.png │ │ │ ├── f3.png │ │ │ ├── f4.png │ │ │ ├── f5.png │ │ │ ├── f6.png │ │ │ ├── f7.png │ │ │ ├── layers.png │ │ │ ├── layers3.png │ │ │ ├── modules.png │ │ │ ├── rwtest.png │ │ │ ├── rwtest2.png │ │ │ ├── rwtest3.png │ │ │ └── app1.c │ │ ├── ja │ │ │ ├── eof.html │ │ │ ├── gets.html │ │ │ ├── mkfs.html │ │ │ ├── open.html │ │ │ ├── putc.html │ │ │ ├── puts.html │ │ │ ├── read.html │ │ │ ├── sdir.html │ │ │ ├── size.html │ │ │ ├── stat.html │ │ │ ├── sync.html │ │ │ ├── tell.html │ │ │ ├── chdir.html │ │ │ ├── chdrive.html │ │ │ ├── chmod.html │ │ │ ├── close.html │ │ │ ├── dinit.html │ │ │ ├── dioctl.html │ │ │ ├── dread.html │ │ │ ├── dstat.html │ │ │ ├── dwrite.html │ │ │ ├── error.html │ │ │ ├── fattime.html │ │ │ ├── fdisk.html │ │ │ ├── forward.html │ │ │ ├── getcwd.html │ │ │ ├── getfree.html │ │ │ ├── lseek.html │ │ │ ├── mkdir.html │ │ │ ├── mount.html │ │ │ ├── opendir.html │ │ │ ├── printf.html │ │ │ ├── readdir.html │ │ │ ├── rename.html │ │ │ ├── sfatfs.html │ │ │ ├── sfile.html │ │ │ ├── unlink.html │ │ │ ├── utime.html │ │ │ ├── write.html │ │ │ ├── closedir.html │ │ │ ├── getlabel.html │ │ │ ├── setlabel.html │ │ │ ├── sfileinfo.html │ │ │ └── truncate.html │ │ └── 00index_j.html │ └── src │ │ ├── option │ │ └── unicode.c │ │ └── integer.h ├── miniz-inc │ └── miniz.h ├── luabitop-1.0 │ ├── doc │ │ └── img │ │ │ └── contact.png │ ├── msvctest.bat │ ├── installpath.lua │ ├── README │ ├── nsievebits.lua │ ├── msvcbuild.bat │ └── Makefile.mingw ├── approxidate │ ├── README.md │ ├── approxidate.h │ └── COPYING └── node-libs │ ├── constants.js │ └── sys.js ├── src ├── colony │ ├── modules │ │ ├── child_process.js │ │ ├── domain.js │ │ ├── tty.js │ │ ├── buffer.js │ │ ├── repl.js │ │ ├── console.js │ │ └── dns.js │ ├── lua_tm.h │ ├── lua_bit.h │ ├── lua_hsregex.h │ ├── lua_rapidjson.h │ ├── lua │ │ └── colony.lua │ └── lua_http_parser.h ├── std.cpp ├── dlmallocfork.h ├── posix │ └── tm_timestamp.c ├── order32.h └── tm_itoa.c ├── tools ├── colony-compiler-correct.js ├── tap-colony.sh ├── colony-compiler-correct.sh ├── luajit-build.sh └── compile_certs.js ├── etc ├── tcp_test └── make.sh ├── .clang-format ├── .gitignore ├── CONTRIBUTORS ├── NOTES ├── COPYRIGHT ├── config ├── libtm-test.gyp └── colony.gyp ├── bench └── test.js ├── .travis.yml ├── .gitmodules ├── package.json ├── LICENSE-MIT └── bin └── colony-profile.js /examples/bench/package.json: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/net/package.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /deps/axtls/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /deps/fortuna-inc/malloc_np.h: -------------------------------------------------------------------------------- 1 | // noop -------------------------------------------------------------------------------- /src/colony/modules/child_process.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.unencrypted.p8.pem: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /deps/axtls/www/bin/.htaccess: -------------------------------------------------------------------------------- 1 | Deny all 2 | 3 | -------------------------------------------------------------------------------- /test/issues/170/test.js: -------------------------------------------------------------------------------- 1 | module.exports = true; -------------------------------------------------------------------------------- /deps/axtls/www/test_dir/bin/.htaccess: -------------------------------------------------------------------------------- 1 | Deny all 2 | -------------------------------------------------------------------------------- /deps/cacert/.gitignore: -------------------------------------------------------------------------------- 1 | extract-nss-root-certs 2 | -------------------------------------------------------------------------------- /deps/axtls/samples/java/manifest.mf: -------------------------------------------------------------------------------- 1 | Main-Class: axssl 2 | -------------------------------------------------------------------------------- /deps/axtls/www/test_dir/no_ssl/.htaccess: -------------------------------------------------------------------------------- 1 | SSLDenySSL 2 | -------------------------------------------------------------------------------- /test/suite/jsonload-json.json: -------------------------------------------------------------------------------- 1 | { 2 | "hello": "hi" 3 | } -------------------------------------------------------------------------------- /tools/colony-compiler-correct.js: -------------------------------------------------------------------------------- 1 | console.log('ok'); 2 | -------------------------------------------------------------------------------- /deps/axtls/ssl/version.h: -------------------------------------------------------------------------------- 1 | #define AXTLS_VERSION "1.4.9" 2 | -------------------------------------------------------------------------------- /deps/axtls/www/test_dir/no_http/.htaccess: -------------------------------------------------------------------------------- 1 | SSLRequireSSL 2 | -------------------------------------------------------------------------------- /test/issues/161/examples/foo.js: -------------------------------------------------------------------------------- 1 | var test = require('test'); 2 | -------------------------------------------------------------------------------- /deps/axtls/config/.gitignore: -------------------------------------------------------------------------------- 1 | .config 2 | .config.tmp 3 | scripts 4 | -------------------------------------------------------------------------------- /deps/cacert/README.md: -------------------------------------------------------------------------------- 1 | Use https://github.com/agl/extract-nss-root-certs 2 | -------------------------------------------------------------------------------- /etc/tcp_test: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/etc/tcp_test -------------------------------------------------------------------------------- /test/suite/files_fs/hello.txt: -------------------------------------------------------------------------------- 1 | # hello world 2 | 3 | This is plaintext markdown 4 | 5 | -------------------------------------------------------------------------------- /test/issues/170/runtime-170/test-subfolder/subfolder.js: -------------------------------------------------------------------------------- 1 | module.exports = require('../../test'); -------------------------------------------------------------------------------- /test/issues/170/runtime_170/test-subfolder/subfolder.js: -------------------------------------------------------------------------------- 1 | module.exports = require('../../test'); -------------------------------------------------------------------------------- /test/modules/async/index.js: -------------------------------------------------------------------------------- 1 | var async = require('async'); 2 | console.log('async required.') 3 | -------------------------------------------------------------------------------- /deps/axtls/README: -------------------------------------------------------------------------------- 1 | 2 | See www/index.html for the README, CHANGELOG, LICENSE and other notes. 3 | 4 | -------------------------------------------------------------------------------- /deps/fatfs/doc/css_j.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/css_j.css -------------------------------------------------------------------------------- /deps/fatfs/doc/img/f1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/f1.png -------------------------------------------------------------------------------- /deps/fatfs/doc/img/f2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/f2.png -------------------------------------------------------------------------------- /deps/fatfs/doc/img/f3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/f3.png -------------------------------------------------------------------------------- /deps/fatfs/doc/img/f4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/f4.png -------------------------------------------------------------------------------- /deps/fatfs/doc/img/f5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/f5.png -------------------------------------------------------------------------------- /deps/fatfs/doc/img/f6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/f6.png -------------------------------------------------------------------------------- /deps/fatfs/doc/img/f7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/f7.png -------------------------------------------------------------------------------- /deps/axtls/config/axtls.RES: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/config/axtls.RES -------------------------------------------------------------------------------- /deps/axtls/www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/www/favicon.ico -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/eof.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/eof.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/gets.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/gets.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/mkfs.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/mkfs.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/open.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/open.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/putc.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/putc.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/puts.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/puts.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/read.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/read.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/sdir.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/sdir.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/size.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/size.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/stat.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/stat.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/sync.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/sync.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/tell.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/tell.html -------------------------------------------------------------------------------- /test/todo/error.js: -------------------------------------------------------------------------------- 1 | function EXAMPLE () { 2 | throw new Error('backtrace example'); 3 | } 4 | 5 | EXAMPLE(); -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: WebKit 2 | UseTab: ForIndentation 3 | IndentWidth: 8 4 | MaxEmptyLinesToKeep: 2 5 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/gnutls.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/gnutls.cer -------------------------------------------------------------------------------- /deps/axtls/ssl/test/socgen.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/socgen.cer -------------------------------------------------------------------------------- /deps/fatfs/doc/00index_j.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/00index_j.html -------------------------------------------------------------------------------- /deps/fatfs/doc/img/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/layers.png -------------------------------------------------------------------------------- /deps/fatfs/doc/img/layers3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/layers3.png -------------------------------------------------------------------------------- /deps/fatfs/doc/img/modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/modules.png -------------------------------------------------------------------------------- /deps/fatfs/doc/img/rwtest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/rwtest.png -------------------------------------------------------------------------------- /deps/fatfs/doc/img/rwtest2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/rwtest2.png -------------------------------------------------------------------------------- /deps/fatfs/doc/img/rwtest3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/img/rwtest3.png -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/chdir.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/chdir.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/chdrive.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/chdrive.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/chmod.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/chmod.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/close.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/close.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/dinit.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/dinit.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/dioctl.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/dioctl.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/dread.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/dread.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/dstat.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/dstat.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/dwrite.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/dwrite.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/error.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/error.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/fattime.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/fattime.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/fdisk.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/fdisk.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/forward.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/forward.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/getcwd.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/getcwd.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/getfree.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/getfree.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/lseek.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/lseek.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/mkdir.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/mkdir.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/mount.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/mount.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/opendir.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/opendir.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/printf.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/printf.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/readdir.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/readdir.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/rename.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/rename.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/sfatfs.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/sfatfs.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/sfile.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/sfile.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/unlink.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/unlink.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/utime.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/utime.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/write.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/write.html -------------------------------------------------------------------------------- /test/suite/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "hardware": { "./express": false, "./colony": false, "./todo": false } 3 | } 4 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/killgnutls.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ps -ef|grep gnutls-serv | /usr/bin/awk '{print $2}' |xargs kill -9 3 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/killopenssl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ps -ef|grep openssl | /usr/bin/awk '{print $2}' |xargs kill -9 3 | -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_htk.lua: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/www/lua/test_htk.lua -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/closedir.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/closedir.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/getlabel.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/getlabel.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/setlabel.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/setlabel.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/sfileinfo.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/sfileinfo.html -------------------------------------------------------------------------------- /deps/fatfs/doc/ja/truncate.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/fatfs/doc/ja/truncate.html -------------------------------------------------------------------------------- /deps/axtls/docsrc/doco_footer.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/docsrc/doco_footer.html -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.key_1024: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.key_1024 -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.key_1042: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.key_1042 -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.key_2048: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.key_2048 -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.key_4096: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.key_4096 -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.key_512: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.key_512 -------------------------------------------------------------------------------- /deps/axtls/ssl/test/equifax.x509_ca: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/equifax.x509_ca -------------------------------------------------------------------------------- /deps/axtls/ssl/test/thawte.x509_ca: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/thawte.x509_ca -------------------------------------------------------------------------------- /deps/miniz-inc/miniz.h: -------------------------------------------------------------------------------- 1 | #define MINIZ_HEADER_FILE_ONLY 2 | #include "../miniz/miniz.c" 3 | #undef MINIZ_HEADER_FILE_ONLY 4 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-686.js: -------------------------------------------------------------------------------- 1 | console.log('1..1'); 2 | process.stdout.write(Buffer("ok 1 - buffer written to stdout\n")); -------------------------------------------------------------------------------- /deps/axtls/docsrc/images/axolotl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/docsrc/images/axolotl.jpg -------------------------------------------------------------------------------- /deps/axtls/docsrc/images/tsbasbw.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/docsrc/images/tsbasbw.gif -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.ca_x509.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.ca_x509.cer -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.device_key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.device_key -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.noname.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.noname.p12 -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.withCA.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.withCA.p12 -------------------------------------------------------------------------------- /deps/axtls/ssl/test/header_issue.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/header_issue.dat -------------------------------------------------------------------------------- /deps/axtls/ssl/test/microsoft.x509_ca: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/microsoft.x509_ca -------------------------------------------------------------------------------- /deps/axtls/ssl/test/verisign.x509_ca: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/verisign.x509_ca -------------------------------------------------------------------------------- /deps/luabitop-1.0/doc/img/contact.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/luabitop-1.0/doc/img/contact.png -------------------------------------------------------------------------------- /test/issues/issue-beta-327.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | require('tls') 6 | tap.ok(true); 7 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.encrypted.p8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.encrypted.p8 -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.unencrypted.p8: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.unencrypted.p8 -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.withoutCA.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.withoutCA.p12 -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_1024.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.x509_1024.cer -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_1042.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.x509_1042.cer -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_2048.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.x509_2048.cer -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_4096.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.x509_4096.cer -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_512.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.x509_512.cer -------------------------------------------------------------------------------- /deps/axtls/ssl/test/qualityssl.com.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/qualityssl.com.der -------------------------------------------------------------------------------- /test/issues/issue-beta-243.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var tap = require('../tap'); 4 | 5 | tap.count(1); 6 | tap.ok(true); 7 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_device.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/axTLS.x509_device.cer -------------------------------------------------------------------------------- /deps/axtls/ssl/test/verisign.x509_my_cert: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/verisign.x509_my_cert -------------------------------------------------------------------------------- /test/issues/issue-beta-402.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var a = /^\s*$/; 6 | 7 | tap.ok(true); 8 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/deutsche_telecom.x509_ca: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/deutsche_telecom.x509_ca -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_err.lua: -------------------------------------------------------------------------------- 1 | cgilua.htmlheader() 2 | cgilua.put"Oi!" 3 | --io.write"something\n" 4 | cgilua.errorlog ("eca", "emerg") 5 | -------------------------------------------------------------------------------- /src/colony/modules/domain.js: -------------------------------------------------------------------------------- 1 | exports.create = exports.createDomain = function(cb) { 2 | throw new Error("Domain not supported yet...") 3 | }; -------------------------------------------------------------------------------- /test/issues/issue-beta-170.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | tap.ok(a, 'function is hoisted'); 6 | function a () { } -------------------------------------------------------------------------------- /test/issues/issue-runtime-420.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | tap.eq(typeof process.umask(), 'number'); 6 | 7 | -------------------------------------------------------------------------------- /test/todo/stdin.js: -------------------------------------------------------------------------------- 1 | process.stdin.resume(); 2 | process.stdin.on('data', function (buf) { 3 | console.log(buf); 4 | process.stdin.pause(); 5 | }) 6 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/.axTLS.unencrypted_pem.p8.swp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/ssl/test/.axTLS.unencrypted_pem.p8.swp -------------------------------------------------------------------------------- /test/issues/issue-beta-351.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var a = []; 6 | a.push('foo'); 7 | tap.eq(a.pop(), 'foo'); 8 | -------------------------------------------------------------------------------- /test/issues/issue-beta-356.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | process.nextTick(function () { 6 | tap.ok(true); 7 | }); 8 | -------------------------------------------------------------------------------- /test/issues/issue-beta-245.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var l = [,1]; 6 | tap.eq(l[1], 1, 'empty elements allowed'); 7 | -------------------------------------------------------------------------------- /test/issues/issue-beta-294.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var b = [], c = 0, d = 0; 6 | a = b[++c] = d; 7 | tap.ok(true); 8 | -------------------------------------------------------------------------------- /deps/axtls/www/test_dir/no_http/.htpasswd: -------------------------------------------------------------------------------- 1 | abcd:CQhgDPyy0rvEU8OMxnQIvg==$YdJfIKZimFLYxPf/rbnhtQ== 2 | yaya:Syuss5jE2FNGVdr0kKGoHg==$WLw/SgHZFuAoOuml3GTJVw== 3 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-199.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | tap.eq([0, 1].join(','), '0,1', '[0,1].join() does not omit 0'); 6 | -------------------------------------------------------------------------------- /deps/axtls/httpd/kepler-1.1-snapshot-20070521-1825.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tessel/t1-runtime/HEAD/deps/axtls/httpd/kepler-1.1-snapshot-20070521-1825.tar.gz -------------------------------------------------------------------------------- /test/issues/log-global.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | console.log(global); 6 | 7 | tap.ok(true, 'can log entire global object.'); 8 | -------------------------------------------------------------------------------- /test/issues/issue-beta-274.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | tap.ok(2^16 == 16, 'bitwise xor') 6 | tap.ok(2^16 != 65536, 'not exponent') 7 | -------------------------------------------------------------------------------- /test/issues/issue-beta-87.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | console.log(true << 1); 6 | console.log(+true << 1); 7 | 8 | tap.ok(true); 9 | -------------------------------------------------------------------------------- /test/todo/issue-beta-448.js: -------------------------------------------------------------------------------- 1 | try { 2 | setImmediate(function () { 3 | throw new Error('THIS IS AN ERROR'); 4 | }) 5 | } catch (e) { 6 | console.log('error', e); 7 | } -------------------------------------------------------------------------------- /test/issues/issue-runtime-173.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | var c = 0xedb88320 ^ 62317068; 6 | console.log('#', c); 7 | tap.ok(c < 0); 8 | 9 | -------------------------------------------------------------------------------- /deps/axtls/www/test_dir/no_http/index.html: -------------------------------------------------------------------------------- 1 | 2 | axhttpd is running 3 | 4 | Looks like you got to this directory. 5 | 6 | 7 | -------------------------------------------------------------------------------- /deps/axtls/www/test_dir/no_ssl/index.html: -------------------------------------------------------------------------------- 1 | 2 | axhttpd is running 3 | 4 | Looks like you got to this directory. 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/issues/issue-beta-200.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var d = [3,2,1]; 6 | tap.ok(d); 7 | 8 | var _d = [1,2,3]; 9 | tap.ok(_d); 10 | -------------------------------------------------------------------------------- /test/issues/issue-beta-251.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | console.log('#', new Buffer([0x35]) + '67'); 6 | tap.eq(new Buffer([0x35]) + '67', '\x3567'); 7 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-292.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | var str = "x".replace(/x/, function () { 6 | return true; 7 | }); 8 | tap.eq(str, 'true'); 9 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-305.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | tap.eq(global._G && global._G._HSMATCH, null, '_HSMATCH object should not be accessible'); 6 | -------------------------------------------------------------------------------- /test/suite/bug-regexreplace.js: -------------------------------------------------------------------------------- 1 | console.log('1..1') 2 | var val = "aa".replace(/(..)/g, '\\$1\\$1\\$1') 3 | console.log(val == '\\aa\\aa\\aa' ? 'ok' : 'not ok') 4 | console.log('#', val) -------------------------------------------------------------------------------- /test/suite/unicode.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | var a = "\u007a\u2603"; 6 | console.log('#', a); 7 | 8 | tap.ok(true, 'unicode string can be output'); 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.colony 2 | *.o 3 | builtin/*.c 4 | lib/*.c 5 | *.dSYM 6 | 7 | libcolony.a 8 | node_modules 9 | build/* 10 | npm-debug.log 11 | 12 | out 13 | gyp 14 | 15 | .idea/ 16 | -------------------------------------------------------------------------------- /test/colony/issue-runtime-620.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | tap.count(1) 3 | global._G.collectgarbage.call('collect') 4 | tap.ok(true, 'collectgarbage call through JS succeeded.') 5 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-191.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | tap.eq(JSON.stringify({}, null, ' '), '{}', 'If partial is empty, then let final be "{}".'); 6 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-159.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | var mAccelLast; 6 | var delta = 20 - mAccelLast; // Tessel would hang here! 7 | 8 | tap.ok(true); 9 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-362.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1) 4 | 5 | tap.eq(['a','b',{}].join('/'), 'a/b/[object Object]', 'object in array passes Array.prototype.join'); 6 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-190.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | tap.eq(JSON.stringify({ foo: 1 }, null, 2), '{\n "foo": 1\n}', 'Integer space argument in stringify.'); 6 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-612.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var a = 5 6 | var b = (11 >>> 0) 7 | a = b || 0 8 | tap.eq(a, 11, 'assignment of float to slot is ok') 9 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-117.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | tap.eq(' text / x-lua lua !'.replace(/^\s*/g, ''), 'text / x-lua lua !', '/^\s*/ replaces only at BOL'); 6 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-122.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | tap.eq('text / x-lua lua !'.replace(/^\s*/g, ''), 'text / x-lua lua !', '/^\s*/ does not replace non-BOL'); 6 | -------------------------------------------------------------------------------- /test/issues/issue-beta-148.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var b = new Date() 6 | var a = +b 7 | tap.eq(a, b.valueOf()); 8 | console.log('#', a) 9 | console.log('#', b.valueOf()) -------------------------------------------------------------------------------- /test/issues/issue-runtime-385.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var a = Date.now(); 6 | var b = new Date(a); 7 | 8 | tap.eq(a, b.getTime()); 9 | tap.eq(a, b.valueOf()); 10 | -------------------------------------------------------------------------------- /test/issues/issue-beta-244.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var json = JSON.parse('{"1":true,"one":true}'); 6 | 7 | tap.ok(json[1]); 8 | tap.ok(json['one']); 9 | console.log('#', json) -------------------------------------------------------------------------------- /test/issues/issue-runtime-473.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | tap.count(1) 3 | 4 | var obj = {} 5 | Error.captureStackTrace(obj) 6 | tap.eq(typeof obj.stack, 'string', "non-Error object gets captured stack"); 7 | -------------------------------------------------------------------------------- /test/issues/issue-beta-204.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var s = '42', 6 | n = +s; 7 | tap.ok(n, 42); 8 | tap.eq(typeof n, 'number'); 9 | console.log('#', n, typeof n); 10 | -------------------------------------------------------------------------------- /test/issues/issue-beta-338.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var b = Buffer([1,2,3]).slice(3,50); 6 | console.log('#', b); 7 | tap.eq(b.length, 0, 'buffer.slice does not read past end.'); 8 | -------------------------------------------------------------------------------- /test/issues/issue-beta-339.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var b = Buffer([1,2,3,4,5,6]).slice(1,-2); 6 | console.log('#', b); 7 | tap.eq(b.length, 3, 'buffer.slice accepts negative indices'); -------------------------------------------------------------------------------- /test/suite/bug-foreach-null.js: -------------------------------------------------------------------------------- 1 | var a = [1, 2, 3]; 2 | 3 | console.log('1..1') 4 | a.forEach(function (b) { 5 | if (b == null) { 6 | console.log('not ok'); 7 | process.exit(1); 8 | } 9 | }) 10 | console.log('ok') -------------------------------------------------------------------------------- /test/suite/function.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | function a (a, b, c, d, e) { } 6 | tap.eq(a.length, 5, 'function arity == 5') 7 | tap.ok(new Function(), 'empty Function() constructor') 8 | -------------------------------------------------------------------------------- /test/issues/issue-beta-131.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | a = function () { } 6 | 7 | // ; 8 | a.b = true 9 | 10 | 11 | // ; ; 12 | 13 | // ; ; 14 | 15 | // ; ; 16 | 17 | tap.ok(true) -------------------------------------------------------------------------------- /test/issues/issue-runtime-419.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var foo = 5; 6 | tap.eq(foo.hasOwnProperty('bar'), false); 7 | 8 | foo = true; 9 | tap.eq(foo.hasOwnProperty('bar'), false); 10 | -------------------------------------------------------------------------------- /test/suite/jsonload.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | tap.eq(require('./jsonload-json').hello, 'hi', 'json imported'); 6 | tap.eq(require('./jsonload-json.json').hello, 'hi', 'json imported explicitly'); -------------------------------------------------------------------------------- /test/issues/issue-beta-221.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | try { 6 | throw Error("Test"); 7 | tap.ok(false) 8 | } catch (e) { 9 | tap.ok(true) 10 | } 11 | 12 | tap.ok(Error("Test").message) 13 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-146.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(2) 4 | 5 | var a = []; 6 | tap.eq(a.length, 0); 7 | a.sort(function(a, b) {return a.foo - b.foo}); 8 | console.log('#', a); 9 | tap.eq(a.length, 0); 10 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Tim Cameron Ryan 2 | Kevin Mehall 3 | Jon McKay 4 | Kelsey Breseman 5 | Kevin Swiber 6 | Rick Waldron 7 | -------------------------------------------------------------------------------- /NOTES: -------------------------------------------------------------------------------- 1 | # optimizations 2 | 3 | array creates new mt for each array (getter) 4 | 5 | # semantic changes 6 | 7 | Working to change Lua semantics on x86 to not delete things. 8 | 9 | # todo 10 | 11 | Need to check memory usage and track it. -------------------------------------------------------------------------------- /test/issues/issue-runtime-297.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | tap.eq(Date.parse("1970-01-01T00:00:00.042Z"), 42, 'Date.parse'); 6 | tap.eq(new Date("1970-01-01T00:00:00.042Z").valueOf(), 42, 'new Date().valueOf'); 7 | -------------------------------------------------------------------------------- /test/issues/issue-beta-352.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(4); 4 | 5 | tap.eq([1,2,3].join(), '1,2,3'); 6 | tap.eq([1,2,3].join('###'), '1###2###3'); 7 | tap.eq([1,2,3].join(1), '11213'); 8 | tap.eq([1,2,3].join(null), '1null2null3'); 9 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-107.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(2) 4 | 5 | tap.eq('Hello World'.replace(/\s|l*/g, ''), 'HeoWord', '/\s|l*/ replace'); 6 | tap.eq('Hello World'.replace(/l*/g, '_'), '_H_e__o_ _W_o_r__d_', '/l*/ replace'); 7 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-150.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(3) 4 | console.log('#', JSON.stringify("/".slice(0, -1))) 5 | tap.eq("/".slice(0, -1), ''); 6 | tap.eq("12345".slice(0, -3), '12'); 7 | tap.eq("12345".slice(0, -100), ''); 8 | -------------------------------------------------------------------------------- /test/suite/delete.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | a = {b: 5, c: 6} 6 | 7 | delete a.b; 8 | tap.eq(delete a.c, true, 'delete on existing prop returns true'); 9 | tap.eq(a.b, null, 'deleted prop does not exist'); 10 | -------------------------------------------------------------------------------- /test/issues/issue-beta-93.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | function MyObject(name){ 6 | this.name = name; 7 | } 8 | var o = new MyObject("adrian"); 9 | var a = [].concat(o); 10 | tap.eq(String(a), '[object Object]'); 11 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-133.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | var Readable = require('stream').Readable; 6 | var rs = new Readable; 7 | rs._read = function () { } 8 | rs.pipe(process.stdout); 9 | 10 | tap.ok(true); 11 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-244.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(3); 4 | 5 | tap.eq("abc".slice(0,1), 'a', '"abc".slice(0,1)') 6 | tap.eq("abc".slice(0,0), '', '"abc".slice(0,0)') 7 | tap.eq("abc".substring(0,0), '', '"abc".substring(0,0)') 8 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-437.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1) 4 | 5 | var simple = '{"price":null}'; 6 | var parsed = JSON.parse(simple); 7 | var a = parsed.price 8 | tap.eq(a, null, 'JSON parsed null should be equal to undefined'); 9 | -------------------------------------------------------------------------------- /test/todo/issue-beta-410.js: -------------------------------------------------------------------------------- 1 | function NotImplementedError(message) { 2 | this.name = "NotImplementedError"; 3 | this.message = (message || ""); 4 | } 5 | NotImplementedError.prototype = Error.prototype; 6 | 7 | throw new NotImplementedError("Bad Jon Bad"); -------------------------------------------------------------------------------- /test/issues/issue-runtime-434.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(5); 4 | 5 | tap.ok(!(null < {})) 6 | tap.ok(!({} > null)) 7 | tap.ok(!({} < {})) 8 | tap.ok(!({} > {})) 9 | tap.ok(true, 'null comparisons succeed without erroring out.') 10 | -------------------------------------------------------------------------------- /test/issues/issue-beta-100.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var arr = [ 0, 13, 2, 1, 21, 0, 0, 0, 0, 0, 6, 104, 105, 32, 106, 111, 110 ]; 6 | var val = arr.slice(7); 7 | 8 | tap.eq(val.length, 10); 9 | console.log('#', val); 10 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-368.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2) 4 | 5 | var obj = [ ]; 6 | function test (k) { 7 | tap.eq(typeof k, 'string', typeof k) 8 | var b = obj[k] 9 | tap.eq(typeof k, 'string', typeof k) 10 | } 11 | test('5') 12 | -------------------------------------------------------------------------------- /test/suite/early-return.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | tap.ok(true, 'early return should block falsy next test'); 6 | 7 | // Early return allowed in Node 8 | return 5; 9 | 10 | tap.ok(false, 'early return did not succeed') 11 | -------------------------------------------------------------------------------- /test/issues/issue-beta-108.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var arr = []; 6 | 7 | for (var i in arr) { 8 | console.log('#', i); 9 | tap.ok(false, 'Array should not have found index'); 10 | process.exit(1); 11 | } 12 | tap.ok(true); 13 | -------------------------------------------------------------------------------- /test/issues/issue-beta-180b.js: -------------------------------------------------------------------------------- 1 | // colony tries to insert break tag after try { } 2 | 3 | var tap = require('../tap'); 4 | 5 | tap.count(1); 6 | 7 | var opts = {} 8 | for (var n in opts) { 9 | } 10 | 11 | try { 12 | } catch (e) { 13 | } 14 | 15 | tap.ok(true); 16 | -------------------------------------------------------------------------------- /test/issues/issue-beta-366.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(3); 4 | 5 | parseInt(null, 16) 6 | console.log('#', parseInt(null, 16)) 7 | tap.ok(isNaN(parseInt(null, 10))); 8 | tap.ok(isNaN(parseInt(null, 16))); 9 | tap.eq(parseInt(null, 32), 785077); 10 | -------------------------------------------------------------------------------- /test/issues/issue-beta-440.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var arr = [{a:1}, {a:6},{a:2}, {a:4}] 6 | arr.sort(function(a, b) { 7 | console.log(a, b); 8 | return a.a - b.a 9 | }) 10 | 11 | arr.sort(); 12 | 13 | tap.ok(true); 14 | 15 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-314.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var result = 0; 6 | 7 | if (NaN) { 8 | // This should not be reached. 9 | result++; 10 | } 11 | 12 | tap.ok(!result, 'NaN should be a falsy value in if () {} block.'); 13 | -------------------------------------------------------------------------------- /test/todo/http-server.js: -------------------------------------------------------------------------------- 1 | var http = require('http'); 2 | http.createServer(function (req, res) { 3 | res.writeHead(200, {'Content-Type': 'text/plain'}); 4 | res.end('Hello World\n'); 5 | }).listen(1337, '127.0.0.1'); 6 | console.log('Server running at http://127.0.0.1:1337/'); -------------------------------------------------------------------------------- /etc/make.sh: -------------------------------------------------------------------------------- 1 | gcc-4.9 -fdiagnostics-color=auto -o tcp_test -std=c99 -g *.c 2 | # cc -I. -DHTTP_PARSER_STRICT=0 -Wall -Wextra -O0 -g -o tcp_test ../../colony-jit/src/libluajit.a ../../http-parser/http_parser.c -I../ -I../../http-parser -I../../colony-jit/src/ -g ../tm.c ../tm_uptime.c *.c -------------------------------------------------------------------------------- /test/issues/issue-runtime-276.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | try { 6 | require("MISSING"); 7 | } catch (e) { 8 | var msg = e.toString(); 9 | tap.ok(msg.match(/find module .MISSING/), "no unexpected path in module resolution error"); 10 | } -------------------------------------------------------------------------------- /test/issues/issue-runtime-611.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var a = [ 86, 67, 48, 55, 48, 51, 32, 49, 46, 48, 48 ] 6 | var J = 11 7 | var b = a.splice(5, J >>> 0).slice(); 8 | tap.eq(b.length, 6, 'splice delete exceding length of string is valid'); 9 | -------------------------------------------------------------------------------- /test/net/dns.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var dns = require('dns'); 6 | 7 | dns.resolve('tessel-httpbin.herokuapp.com', function (err, ip) { 8 | tap.ok(!err); 9 | tap.ok(ip == null || Array.isArray(ip)); 10 | console.log('#', ip); 11 | }) -------------------------------------------------------------------------------- /test/issues/issue-runtime-652.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(4); 4 | 5 | tap.ok(isNaN('hello'), 'string is NaN'); 6 | tap.ok(isNaN(undefined), 'undefined is NaN'); 7 | tap.ok(isNaN(NaN), 'NaN is NaN (but != NaN... you get the picture)'); 8 | tap.ok(!isNaN(0), '0 is aN'); 9 | -------------------------------------------------------------------------------- /test/issues/issue-beta-98.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(3); 4 | 5 | var arr = []; 6 | tap.eq(arr.length, 0, 'array [] len 0') 7 | arr.hello = 'hi'; 8 | tap.eq(arr.length, 0, 'array keys constant') 9 | 10 | arr.push(1, 2, 3, 4, 5); 11 | tap.eq(arr[0], 1, 'array key set'); -------------------------------------------------------------------------------- /deps/axtls/config/scripts/config/lxdialog/BIG.FAT.WARNING: -------------------------------------------------------------------------------- 1 | This is NOT the official version of dialog. This version has been 2 | significantly modified from the original. It is for use by the Linux 3 | kernel configuration script. Please do not bother Savio Lam with 4 | questions about this program. 5 | -------------------------------------------------------------------------------- /test/suite/number.js: -------------------------------------------------------------------------------- 1 | console.log('1..3'); 2 | 3 | // Number.isNaN 4 | 5 | console.log(Number.isNaN('NaN') == false ? 'ok' : 'not ok - isNaN string'); 6 | console.log(Number.isNaN(NaN) == true ? 'ok' : 'not ok - isNaN NaN'); 7 | console.log(Number.isNaN(3) == false ? 'ok' : 'not ok - isNaN integer'); 8 | -------------------------------------------------------------------------------- /test/issues/issue-beta-451.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var obj = {}; 6 | console.log("# obj.__proto__ =", obj.__proto__); 7 | console.log("# Object.getPrototypeOf(obj) =", Object.getPrototypeOf(obj)); 8 | tap.eq(obj.__proto__, Object.getPrototypeOf(obj), 'same prototype'); 9 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-170.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(2) 4 | 5 | var dash = require(__dirname + '/170/runtime-170/test-subfolder/subfolder'); 6 | tap.eq(dash, true); 7 | var underscore = require(__dirname + '/170/runtime_170/test-subfolder/subfolder'); 8 | tap.eq(underscore, true); 9 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-246.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(2) 4 | 5 | var arr = [1,2,3,4,5]; 6 | arr.length = 3; 7 | 8 | tap.eq(JSON.stringify(arr), '[1,2,3]', 'array is stringified to trimmed array'); 9 | tap.eq(Object.keys(arr).join(','), '0,1,2', 'array keys are trimmed'); 10 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-506.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | function A(a) { 6 | 7 | } 8 | 9 | Object.defineProperty(A, 'test', { 10 | get: function () { 11 | return 'foo' 12 | }, 13 | }); 14 | 15 | tap.eq(A.test, 'foo', 'defineProperty works on functions') 16 | -------------------------------------------------------------------------------- /test/issues/issue-beta-276.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var a = new Date(); 6 | tap.eq(a - a, 0); 7 | 8 | var a = new Date(); 9 | var a_val = Number(a); 10 | var b = { 11 | valueOf: function () { 12 | return a_val - 1000; 13 | } 14 | } 15 | tap.eq(a - b, 1000); 16 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-109.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(2) 4 | 5 | tap.eq(JSON.stringify('a,b,c,d'.split(/,/)), JSON.stringify(['a', 'b', 'c', 'd']), 'split(/,/)'); 6 | tap.eq(JSON.stringify('a\r\nb\r\nc\r\nd'.split(/[\r\n]+/)), JSON.stringify(['a', 'b', 'c', 'd']), 'split(/[\\r\\n]+/)'); 7 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-529.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | tap.count(1); 3 | 4 | var res = JSON.stringify({ 5 | foundation: "Mozilla", 6 | model: 'box', 7 | other: 5, 8 | }, function (key, value) { 9 | return typeof(value) == "string" ? null : value; 10 | }); 11 | 12 | tap.ok(res, '{"other":5}'); 13 | -------------------------------------------------------------------------------- /test/issues/161/node_modules/test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "main": "./foo.js", 4 | "version": "0.0.0", 5 | "description": "", 6 | "main": "index.js", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "author": "", 11 | "license": "ISC" 12 | } 13 | -------------------------------------------------------------------------------- /test/issues/issue-beta-380.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var b = Buffer(20), 6 | s = b.fill(0xFF) || b.slice(5,15); 7 | b.fill(0); 8 | tap.eq(s.toString('hex'), '00000000000000000000'); 9 | s.fill(42); 10 | tap.eq(b.toString('hex'), '00000000002a2a2a2a2a2a2a2a2a2a0000000000'); 11 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-296.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(3) 4 | 5 | var d = new Date(42); 6 | tap.eq(d.valueOf(), 42, 'valueOf'); 7 | tap.eq(d.toISOString(), '1970-01-01T00:00:00.042Z', 'toISOString'); 8 | 9 | tap.eq(new Date("1970-01-01T00:00:00.042Z").valueOf(), 42, 'valueOf new date'); 10 | -------------------------------------------------------------------------------- /test/issues/issue-beta-207.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(9); 4 | 5 | function test(cb) { 6 | cb(0, 1, 2); 7 | cb(null, 1, 2); 8 | cb(1, null, 2); 9 | } 10 | 11 | test(function (e,d,m) { 12 | tap.eq(arguments[0], e); 13 | tap.eq(arguments[1], d); 14 | tap.eq(arguments[2], m); 15 | }); 16 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-295.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(3); 4 | 5 | tap.ok(RegExp.prototype.hasOwnProperty('toString'), 'regex has own property toString'); 6 | tap.eq(/abc/g.toString(), '/abc/g', 'tostring method on regex'); 7 | tap.eq(/abc/mig.toString(), '/abc/gim', 'tostring method on regex orders flags by spec'); 8 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-307.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(4); 4 | 5 | var test = /^(?::(\d*))?/ 6 | var a = ('WRONG'.match(test)) 7 | 8 | tap.eq(a[0], ""); 9 | tap.eq(a[1], undefined); 10 | 11 | var test = /^(?::(\d*))?/ 12 | var a = (':5'.match(test)) 13 | 14 | tap.eq(a[0], ":5") 15 | tap.eq(a[1], "5"); 16 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-204.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(3) 4 | 5 | tap.eq(String([1]), '1', 'stringed-array doesn\'t leave trailing comma'); 6 | 7 | tap.eq("12345678".match(/\d/g).length, [1,2,3,4,5,6,7,8].length, 'match split length'); 8 | tap.eq(String("12345678".match(/\d/g)), '1,2,3,4,5,6,7,8', 'match split entries'); 9 | -------------------------------------------------------------------------------- /test/issues/issue-beta-395.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var a = ['c', 'd', 'a', 'e', 'b'] 6 | console.log('#', a); 7 | 8 | var b = a.slice() 9 | console.log('#', b.sort()); 10 | tap.eq(JSON.stringify(b), JSON.stringify(['a', 'b', 'c', 'd', 'e'])) 11 | 12 | b.sort().push('hi'); 13 | tap.eq(b.pop(), 'hi'); 14 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-360.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(6) 4 | 5 | var a = [1,2,3]; 6 | 7 | Object.keys(a).forEach(function (key) { 8 | tap.eq(typeof key, 'string', 'Object.keys returns non-string'); 9 | }) 10 | 11 | for (var key in a) { 12 | tap.eq(typeof key, 'string', 'Object.keys returns non-string'); 13 | } 14 | -------------------------------------------------------------------------------- /deps/approxidate/README.md: -------------------------------------------------------------------------------- 1 | Approxidate 2 | 3 | This library is from the original Linus Torvalds' original `/git/date.c`, but it also has the ability to return microseconds. The function exposed on the Tessel will return milliseconds since epoch. The github library that this code was taken from can be found [here](https://github.com/thatguystone/approxidate). -------------------------------------------------------------------------------- /test/suite/defineProperty.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | o = {}; 6 | 7 | Object.defineProperty(o, 'foo', { 8 | value: 0, 9 | }); 10 | 11 | tap.ok(o.foo + 1 === 1, 'falsy value'); 12 | 13 | Object.defineProperty(o, 'bar', { 14 | get: function() { return 5; } 15 | }); 16 | 17 | tap.ok(o.bar === 5, 'getter'); 18 | -------------------------------------------------------------------------------- /test/colony/buffer-limit.js: -------------------------------------------------------------------------------- 1 | // INSPECT_MAX_BYTES exposes the wrong number of bytes 2 | // on Node master (2014/10/07). Check for the correct number. 3 | 4 | var tap = require('../tap') 5 | 6 | tap.count(1); 7 | 8 | require('buffer').INSPECT_MAX_BYTES = 2; 9 | tap.ok(Buffer([1,2,3]).inspect() === '', 'inspect follows custom limit') 10 | -------------------------------------------------------------------------------- /deps/approxidate/approxidate.h: -------------------------------------------------------------------------------- 1 | #ifndef APPROXIDATE_H 2 | #define APPROXIDATE_H 3 | 4 | #include 5 | 6 | /** 7 | * @param date The date string 8 | * @param tv Where the time will be placed. 9 | * 10 | * @return 0 on success 11 | * @return 1 on error 12 | */ 13 | int approxidate(const char *date, struct timeval *tv); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-177.js: -------------------------------------------------------------------------------- 1 | // Tests that NaN / Inf keys don't trigger errors. 2 | 3 | var tap = require('../tap') 4 | 5 | tap.count(1) 6 | 7 | var a = {} 8 | a.NaN = 0/0 9 | a.nan = 0/0 10 | a['-NaN'] = 0/0 11 | a['-nan'] = 0/0 12 | a.Infinity = 0/0 13 | a.infinity = 0/0 14 | a['-Infinity'] = 0/0 15 | a['-infinity'] = 0/0 16 | 17 | tap.ok(true); 18 | -------------------------------------------------------------------------------- /test/issues/issue-beta-314.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var dict = {}; 6 | var a = {len: 1, arr: []}; 7 | var b = {len: 1, arr: []}; 8 | var c = {len: 1, arr: []}; 9 | dict['1'] = b; 10 | dict['2'] = c; 11 | dict['0'] = a; 12 | console.log('#', dict) 13 | console.log('#', Object.keys(dict)) 14 | tap.ok(Object.keys(dict).length > 1); 15 | -------------------------------------------------------------------------------- /deps/fatfs/src/option/unicode.c: -------------------------------------------------------------------------------- 1 | #include "../ff.h" 2 | 3 | #if _USE_LFN != 0 4 | 5 | #if _CODE_PAGE == 932 6 | #include "cc932.c" 7 | #elif _CODE_PAGE == 936 8 | #include "cc936.c" 9 | #elif _CODE_PAGE == 949 10 | #include "cc949.c" 11 | #elif _CODE_PAGE == 950 12 | #include "cc950.c" 13 | #else 14 | #include "ccsbcs.c" 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /test/issues/issue-beta-101.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var arr = [ 0, 13, 2, 1, 21, 0, 0, 0, 0, 0, 6, 104, 105, 32, 106, 111, 110 ]; 6 | var val = new Buffer(arr).slice(7); 7 | 8 | tap.eq(val.length, 10); 9 | console.log('#', val); 10 | tap.eq(new Buffer('hello').toString(), 'hello'); 11 | console.log('#', new Buffer('hello').toString()) -------------------------------------------------------------------------------- /test/issues/issue-beta-337.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | function reduceBuffer(buf, start, end, fn, res) { 6 | // NOTE: does not handle missing `res` like Array.prototype.reduce would 7 | for (var i = start, len = end; i < len; ++i) { 8 | res = fn(res, buf[i]); 9 | } 10 | return res; 11 | } 12 | 13 | tap.ok(true); 14 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-298.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(4) 4 | 5 | console.log('#', parseFloat("x")); 6 | tap.ok(isNaN(parseFloat("x"))) 7 | 8 | console.log('#', parseInt("x")); 9 | tap.ok(isNaN(parseInt("x"))) 10 | 11 | console.log('#', Number("x")); 12 | tap.ok(isNaN(Number("x"))) 13 | 14 | console.log('#', +"x"); 15 | tap.ok(isNaN(+"x")) 16 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-548.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var events = require('events'); 6 | var e = new events.EventEmitter(); 7 | 8 | function f() { 9 | tap.ok(false, 'removeListener did not remove once listener.'); 10 | } 11 | 12 | tap.ok(true, 'first.'); 13 | e.once('evt', f) 14 | e.removeListener('evt', f) 15 | e.emit('evt') 16 | -------------------------------------------------------------------------------- /test/issues/issue-beta-180.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var b = 0; 6 | function a () { 7 | return b = 5; 8 | } 9 | 10 | console.log((b = {a: 5}).a); 11 | 12 | // var test = [function () { console.log(ok); }] 13 | // test[a](); 14 | 15 | var i = { length : 1 }; 16 | var task = [function () { tap.eq(this, task); }] 17 | task[i.length - 1](); -------------------------------------------------------------------------------- /test/issues/issue-beta-390.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(3); 4 | 5 | var test = {}; 6 | 7 | test['A'] = 0; 8 | Object.defineProperty(test, 'a', { 9 | get: function () { return 0 } 10 | }); 11 | 12 | test['B'] = 1; 13 | console.log('# test', test); 14 | tap.ok(Object.keys(test).indexOf('B') > -1); 15 | tap.ok('B' in test); 16 | tap.eq(test.a, 0); 17 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-628.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | function getparams (fn) { 6 | return fn.toString().match(/\(([^\)]+)/)[1].split(/,\s*/); 7 | } 8 | 9 | function ok (a, b, c) { 10 | console.log('yay'); 11 | } 12 | 13 | console.log('#', ok.toString()) 14 | tap.eq(getparams(ok).join(','), 'a,b,c', 'can extract param names from fn'); 15 | -------------------------------------------------------------------------------- /test/issues/issue-beta-159.js: -------------------------------------------------------------------------------- 1 | // Strings should not automatically be coerced to numbers in arithmetic 2 | // but tonumber() should continue to coerce strings 3 | 4 | var tap = require('../tap'); 5 | 6 | tap.count(2); 7 | 8 | var elem = "2"; 9 | tap.eq("0" + elem, '02'); 10 | console.log('#', '0' + elem) 11 | 12 | var n = Number("55"); 13 | tap.eq(n, 55); 14 | console.log('#', n); 15 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-320.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var buf = new Buffer('test'); 6 | 7 | console.log('#', JSON.stringify(String.fromCharCode.apply(null, buf))); 8 | tap.eq(String.fromCharCode.apply(null, buf), 'test') 9 | console.log('#', JSON.stringify(String.fromCharCode.apply(null, []))); 10 | tap.eq(String.fromCharCode.apply(null, []), '') 11 | -------------------------------------------------------------------------------- /test/suite/bug-bindnull.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | function Test(testMessage) { 6 | this.test = testMessage; 7 | } 8 | 9 | function printit(err, obj) { 10 | tap.ok(err == null, 'No error'); 11 | tap.ok(obj.test == 'Success', 'String passed'); 12 | } 13 | 14 | var test = new Test("Success"); 15 | 16 | printit.bind(null, null, test)(); 17 | -------------------------------------------------------------------------------- /tools/tap-colony.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # node-tap CDs into directory of tests. this invalidates 3 | # __dirname and __filename lookup on PC. this is a decent 4 | # workaround, better solved by replacing node-tap with 5 | # behavior that uses the original relative paths. 6 | 7 | ORIGINAL=$PWD 8 | cd $(dirname $0)/.. 9 | RELATIVE=.${ORIGINAL#"$PWD"} 10 | ./out/Release/colony "$RELATIVE/$1" 11 | -------------------------------------------------------------------------------- /src/std.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void * operator new(size_t size) 5 | { 6 | return(malloc(size)); 7 | } 8 | 9 | void * operator new[](size_t size) 10 | { 11 | return(malloc(size)); 12 | } 13 | 14 | void operator delete(void * ptr) 15 | { 16 | free(ptr); 17 | } 18 | 19 | void operator delete[](void * ptr) 20 | { 21 | free(ptr); 22 | } 23 | -------------------------------------------------------------------------------- /test/issues/issue-beta-379.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(3); 4 | 5 | tap.eq(Buffer([255]).readUInt32BE(0, true).toString(16), 'ff000000'); 6 | var res = Buffer(0).readUInt32BE(9999, true); 7 | tap.ok(isNaN(res) || (res == 0), 'reading beyond buffer length (noAssert) is 0 (older) or NaN (newer) depending on node version'); 8 | tap.eq(Buffer(0).readUInt8(9999, true), undefined); 9 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-134.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(4); 4 | 5 | var regexSeparators = /\x2E|\u3002|\uFF0E|\uFF61/g; 6 | 7 | tap.ok((/\x50/).test('P')) 8 | tap.ok((/\u0050/).test('P')) 9 | 10 | var regexSeparators = new RegExp("\\x2E|\\u3002|\\uFF0E|\\uFF61", "g"); 11 | 12 | tap.ok(new RegExp("\\x50").test('P')) 13 | tap.ok(new RegExp("\\u0050").test('P')) 14 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-208.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var a = { 6 | a: 5, 7 | get apple() { 8 | return this.a; 9 | }, 10 | set apple(value) { 11 | this.a = value + 1; 12 | }, 13 | c: 5 14 | } 15 | 16 | tap.eq(a.apple, a.a, "Getting works properly"); 17 | a.apple = 3; 18 | tap.eq(a.apple, 4, "Setting works properly"); -------------------------------------------------------------------------------- /test/suite/__proto__.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var animal = { eats: true } 6 | var rabbit = { jumps: true } 7 | 8 | rabbit.__proto__ = animal // inherit 9 | 10 | tap.eq(rabbit.eats, true) // true 11 | 12 | /* 13 | // TODO 14 | function fn () { 15 | } 16 | 17 | fn.__proto__ = { 18 | use: 'hello' 19 | } 20 | 21 | tap.eq(fn.use, 'hello'); 22 | */ 23 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-185.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(7) 4 | 5 | tap.eq("canal".lastIndexOf("a"), 3); 6 | tap.eq("canal".lastIndexOf("a", 2), 1) 7 | tap.eq("canal".lastIndexOf("l", 4), 4) 8 | tap.eq("canal".lastIndexOf("a", 0), -1) 9 | tap.eq("canal".lastIndexOf("a", 8), 3) 10 | tap.eq("canal".lastIndexOf("a", -5), -1) 11 | tap.eq("canal".lastIndexOf("x"), -1) 12 | 13 | -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_cookies.lp: -------------------------------------------------------------------------------- 1 | 8 | 9 |

Testing Cookies library

10 | 11 | <%= CL_COOKIE%> = <%= tostring(test)%>
12 | Assigning current date to cookie!
13 | Reload this script to check cookie's value! 14 | -------------------------------------------------------------------------------- /test/issues/issue-beta-446.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var str = 'DNS:*.github.com, DNS:github.com'; 6 | 7 | var arr = str.split(/, /g); 8 | console.log(arr.length == 2 ? 'ok' : 'not ok'); 9 | 10 | var a = /a(b)|c/g; 11 | 12 | 'abc'.replace(a, function (all, sub) { 13 | console.log('#', all, sub); 14 | if (all == 'c') { 15 | tap.eq(sub, null); 16 | } 17 | }) 18 | -------------------------------------------------------------------------------- /test/suite/builtin.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | var builtin = ['assert', 'buffer', 'child_process', 'crypto', 'dgram', 'events', 'fs', 'http', 4 | 'net', 'os', 'path', 'punycode', 'querystring', 'stream', 'string_decoder', 'tty', 5 | 'url', 'util', 'zlib'] 6 | 7 | tap.count(builtin.length); 8 | 9 | for (var i = 0; i < builtin.length; i++) { 10 | tap.ok(require(builtin[i]), builtin[i]) 11 | } -------------------------------------------------------------------------------- /test/colony/eval-fn.js: -------------------------------------------------------------------------------- 1 | // Colony does not yet support parsing in eval() or in 2 | // Function constructor. Helpfully, throw an error instead. 3 | 4 | var tap = require('../tap'); 5 | 6 | tap.count(1); 7 | 8 | try { 9 | var b = new Function("a", "b", "console.log('')") 10 | tap.ok(false, 'new Function() does not throw error') 11 | } catch(err) { 12 | tap.ok(true, 'new Function(arg) throws error') 13 | } 14 | -------------------------------------------------------------------------------- /test/issues/issue-beta-77.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(3); 4 | 5 | function TestObj() {} 6 | 7 | var globalDict = {}; 8 | 9 | var t = new TestObj(); 10 | 11 | globalDict[t] = "hi"; 12 | 13 | tap.eq(JSON.stringify(globalDict), '{"[object Object]":"hi"}'); 14 | 15 | var dict = {}; 16 | dict[/a/] = 'hi'; 17 | tap.eq(dict[/a/], 'hi'); 18 | tap.eq(JSON.stringify(dict), '{"/a/":"hi"}'); 19 | -------------------------------------------------------------------------------- /test/modules/express/test.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | 3 | var app = express(); 4 | 5 | app.get('/', function(req, res){ 6 | res.send('Hello World'); 7 | }); 8 | app.get('foo', function(req, res){ 9 | res.send('Hello World'); 10 | }); 11 | 12 | app.get('*', function(req, res) { 13 | res.send('got sometin!'); 14 | }) 15 | app.listen(3000); 16 | console.log('Listening on http://localhost:3000'); -------------------------------------------------------------------------------- /test/issues/issue-runtime-269.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | var o = { foo: 1 }; 6 | var descriptor = Object.getOwnPropertyDescriptor(o, 'foo'); 7 | var fields = [ 'writable', 'enumerable', 'configurable' ]; 8 | var result = true; 9 | 10 | for (var i = 0; i < fields.length; i++) { 11 | if (!(result = fields[i] in descriptor)) { 12 | break; 13 | } 14 | } 15 | tap.ok(result); 16 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-337.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var a = { 6 | test : function() { console.log('test');} 7 | } 8 | 9 | function B() {} 10 | 11 | B.test = a.test; 12 | 13 | for (var prop in B) { 14 | if (prop == 'test') { 15 | tap.ok(true, 'only function object prop should be "test"') 16 | } else { 17 | throw new Error('Unexpected key.'); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/net/http-get.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var http = require('http'); 6 | 7 | http.get("http://tessel-httpbin.herokuapp.com/", function (res) { 8 | tap.ok(typeof res.statusCode, 'number'); 9 | res.on('data', function (data) { 10 | console.log('# received', data.length, 'bytes'); 11 | }) 12 | }).on('error', function (e) { 13 | tap.ok(false, String(e)); 14 | }); 15 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | The Tessel Runtime is copyright 2014 Technical Machine, Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 4 | or the MIT 6 | license , 7 | at your option. All files in the project carrying such 8 | notice may not be copied, modified, or distributed except 9 | according to those terms. 10 | -------------------------------------------------------------------------------- /deps/luabitop-1.0/msvctest.bat: -------------------------------------------------------------------------------- 1 | @rem Script to test Lua BitOp. 2 | 3 | @setlocal 4 | @rem Path to the Lua executable: 5 | @set LUA=lua 6 | 7 | @echo off 8 | for %%t in (bittest.lua nsievebits.lua md5test.lua) do ( 9 | echo testing %%t 10 | %LUA% %%t 11 | if errorlevel 1^ 12 | goto :FAIL 13 | ) 14 | echo ****** ALL TESTS OK ****** 15 | goto :END 16 | 17 | :FAIL 18 | echo ****** TEST FAILED ****** 19 | :END 20 | -------------------------------------------------------------------------------- /test/issues/161/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "app", 3 | "version": "0.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "directories": { 7 | "example": "examples" 8 | }, 9 | "dependencies": { 10 | "test": "^0.0.0" 11 | }, 12 | "devDependencies": {}, 13 | "scripts": { 14 | "test": "echo \"Error: no test specified\" && exit 1" 15 | }, 16 | "author": "", 17 | "license": "ISC" 18 | } 19 | -------------------------------------------------------------------------------- /test/issues/issue-beta-317.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(3); 4 | 5 | var dict = {}; 6 | dict['1'] = 1; 7 | dict['01'] = 2; 8 | dict['0x10'] = 3; 9 | dict['a'] = 4; 10 | // console.log(dict, Object.keys(dict), dict['1'], dict['0x10'], dict['16']); 11 | 12 | tap.ok(dict['1'] == 1) 13 | tap.ok(Object.keys(dict).map(String).indexOf('01') > 0) 14 | tap.ok(Object.keys(dict).map(String).indexOf('0x10') > 0) 15 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-156.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(4) 4 | 5 | var querystring = require('querystring'); 6 | var util = require('util'); 7 | 8 | console.log('#', isFinite(5)) 9 | tap.eq(isFinite(5), true); 10 | console.log('#', querystring.stringify({room_id: 5})) 11 | tap.eq(querystring.stringify({room_id: 5}), 'room_id=5'); 12 | tap.eq(isFinite("0"), true); 13 | tap.eq(isFinite("hi"), false); 14 | -------------------------------------------------------------------------------- /test/colony/issue-runtime-627.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var semver = require('semver'); 6 | 7 | // Checks internal versions have been set. 8 | console.log('#', JSON.stringify(process.versions, null, '')); 9 | tap.ok(semver.gte(process.versions.node, '0.10.30'), 'node version reports >= 0.10.30'); 10 | tap.ok(semver.gte(process.versions.colony, '1.0.0'), 'colony version reports >= 1.0.0'); 11 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-158.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(7) 4 | 5 | tap.eq(Number.isFinite('5'), false); 6 | tap.eq(Number.isFinite(NaN), false); 7 | tap.eq(Number.isFinite(Infinity), false); 8 | tap.eq(Number.isFinite(-Infinity), false); 9 | tap.eq(Number.isFinite(1.79769313486231580794E+308), false); 10 | tap.eq(Number.isFinite(1.79769313486231580793E+308), true); 11 | tap.eq(Number.isFinite(5), true); 12 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-397.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(6) 4 | 5 | var n = 42 6 | tap.ok(n.toFixed(0), '42', 'toFixed(0) works') 7 | tap.ok(n.toFixed(5), '42.00000', 'toFixed(5) works') 8 | tap.ok(n.toFixed(), '42', 'toFixed() works') 9 | tap.ok(n.toFixed(null), '42', 'toFixed(null) works') 10 | tap.ok(n.toFixed(''), '42', 'toFixed("") works') 11 | tap.ok(n.toFixed(false), '42', 'toFixed(false) works') 12 | -------------------------------------------------------------------------------- /test/suite/arguments.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var a = function () { 6 | var fake = Array.prototype.slice(arguments); 7 | tap.eq(fake && fake.length, 0, '.slice with improper arguments does nothing.'); 8 | 9 | var args = Array.prototype.slice.apply(arguments); 10 | tap.eq(args && args.length, 3, '.slice with arguments as call object returns proper array.'); 11 | } 12 | 13 | a(1, 2, 3); -------------------------------------------------------------------------------- /tools/colony-compiler-correct.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -a ./out/Release/colony ]; then 4 | : 5 | else 6 | echo 'colony cannot be found! please make colony.' 7 | exit 1 8 | fi 9 | 10 | if [ "$(./out/Release/colony ./tools/colony-compiler-correct.js)" != "ok" ]; then 11 | echo 'colony-compiler cannot be found! make update and try again.' 12 | exit 1 13 | fi 14 | echo '(colony-compiler is in correct location.)' 15 | exit 0 16 | -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_cookies.lua: -------------------------------------------------------------------------------- 1 | local cookies = require"cgilua.cookies" 2 | CL_COOKIE = "cgilua_cookie" 3 | 4 | local test = cookies.get (CL_COOKIE) 5 | cookies.set (CL_COOKIE, os.date()) 6 | 7 | cgilua.htmlheader () 8 | cgilua.put ([[ 9 |

Testing Cookies library

10 | 11 | ]]..CL_COOKIE..' = '..tostring(test)..[[
12 | Assigning current date to cookie!
13 | Reload this script to check cookie's value! 14 | ]]) 15 | -------------------------------------------------------------------------------- /test/suite/https.js: -------------------------------------------------------------------------------- 1 | var test = require('tinytap'), 2 | https = require('https'); 3 | 4 | test('https', function (t) { 5 | var https = require('https') 6 | console.log('imported'); 7 | https.get("https://tessel-httpbin.herokuapp.com/", function (res) { 8 | t.equal(res.statusCode, 200, 'https status code is 200') 9 | t.equal(res.connection.remotePort, 443, 'remote port is 443 for https') 10 | res.resume(); 11 | t.end(); 12 | }); 13 | }); -------------------------------------------------------------------------------- /test/suite/string-decoder.js: -------------------------------------------------------------------------------- 1 | var test = require('tinytap'); 2 | var StringDecoder = require('string_decoder').StringDecoder; 3 | 4 | test.count(2); 5 | 6 | test('can decode utf8', function(t) { 7 | 8 | var decoder = new StringDecoder('utf8'); 9 | 10 | var cent = new Buffer([0xC2, 0xA2]); 11 | t.equal(typeof "String", typeof decoder.write(cent), 'Decoder does not return a string.'); 12 | t.equal('¢', decoder.write(cent)); 13 | t.end(); 14 | }); -------------------------------------------------------------------------------- /test/issues/issue-runtime-186.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(8) 4 | 5 | tap.eq("Blue Whale".indexOf("Blue"), 0); 6 | tap.eq("Blue Whale".indexOf("Whale"), 5); 7 | tap.eq("Blue Whale".indexOf("Blute"), -1); 8 | tap.eq("Blue Whale".indexOf("Whale", 0), 5); 9 | tap.eq("Blue Whale".indexOf("Whale", 5), 5); 10 | tap.eq("Blue Whale".indexOf("", 9), 9); 11 | tap.eq("Blue Whale".indexOf("", 10), 10); 12 | tap.eq("Blue Whale".indexOf("", 11), 10); 13 | -------------------------------------------------------------------------------- /config/libtm-test.gyp: -------------------------------------------------------------------------------- 1 | { 2 | "includes": [ 3 | "common.gypi", 4 | ], 5 | 6 | "targets": [ 7 | { 8 | "target_name": "libtm-test", 9 | "product_name": "libtm-test", 10 | "type": "executable", 11 | "sources": [ 12 | '../test/tm/test.c' 13 | ], 14 | "include_dirs": [ 15 | '<(runtime_path)/src', 16 | ], 17 | "dependencies": [ 18 | "libtm.gyp:libtm", 19 | ] 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-345.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | // Array.prototype.forEach applied to String 6 | var a = []; 7 | Array.prototype.forEach.call("foobar", function(ch) { 8 | a.push(ch); 9 | }); 10 | tap.eq(a.join(''), 'foobar'); 11 | 12 | // Array.prototype.forEach applied to array 13 | var a = []; 14 | Array.prototype.forEach.call("foobar".split(''), function(ch) { 15 | a.push(ch); 16 | }); 17 | tap.eq(a.join(''), 'foobar'); 18 | -------------------------------------------------------------------------------- /deps/axtls/config/makefile.post: -------------------------------------------------------------------------------- 1 | 2 | ifneq ($(MAKECMDGOALS), clean) 3 | ifndef CONFIG_PLATFORM_WIN32 4 | ifndef CONFIG_PLATFORM_SOLARIS 5 | # do dependencies 6 | -include .depend 7 | all : .depend 8 | .depend: $(wildcard *.c) 9 | @$(CC) $(CFLAGS) -MM $^ > $@ 10 | endif # 'not' solaris 11 | endif # 'not' win32 12 | 13 | ifdef CONFIG_PLATFORM_WIN32 14 | OBJ:=$(OBJ:.o=.obj) 15 | %.obj : %.c 16 | $(CC) $(CFLAGS) $< 17 | endif # win32 18 | 19 | endif # end of 'not' clean 20 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-450.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | tap.count(4) 3 | 4 | tap.eq("x".replace(/x/, function () { return {}; }), "[object Object]", "basic"); 5 | tap.eq("x".replace(/x/, function () { return /h/i; }), "/h/i", "regex"); 6 | tap.eq("x".replace(/x/, function () { return true; }), "true", "boolean"); 7 | tap.eq("x".replace(/x/, function () { return (void 0); }), "undefined", "undefined"); 8 | //tap.eq("x".replace(/x/, function () { return null; }), "null", "null"); 9 | -------------------------------------------------------------------------------- /test/suite/console.js: -------------------------------------------------------------------------------- 1 | // var b = [1, 2, 3]; 2 | // var a = {b: b}; 3 | // console.log('[object Object] { b: [ 1, 2, 3 ] } 1,2,3 [ 1, 2, 3 ] [object Object]'); 4 | // console.log(String(a), a, String(b), b, String(global)); 5 | 6 | // console.log("undefined null true 5 hi { hey: 'there' }") 7 | // console.log(undefined, null, true, 5, "hi", {hey: 'there'}) 8 | 9 | console.error('1..4'); 10 | console.info('ok'); 11 | console.warn('ok'); 12 | console.error('ok'); 13 | console.log('ok'); -------------------------------------------------------------------------------- /test/issues/issue-runtime-491.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(2); 4 | 5 | var paramRegExp = /; *([!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) *= *("(?:[ !\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u0020-\u007e])*"|[!#$%&'\*\+\-\.0-9A-Z\^_`a-z\|~]+) */g; 6 | var string = 'string text/html; charset=utf-8'; 7 | 8 | tap.eq(paramRegExp.exec(string).join('|'), '; charset=utf-8|charset|utf-8', 'exec works'); 9 | tap.eq(paramRegExp.exec(string), null, 'exec preserves lastindex'); 10 | -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_sql.lua: -------------------------------------------------------------------------------- 1 | local s = require"luasql.postgres" 2 | 3 | local env = assert (luasql.postgres ()) 4 | local conn = assert (env:connect ("luasql-test", "tomas")) 5 | local cur = assert (conn:execute ("select count(*) from fetch_test")) 6 | 7 | cgilua.htmlheader() 8 | cgilua.put ("Total lines at table fetch_test is "..cur:fetch()) 9 | cgilua.put (string.format ("
\n%s == %s
\n", tostring(s), tostring(luasql))) 10 | 11 | cur:close() 12 | conn:close() 13 | env:close() 14 | -------------------------------------------------------------------------------- /test/issues/issue-beta-296.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(3); 4 | 5 | 6 | var b = { $super: {} }; 7 | var c = b.$super.init; 8 | tap.ok(true); 9 | 10 | a: { 11 | if (true) { 12 | break a; 13 | } 14 | } 15 | 16 | tap.ok(true); 17 | 18 | 19 | function inheritAsync () { 20 | for (var i in this) { 21 | i = function (next) { 22 | try { 23 | } catch (e) { 24 | } 25 | }; 26 | } 27 | }; 28 | 29 | tap.ok(true); 30 | -------------------------------------------------------------------------------- /test/issues/issue-beta-84.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(7); 4 | 5 | function MyObject(name){ 6 | this.name = name; 7 | } 8 | MyObject.prototype.yo = function(){ 9 | tap.ok(true, "Greetings from " + this.name); 10 | } 11 | var o = new MyObject("adrian"); 12 | tap.ok(o, "original"); 13 | o.yo(); 14 | 15 | var i = Object(o); 16 | tap.ok(i, "Object()"); 17 | i.name = "zankich"; 18 | i.yo(); 19 | o.yo(); 20 | 21 | tap.ok(i, "Object()"); 22 | tap.ok(o, "original"); 23 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-234.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(4); 4 | 5 | var parent = {}; 6 | var child = {testFunc : function() { console.log('test')}}; 7 | tap.eq(typeof child, 'object', 'child before property added'); 8 | tap.eq(typeof child.testFunc, 'function', 'testFunc before property added'); 9 | parent[child] = 'foo'; 10 | tap.eq(typeof child, 'object', 'child after property added'); 11 | tap.eq(typeof child.testFunc, 'function', 'testFunc after property added'); 12 | -------------------------------------------------------------------------------- /bench/test.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs') 2 | 3 | var count = 1000; 4 | var data = fs.readFileSync(__dirname + '/../examples/bench/json-parse-test.json', 'utf-8'); 5 | 6 | var start = process.hrtime(); 7 | for (var i = 0; i < count; i++) { 8 | console.error(global); 9 | console.error(data); 10 | } 11 | var end = process.hrtime(); 12 | 13 | var s_start = (start[0] + (start[1]/1e9)) 14 | var s_end = (end[0] + (end[1]/1e9)) 15 | console.log('okay:', (s_end - s_start) / count, 'seconds per iteration') 16 | -------------------------------------------------------------------------------- /test/suite/bug-endwithcomments.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1) 4 | 5 | Math.min(5, 5) 6 | 7 | tap.ok(true, 'always true; will exit falsy if cant compile with trailing comment') 8 | 9 | // console.log(subj3.replace(/\#+/, '___')) 10 | // console.log(subj3.replace(/\#+/g, '___')) 11 | 12 | // console.log(subj3.replace(/\#(\#*)/g, function (whole, p1, offset, str) { 13 | // console.log('-->', whole, p1, offset, str); 14 | // return whole.length 15 | // })); 16 | // console.log('') -------------------------------------------------------------------------------- /test/issues/issue-runtime-361.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | function B() {} 6 | 7 | B.prototype.foo = function(callback) { 8 | callback(); 9 | } 10 | 11 | B.prototype.bar = function() { 12 | tap.ok(false, '"this" isnt a shadowed variable'); 13 | } 14 | 15 | var b = new B(); 16 | 17 | b.foo(function() { 18 | // `this` should not equal `b` 19 | try { 20 | this.bar(); 21 | } catch (e) { 22 | tap.ok(true, '"this" isnt a shadowed variable'); 23 | } 24 | }) 25 | -------------------------------------------------------------------------------- /test/suite/try.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(5); 4 | 5 | var e = null; 6 | try { 7 | throw "BOO"; 8 | } catch (e) { } 9 | tap.ok(e == null, 'error should not escape scope of try #TODO') 10 | 11 | try { 12 | try { 13 | throw 'hi'; 14 | } finally { 15 | tap.ok(true); 16 | } 17 | } catch (e) { 18 | tap.ok(true); 19 | } finally { 20 | tap.ok(true); 21 | } 22 | 23 | var err; 24 | try { 25 | throw Error("ERRR"); 26 | } catch (e) { err = e; } 27 | tap.ok(err, 'error exists'); -------------------------------------------------------------------------------- /test/todo/https-goodcert.js: -------------------------------------------------------------------------------- 1 | console.log('1..2') 2 | 3 | var https = require('https'); 4 | 5 | https.get("https://api.github.com", function (res) { 6 | console.log('ok') 7 | console.log('# statusCode', res.statusCode) 8 | res.on('data', function (data) { 9 | // console.log('# received', data.length, 'bytes'); 10 | }) 11 | res.on('end', function () { 12 | console.log('ok - done'); 13 | }) 14 | }).on('error', function (e) { 15 | console.log('not ok -', e.message, 'error event #SKIP') 16 | }); -------------------------------------------------------------------------------- /test/issues/issue-beta-195.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(5); 4 | 5 | var table = []; 6 | table["0"] = true; 7 | tap.ok(table["0"] == true) 8 | tap.ok(table[0] == true) 9 | 10 | var table = {}; 11 | table[0] = true; 12 | tap.ok(table["0"] == true) 13 | tap.ok(table[0] == true) 14 | 15 | var table = {}; 16 | table[5] = true; 17 | tap.ok(table["5"] == true) 18 | 19 | var table = {}; 20 | table[function hi() { }] = true 21 | table[5] = true; 22 | table["hi"] = true; 23 | console.log(table); 24 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-487.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var Test = function Test() { 6 | this.alpha = "hi"; 7 | this.bravo = 1; 8 | this.charlie = ["hello", "there"] 9 | this.delta = function() {}; 10 | }; 11 | 12 | Test.prototype.echo = function echo() {}; 13 | 14 | var t = new Test(), 15 | opts = []; 16 | 17 | for (var opt in t) { opts.push(opt); } 18 | 19 | tap.ok(opts.indexOf('echo') > -1, 'function iterator carries enumerable properties from prototype'); 20 | -------------------------------------------------------------------------------- /test/todo/https-badcert.js: -------------------------------------------------------------------------------- 1 | console.log('1..2') 2 | 3 | var https = require('https'); 4 | 5 | https.get("https://www.pcwebshop.co.uk/", function (res) { 6 | console.log('ok') 7 | console.log('# statusCode', res.statusCode) 8 | res.on('data', function (data) { 9 | // console.log('# received', data.length, 'bytes'); 10 | }) 11 | res.on('end', function () { 12 | console.log('ok - done'); 13 | }) 14 | }).on('error', function (e) { 15 | console.log('not ok -', e.message, 'error event #SKIP') 16 | }); 17 | -------------------------------------------------------------------------------- /test/issues/issue-beta-340.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(4); 4 | 5 | console.log('#', 0 && true) 6 | tap.ok(!(0 && true), '0 should short-circuit truthiness'); 7 | 8 | var a = 0; 9 | console.log('#', a && true) 10 | tap.ok(!(a && true), '0 var should short-circuit truthiness'); 11 | 12 | console.log('#', 0 || 42) 13 | tap.ok((0 || 42) == 42, '0 should short-circuit falsiness'); 14 | 15 | var a = 0; 16 | console.log('#', a || 42) 17 | tap.ok((a || 42) == 42, '0 var should short-circuit falsiness'); 18 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-223.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | var util = require('util'); 3 | var events = require('events'); 4 | 5 | function Test() {} 6 | 7 | util.inherits(Test, events.EventEmitter); 8 | 9 | var i = new Test(); 10 | 11 | tap.count(2); 12 | 13 | try { 14 | i.once('event', undefined); 15 | tap.ok(false, 'once'); 16 | } catch(e) { 17 | tap.ok(true, 'once'); 18 | } 19 | 20 | try { 21 | i.on('event', undefined); 22 | tap.ok(false, 'on'); 23 | } catch(e) { 24 | tap.ok(true, 'on'); 25 | } -------------------------------------------------------------------------------- /test/todo/https-baddomain.js: -------------------------------------------------------------------------------- 1 | console.log('1..2') 2 | 3 | var https = require('https'); 4 | 5 | https.get("https://shiga-5072.herokussl.com/", function (res) { 6 | console.log('ok') 7 | console.log('# statusCode', res.statusCode) 8 | res.on('data', function (data) { 9 | // console.log('# received', data.length, 'bytes'); 10 | }) 11 | res.on('end', function () { 12 | console.log('ok - done'); 13 | }) 14 | }).on('error', function (e) { 15 | console.log('not ok -', e.message, 'error event #SKIP') 16 | }); 17 | -------------------------------------------------------------------------------- /deps/luabitop-1.0/installpath.lua: -------------------------------------------------------------------------------- 1 | -- Script to find the install path for a C module. Public domain. 2 | 3 | if not arg or not arg[1] then 4 | io.write("Usage: lua installpath.lua modulename\n") 5 | os.exit(1) 6 | end 7 | for p in string.gmatch(package.cpath, "[^;]+") do 8 | if string.sub(p, 1, 1) ~= "." then 9 | local p2 = string.gsub(arg[1], "%.", string.sub(package.config, 1, 1)) 10 | io.write(string.gsub(p, "%?", p2), "\n") 11 | return 12 | end 13 | end 14 | error("no suitable installation path found") 15 | -------------------------------------------------------------------------------- /test/issues/issue-beta-319.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(3); 4 | 5 | var simpleQueue = new Array(); 6 | 7 | simpleQueue.pushItem = function(item) { 8 | this.push(item); 9 | tap.ok(this.length == 2, "Length should be 2: " + this.length); 10 | }; 11 | 12 | console.log('well', simpleQueue.length) 13 | simpleQueue.push(1); 14 | tap.ok(simpleQueue.length == 1); 15 | 16 | simpleQueue.pushItem('foo'); 17 | 18 | var b = new Array(); 19 | b[0] = 5; 20 | b[1] = 5; 21 | b.push(1); 22 | tap.ok(b.length == 3); 23 | -------------------------------------------------------------------------------- /test/issues/issue-beta-97.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | function MyObject(name){ 6 | this.name = name; 7 | MyObject.booyakasha = function() { 8 | return "Hear me now!"; 9 | } 10 | } 11 | MyObject.prototype.yo = function(){ 12 | console.log("# Greetings from " + this.name); 13 | } 14 | 15 | var o = new MyObject("adrian"); 16 | o.yo(); 17 | 18 | tap.ok(o.constructor, "o.constructor"); 19 | tap.eq(o.constructor.booyakasha(), 'Hear me now!', "o.constructor.booyakasha()"); 20 | -------------------------------------------------------------------------------- /test/modules/faye-websockets/faye.js: -------------------------------------------------------------------------------- 1 | var WebSocket = require('faye-websocket'), 2 | ws = new WebSocket.Client('wss://echo.websocket.org'), 3 | message = "Hello world!\n" 4 | ; 5 | 6 | ws.on('open', function(event) { 7 | ws.send(message); 8 | }); 9 | 10 | ws.on('error', function(data){ 11 | console.log("error", data); 12 | }) 13 | 14 | ws.on('message', function(event) { 15 | console.log('message', event.data); 16 | }); 17 | 18 | ws.on('close', function(event) { 19 | console.log('close'); 20 | ws = null; 21 | }); 22 | -------------------------------------------------------------------------------- /src/colony/modules/tty.js: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | 10 | exports.isatty = function (fd) { 11 | return false; 12 | } 13 | -------------------------------------------------------------------------------- /deps/approxidate/COPYING: -------------------------------------------------------------------------------- 1 | This code was taken from git's source. Permission has been explicitly given by its author (David Woodhouse) for use in LGPL and BSD-licensed projects[1][2][3]. Any modifications carry the original license of the file. 2 | 3 | [1] David Woodhouse: http://www.gelato.unsw.edu.au/archives/git/0610/29021.html 4 | [2] Linus Torvalds: http://www.gelato.unsw.edu.au/archives/git/0610/28969.html 5 | [3] Junio C Hamano: http://www.gelato.unsw.edu.au/archives/git/0610/28978.html 6 | 7 | See: https://github.com/git/git/blob/master/COPYING 8 | -------------------------------------------------------------------------------- /src/colony/modules/buffer.js: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | 10 | exports.Buffer = Buffer; 11 | 12 | exports.INSPECT_MAX_BYTES = 50; 13 | -------------------------------------------------------------------------------- /test/suite/bug-forinarray.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(13); 4 | 5 | var arr = []; 6 | arr.hello = 'hi'; 7 | arr.push(1, 2, 3, 4, 5); 8 | 9 | tap.ok(arr[0] == 1, 'first index was null'); 10 | 11 | var had0 = false; 12 | for (var i in arr) { 13 | if (i == 1 && !had0) { 14 | throw new Error('1 came before 0'); 15 | } 16 | if (i == 0) { 17 | had0 = true; 18 | } 19 | 20 | tap.ok(typeof i == 'string', 'for..in index is string'); 21 | tap.ok(arr[i] != null, 'array string index is not null'); 22 | } 23 | 24 | // console.log('ok') -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.key_512.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIBOwIBAAJBAMjKXU67trg56k7LhG5v5XhsUTpVFI5ZOpcat/ry3WhtJS6q3lnB 3 | 3vGQ4n/U47F7yXVTIpDJ0Zxv2hm/0LfudBcCAwEAAQJAJDnee8YCQVqxm2W8jvBB 4 | RmjEfvG6s7QFjh2T9AK9T4mPsva55HuPnRee1WgkIVFLCB2wy+xeKqYUatT/Lcy1 5 | AQIhAO4vmcbILievlsnHew3SZcs+mjJTMlgt0/0yUz03w+FJAiEA187GrlzN0yFB 6 | 5HnYap/rzz6AR6zaHSJOSU/WXLTpCl8CIDkzj0+w5Xy8a48b7A5+t9meuDNbzZxl 7 | rSKCgoESMmWZAiEAsPzQTOenlePMmoijSK7nQgxMQHwuVX5xHgbwEw/7n5kCIQDp 8 | i1Gb2CDHu79/fL6kcQ9DEfGMT9i9lQ+bNiggYoL4uw== 9 | -----END RSA PRIVATE KEY----- 10 | -------------------------------------------------------------------------------- /test/tap.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Simple tap tester. 3 | ** This should rely on as few features as possible. 4 | ** modules, console.log, fns, string concat, String cast, JSON.stringify, if statements. 5 | */ 6 | 7 | var tap = exports; 8 | tap.count = function (max) { tap.t = 1; console.log(String(tap.t) + '..' + String(max)); }; 9 | tap.ok = function (a, d) { var not = ''; if (!a) { not = 'not '; } console.log(not + 'ok', tap.t, '-', d); tap.t = tap.t + 1; } 10 | tap.eq = function (a, b, c) { tap.ok(a == b, String(c) + ': ' + JSON.stringify(String(a)) + ' == ' + JSON.stringify(String(b))); } 11 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-534.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(4); 4 | 5 | var split1 = ''.split('.'); 6 | tap.eq(typeof split1[0], 'string', 'split empty string (with string) returns [""]'); 7 | 8 | var split2 = ''.split(/ *; */); 9 | tap.eq(typeof split2[0], 'string', 'split empty string (with regex) returns [""]'); 10 | 11 | var split3 = 'apple'.split('.'); 12 | tap.eq(split3[0], 'apple', 'split "apple" (with string) returns ["apple"]'); 13 | 14 | var split4 = 'apple'.split(/ *; */); 15 | tap.eq(split4[0], 'apple', 'split "apple" (with regex) returns ["apple"]'); 16 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.unencrypted_pem.p8: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAyMpdTru2uDnqTsuE 3 | bm/leGxROlUUjlk6lxq3+vLdaG0lLqreWcHe8ZDif9TjsXvJdVMikMnRnG/aGb/Q 4 | t+50FwIDAQABAkAkOd57xgJBWrGbZbyO8EFGaMR+8bqztAWOHZP0Ar1PiY+y9rnk 5 | e4+dF57VaCQhUUsIHbDL7F4qphRq1P8tzLUBAiEA7i+ZxsguJ6+Wycd7DdJlyz6a 6 | MlMyWC3T/TJTPTfD4UkCIQDXzsauXM3TIUHkedhqn+vPPoBHrNodIk5JT9ZctOkK 7 | XwIgOTOPT7DlfLxrjxvsDn632Z64M1vNnGWtIoKCgRIyZZkCIQCw/NBM56eV48ya 8 | iKNIrudCDExAfC5VfnEeBvATD/ufmQIhAOmLUZvYIMe7v398vqRxD0MR8YxP2L2V 9 | D5s2KCBigvi7 10 | -----END PRIVATE KEY----- 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | description: OS X 2 | badge_token: QsFQ9CsYegvj7x78qiit 3 | 4 | language: objective-c 5 | before_install: 6 | - brew update 7 | - mkdir -p ~/Library/Python/2.7/lib/python/site-packages 8 | - echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth 9 | - brew tap tessel/tools 10 | - brew install gyp ninja gcc-arm node luajit || true 11 | - git config credential.helper store 12 | - npm config set spin=false 13 | install: 14 | - make update 15 | script: 16 | - make colony 17 | - make test 18 | 19 | git: 20 | submodules: false 21 | -------------------------------------------------------------------------------- /src/colony/modules/repl.js: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | 10 | var EventEmitter = require('events').EventEmitter; 11 | 12 | exports.start = function () { 13 | return new EventEmitter(); 14 | }; -------------------------------------------------------------------------------- /test/issues/issue-runtime-605.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(16) 4 | 5 | var value = -1; 6 | tap.eq(value, -1) 7 | tap.eq(!value, false) 8 | tap.eq(!!value, true) 9 | tap.eq(!!!value, false) 10 | 11 | var value = -0.1; 12 | tap.eq(value, -0.1) 13 | tap.eq(!value, false) 14 | tap.eq(!!value, true) 15 | tap.eq(!!!value, false) 16 | 17 | var value = 0; 18 | tap.eq(value, 0) 19 | tap.eq(!value, true) 20 | tap.eq(!!value, false) 21 | tap.eq(!!!value, true) 22 | 23 | var value = -0; 24 | tap.eq(value, -0) 25 | tap.eq(!value, true) 26 | tap.eq(!!value, false) 27 | tap.eq(!!!value, true) 28 | -------------------------------------------------------------------------------- /deps/luabitop-1.0/README: -------------------------------------------------------------------------------- 1 | README for Lua BitOp 1.0.2 2 | -------------------------- 3 | 4 | Lua BitOp is a C extension module for Lua 5.1/5.2 which adds 5 | bitwise operations on numbers. 6 | 7 | Homepage: http://bitop.luajit.org/ 8 | 9 | Lua BitOp is Copyright (C) 2008-2012 Mike Pall. 10 | Lua BitOp is free software, released under the MIT license. 11 | 12 | -------------------------- 13 | 14 | Full documentation for Lua BitOp is available in HTML format. 15 | Please point your favourite browser to: 16 | 17 | doc/index.html 18 | 19 | Detailed installation instructions are here: 20 | 21 | doc/install.html 22 | 23 | -------------------------------------------------------------------------------- /test/net/http-get-query.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var http = require('http'); 6 | 7 | http.get("http://tessel-httpbin.herokuapp.com/get?id=5327684&units=imperial", function(res) { 8 | console.log('#', res.statusCode) 9 | tap.eq(res.statusCode, 200, 'status code'); 10 | var json = ''; 11 | res.on('data', function (chunk) { 12 | json = json + chunk; 13 | }); 14 | res.on('end', function () { 15 | tap.eq(JSON.parse(json).args.units, 'imperial', 'get query arguments passed properly') 16 | }) 17 | }).on('error', function (e) { 18 | tap.ok(false, String(e)); 19 | }); 20 | -------------------------------------------------------------------------------- /src/colony/lua_tm.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | 10 | #ifndef L_TM_H 11 | #define L_TM_H 12 | 13 | #include "lua.h" 14 | #include "lauxlib.h" 15 | 16 | LUALIB_API int luaopen_tm (lua_State *L); 17 | 18 | #endif -------------------------------------------------------------------------------- /test/modules/nodejs-websocket.js: -------------------------------------------------------------------------------- 1 | var test = require('tinytap'), 2 | ws = require("nodejs-websocket"); 3 | 4 | var port = 8000; 5 | 6 | test('basics', function (t) { 7 | ws.createServer(function (conn) { 8 | conn.on("text", function (s) { 9 | conn.sendText(s.toUpperCase()+"!!!") 10 | }); 11 | }).listen(port, function () { 12 | var self = this.socket; // ??? 13 | ws.connect('ws://localhost:' + self.address().port, function() { 14 | this.sendText("Testing 123") 15 | }).on('text', function (s) { 16 | t.equal(s, "TESTING 123!!!"); 17 | t.end(); 18 | }); 19 | }); 20 | }); -------------------------------------------------------------------------------- /test/todo/https-sni.js: -------------------------------------------------------------------------------- 1 | console.log('1..2') 2 | 3 | var https = require('https'); 4 | 5 | // Temporary tessel catchall 6 | https.get("https://sni.velox.ch/", function (res) { 7 | console.log('ok') 8 | console.log('# statusCode', res.statusCode) 9 | 10 | var buf = ''; 11 | res.on('data', function (data) { 12 | console.log('# received', data.length, 'bytes'); 13 | buf += String(data); 14 | }) 15 | res.on('close', function () { 16 | console.log('# result:', buf); 17 | console.log('ok'); 18 | }) 19 | }).on('error', function (e) { 20 | console.log('not ok -', e.message, 'error event #SKIP') 21 | }); 22 | -------------------------------------------------------------------------------- /tools/luajit-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | MYPATH=`dirname $0` 6 | TARGET="$(pwd)/$2" 7 | # gcc on Linux, clang on OS X, doesn't matter 8 | LJ_CC=gcc 9 | 10 | cd $MYPATH/../deps/colony-luajit 11 | if [[ "$1" == "arm" ]]; then 12 | make HOST_CC="$LJ_CC -m32" HOST_CFLAGS="-DLUAJIT_COLONY -g" CROSS="arm-none-eabi-" TARGET_SYS=Other TARGET_CFLAGS="-DLUAJIT_COLONY -mcpu=cortex-m3 -mthumb -gdwarf-2 -ggdb -mfloat-abi=soft" TARGET_SYS=arm || true 13 | else 14 | make HOST_CFLAGS="-DLUAJIT_COLONY -g" TARGET_CFLAGS="-DLUAJIT_COLONY -g" || true 15 | fi 16 | cd ../.. 17 | cp deps/colony-luajit/src/libluajit.a "$TARGET" 18 | -------------------------------------------------------------------------------- /src/colony/lua_bit.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | 10 | #ifndef L_BIT_H 11 | #define L_BIT_H 12 | 13 | #include "lua.h" 14 | #include "lauxlib.h" 15 | 16 | LUALIB_API int luaopen_bit (lua_State *L); 17 | 18 | #endif -------------------------------------------------------------------------------- /test/net/http-req-ip.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var http = require('http'); 6 | 7 | // Temporary tessel catchall 8 | 9 | // This is a hardcoded IP for google.com. 10 | http.request({ 11 | hostname: '64.233.167.99', 12 | port: 80, 13 | path: '/index.html', 14 | method: 'GET' 15 | }, function (res) { 16 | tap.eq(typeof res.statusCode, 'number'); 17 | console.log('# statusCode', res.statusCode) 18 | res.on('data', function (data) { 19 | console.log('# received', data.length, 'bytes'); 20 | }) 21 | }).on('error', function (e) { 22 | tap.ok(false, String(e)); 23 | }).end(); 24 | -------------------------------------------------------------------------------- /test/issues/out.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | return function (_ENV, _module) 4 | local exports, module = _module.exports, _module; 5 | 6 | 7 | local reduceBuffer = reduceBuffer; 8 | reduceBuffer = (function () local reduceBuffer = nil; reduceBuffer = function (this, buf, start, _K_end, fn, res) 9 | local i, len = i, len; 10 | --[[131]] i = start; len = end; 11 | while ((i)<(len)) do 12 | 13 | --[[186]] res = fn(this, res, buf[i]); 14 | 15 | local _r = i + 1; i = _r; 16 | end; 17 | --[[219]] if true then return res; end 18 | end; reduceBuffer.name = "reduceBuffer"; return reduceBuffer; end)() 19 | --[[0]] 20 | 21 | return _module.exports; 22 | end 23 | -------------------------------------------------------------------------------- /test/suite/require.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(4); 4 | 5 | var root = __dirname.replace(/[^\/]+\/[^\/]+$/, '') 6 | 7 | tap.ok(true, __dirname) 8 | tap.ok(true, root) 9 | 10 | tap.eq(require.resolve('../tap').substr(root.length), 'test/tap.js'); 11 | tap.eq(require.resolve('tape').substr(root.length), 'node_modules/tape/index.js'); 12 | tap.eq(require.resolve('./require').substr(root.length), 'test/suite/require.js'); 13 | 14 | try { 15 | require.resolve('./PHONY'); 16 | tap.ok(false, 'require.resolve cant find fake module'); 17 | } catch (e) { 18 | tap.ok(true, 'require.resolve cant find fake module'); 19 | } 20 | -------------------------------------------------------------------------------- /src/colony/lua_hsregex.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | 10 | #ifndef L_HSREGEX_H 11 | #define L_HSREGEX_H 12 | 13 | #include "lua.h" 14 | #include "lauxlib.h" 15 | 16 | LUALIB_API int luaopen_hsregex (lua_State *L); 17 | 18 | #endif -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.key_aes128.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: AES-128-CBC,ECA1836F07770828A77072CB8E75B461 4 | 5 | IEKSJV5xp91M43nqeO3tWV42uXhRuQq1QYlwHNTJoJ+P/+Pw2g6DODFU2xcWoM89 6 | /QHcZIjC+Er4GM/IcRWI307XWexpxd3SSsvDd1D08HU6DyPts7Yb9zy0bwzDfS1g 7 | wDhifACXUEYnpiTCAbO8Pni+4TMV4tQ25Iugis8IfUiBtqfsEAo/tOHbTIRTWUNN 8 | yh7LS+7TKU0GuvEUP6uoxn0i1tDXtP9vaqgkO+DNFgi8A/Pm98qdTvLtp8mNHlJx 9 | kX+U3+9yxm+HlwtjhU2DgHxBXq8eAtBW3rZj/pM7bFubSNeqbsD086hlxvom7ISa 10 | Rpm7QhoPcrbFYy3rjs2JyQBoRvIAPXX2tYCuKh+Iylq5KztPspGIXXd3Sxv4g1tB 11 | bQRVfmSwLNKo8rEP5vWa/DCVZl1GJoJTIR7vmQvGGkc= 12 | -----END RSA PRIVATE KEY----- 13 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-472.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(5) 4 | 5 | var arr = [1, 2, 3, 4, 5]; 6 | 7 | var compare = [ 8 | [0,3,4,5], 9 | [1,0,4,5], 10 | [1,2,0,5], 11 | [1,2,3,0], 12 | ] 13 | 14 | arr.forEach(function(val, index){ 15 | if (index+1 < arr.length) { 16 | var newArr = JSON.parse(JSON.stringify(arr)); 17 | newArr[index+1] = 0; 18 | newArr.splice(index, 1); 19 | tap.eq(newArr.join(','), compare[index].join(','), 'array splice iteration ' + index); 20 | } 21 | }); 22 | 23 | var arr2 = [1, 0, 2, 3] 24 | arr2.shift(); 25 | tap.eq(arr2.join(','), '0,2,3', 'array shift works with leading 0 index') 26 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.encrypted_pem.p8: -------------------------------------------------------------------------------- 1 | -----BEGIN ENCRYPTED PRIVATE KEY----- 2 | MIIBezAcBgoqhkiG9w0BDAEBMA4ECEHizqvZwHfYAgIIAASCAVkWuzUFR3hk3vXG 3 | BoX1ULCIr+Om40+UkD0T/Vxl8zo6Vuvl13vAYqo2eDSNd75yKpYle0gSHn+aVeWZ 4 | gKYrmpSqXF14CDeBXAd2GRwun9EIAwgkv9AMMPGzCXVTVFM/pLyuLexj283qvZf5 5 | /7Fe/cizYx/DxtiRw9QUsNWYckt3RAM6i87PTBw8uI7NqEMEkstHT51l5TR85JjL 6 | F8ZYSuqv9LH/jkWhoedgID35r+ffjeYV06clebuRJAIcS78LG8833D1SyINlnj4y 7 | Ts2NYf2R4CtR0rDJeDCcucDBnzPPIBv4JqsbUGDTMrlFIGJvmL4RuNP3TNIAk9tZ 8 | FHw2QEBrcv6XNQa8DJwk/162CdDxQG5uWc/Ye4hF5OXzAd6gxKz8u6C3wCq0q3+b 9 | PDc9wulGEejbL/lecZ7qT76CqYLupNmCBFAa8idGjAhU3LDwv4ooGF1aWFiGgG4= 10 | -----END ENCRYPTED PRIVATE KEY----- 11 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.key_aes256.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: AES-256-CBC,22B407B6BE071AC8FEADA8834A3C0FBB 4 | 5 | a9LRlNUJ0oatOOxS4eMMNd3mJLre6llYU8JXnJVFyuNzmh99sgdAFao2xDOoszYj 6 | ZcBUDD5OcZxDIVRNnbsCC7iDXsOdIrBseDmC/qiRouNZ8i2a6Dh7IMTrpToPxNQ6 7 | rfDC1pEf2yUtbK8fefzIKzkXz84igCGrqLCIz1aqW+xjOOoTfXXIZj/LoYueLzag 8 | i8/nasxFQqDFEFskH38dEOMTwiKs1xZh6cUA0sQo8l4IYiwjAsAqPMiNiOdBA6sD 9 | 9322LCQwPqqU7ZelTXl8NCWvxX5S5yxV7KYmEV7VeSiPj4/ZlI8t13TTw+2Lu5j0 10 | 35Rh18I5iUPsDUV8VaU3df81wQHnWamKFGUAY2imS8X7z1uUiUiycuJipZNSoAHx 11 | 3QvISza1zXCqbzs8lI8JQqja+Onope0CeeCBKBo9fuUirI8NsG6EPrnp5IxACPXl 12 | -----END RSA PRIVATE KEY----- 13 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_512.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBkjCB/AIJAKsIGKcDByf8MA0GCSqGSIb3DQEBBQUAMDQxMjAwBgNVBAoTKWF4 3 | VExTIFByb2plY3QgRG9kZ3kgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTEwMTIy 4 | NjIyMzMzOFoXDTI0MDkwMzIyMzMzOFowLDEWMBQGA1UEChMNYXhUTFMgUHJvamVj 5 | dDESMBAGA1UEAxMJMTI3LjAuMC4xMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMjK 6 | XU67trg56k7LhG5v5XhsUTpVFI5ZOpcat/ry3WhtJS6q3lnB3vGQ4n/U47F7yXVT 7 | IpDJ0Zxv2hm/0LfudBcCAwEAATANBgkqhkiG9w0BAQUFAAOBgQAblnZaFNsGtBkI 8 | K9rqJqB1HX4ty2lU8ALFvOfBdiUHXTjt0UAChirMdr96ELZutPic4P3Spe6oa7Ay 9 | YEuqS9I6/TN3iEHeBkG7tYRpfmUeFuZl8EqzWbLmQsMhNj0CE86utPOnkygYRYIK 10 | PRUw3ZLDlmePKJOZ3LC7kKBBNrKYgw== 11 | -----END CERTIFICATE----- 12 | -------------------------------------------------------------------------------- /src/colony/lua_rapidjson.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | 10 | #ifndef _LUA_RAPIDJSON_H_ 11 | #define _LUA_RAPIDJSON_H_ 12 | 13 | #include 14 | #include 15 | #include 16 | 17 | int lua_open_rapidjson(lua_State *L); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_aes128.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBkjCB/AIJAKsIGKcDBygCMA0GCSqGSIb3DQEBBQUAMDQxMjAwBgNVBAoTKWF4 3 | VExTIFByb2plY3QgRG9kZ3kgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTEwMTIy 4 | NjIyMzM0M1oXDTI0MDkwMzIyMzM0M1owLDEWMBQGA1UEChMNYXhUTFMgUHJvamVj 5 | dDESMBAGA1UEAxMJMTI3LjAuMC4xMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALll 6 | NkpkyLOhA5d2ys+edm5yNrkFg/vq++Uu6BXJEqvto7UabK624NzvI9APboEMbHVJ 7 | gceP8Gc05uj6rnldy+sCAwEAATANBgkqhkiG9w0BAQUFAAOBgQApsgHtuktgEuwC 8 | kWRG4e4wIRcWl6E1SN6tW0vtGU+KGXtAxXHikIfK/0krnfQMKfHGV4Rhj689X1j5 9 | CoYYBZduyc/hJuCMhwwEqELrSQ60Rv33tZniYZ/iYDQEoE//q4cvwG/sK830w9wx 10 | /5Dm3eR7kLXGtzHeVUnUWKGv4FILNw== 11 | -----END CERTIFICATE----- 12 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_aes256.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBkjCB/AIJAKsIGKcDBygDMA0GCSqGSIb3DQEBBQUAMDQxMjAwBgNVBAoTKWF4 3 | VExTIFByb2plY3QgRG9kZ3kgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTEwMTIy 4 | NjIyMzM0M1oXDTI0MDkwMzIyMzM0M1owLDEWMBQGA1UEChMNYXhUTFMgUHJvamVj 5 | dDESMBAGA1UEAxMJMTI3LjAuMC4xMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKwr 6 | ugc8AhMAcq/BiZYLgyKL9mAWBHDJxuUGS/NHE2WDdMOVE1Tf1Ame4onsYVTorN0Y 7 | /3Emj8/WBcBpqmRxHtUCAwEAATANBgkqhkiG9w0BAQUFAAOBgQBr2uCTrm9d9x4B 8 | MIak3R+RxRUb3920uhASV8PMZ0vYXW2qPnHKAol8ZK2p5ywTzPPRjlTQpF65y9aM 9 | K3wFRR7hjBfbf9qzr5jwh3p658OoXSQ9hR0KxvgeDWvnLZRJAAebl/4FE1XV0HZ8 10 | qhFk5fMnD5nabFdq4FK6pWQjUZjMmw== 11 | -----END CERTIFICATE----- 12 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_bad_after.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBkjCB/AIJAKsIGKcDBygFMA0GCSqGSIb3DQEBBQUAMDQxMjAwBgNVBAoTKWF4 3 | VExTIFByb2plY3QgRG9kZ3kgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTEwMTIy 4 | NjIyMzM0NFoXDTA5MTIyNjIyMzM0NFowLDEWMBQGA1UEChMNYXhUTFMgUHJvamVj 5 | dDESMBAGA1UEAxMJMTI3LjAuMC4xMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMjK 6 | XU67trg56k7LhG5v5XhsUTpVFI5ZOpcat/ry3WhtJS6q3lnB3vGQ4n/U47F7yXVT 7 | IpDJ0Zxv2hm/0LfudBcCAwEAATANBgkqhkiG9w0BAQUFAAOBgQCdnukuKxxoJB14 8 | jBVwv4fZLffn3b/GT2LrjLCtk9/mQv9ECbHxOZ9ZOGtFCkkMIP6lnzrng/U/fTT4 9 | hMdxCCEljxUA7zdCvvLjNgYYW4B4BiEwOokG33fIGM/6dpVrybxJ4Z225AvKAkU9 10 | p8h6yItFqR4/SMYqZLzsr75PlCKyIw== 11 | -----END CERTIFICATE----- 12 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_bad_before.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBkjCB/AIJAKsIGKcDBygEMA0GCSqGSIb3DQEBBQUAMDQxMjAwBgNVBAoTKWF4 3 | VExTIFByb2plY3QgRG9kZ3kgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MB4XDTI0MTIz 4 | MTE0MDAwMFoXDTI1MTIzMTE0MDAwMFowLDEWMBQGA1UEChMNYXhUTFMgUHJvamVj 5 | dDESMBAGA1UEAxMJMTI3LjAuMC4xMFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMjK 6 | XU67trg56k7LhG5v5XhsUTpVFI5ZOpcat/ry3WhtJS6q3lnB3vGQ4n/U47F7yXVT 7 | IpDJ0Zxv2hm/0LfudBcCAwEAATANBgkqhkiG9w0BAQUFAAOBgQCMgBB+4M4ud6Zf 8 | kZgxFB+upuKhRkXD+6Am2N+XGvJzsB8CsZ4jMxPczgZwrMTPKxm/bCbX7ftLwtps 9 | 77eyjihTCE3WzFZMEwT+mY28Cn0B7FkovrLvKEXQROfyDwkt7HWBGJEuSO6JAdAa 10 | 0mesxjwqjiLmmBoY5BLtfc1CGa8muw== 11 | -----END CERTIFICATE----- 12 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-659.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(5); 4 | 5 | var b; 6 | 7 | b = new Buffer(4); 8 | b.fill('a'); 9 | tap.eq('aaaa', b.toString(), 'buffer contains "aaaa"'); 10 | 11 | b = new Buffer(4); 12 | b.fill('ab'); 13 | tap.eq('aaaa', b.toString(), 'buffer contains "aaaa"'); 14 | 15 | b = new Buffer(4); 16 | b.fill('abc'); 17 | tap.eq('aaaa', b.toString(), 'buffer contains "aaaa"'); 18 | 19 | b = new Buffer(10); 20 | b.fill('abc'); 21 | tap.eq('aaaaaaaaaa', b.toString(), 'buffer contains "aaaaaaaaaa"'); 22 | 23 | b = new Buffer([0x10, 0x20, 0x30, 0x40]); 24 | b.fill(''); 25 | tap.eq('\0\0\0\0', b.toString(), 'buffer contains "\\0\\0\\0\\0"') 26 | -------------------------------------------------------------------------------- /src/colony/lua/colony.lua: -------------------------------------------------------------------------------- 1 | -- Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | -- file at the top-level directory of this distribution. 3 | -- 4 | -- Licensed under the Apache License, Version 2.0 or the MIT license 6 | -- , at your 7 | -- option. This file may not be copied, modified, or distributed 8 | -- except according to those terms. 9 | 10 | -- 11 | -- colony.lua 12 | -- In order: initialize metatables, load JS API, then Node API. 13 | -- 14 | 15 | _G.colony = {} 16 | require('colony-init') 17 | require('colony-js') 18 | require('colony-node') 19 | return colony 20 | -------------------------------------------------------------------------------- /test/suite/event-error.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(4); 4 | 5 | var EventEmitter = require('events').EventEmitter; 6 | 7 | var a = new EventEmitter 8 | 9 | try { 10 | a.emit('error', 'some error') 11 | } catch (e) { 12 | tap.ok(e instanceof TypeError); 13 | } 14 | 15 | try { 16 | a.emit('error', new RangeError('some error')) 17 | } catch (e) { 18 | tap.ok(e instanceof RangeError); 19 | } 20 | 21 | a.once('error', function (err) { 22 | tap.ok(typeof err == 'string'); 23 | }); 24 | 25 | a.emit('error', 'some error') 26 | 27 | a.once('error', function (err) { 28 | tap.ok(err instanceof SyntaxError); 29 | }); 30 | 31 | a.emit('error', new SyntaxError('some error')) 32 | -------------------------------------------------------------------------------- /test/todo/https-req-ip.js: -------------------------------------------------------------------------------- 1 | console.log('1..1') 2 | 3 | var https = require('https'); 4 | 5 | // Temporary tessel catchall 6 | try { 7 | https.request({ 8 | hostname: '74.125.224.72', 9 | port: 443, 10 | path: '/', 11 | method: 'GET', 12 | headers: { 13 | 'Host': 'www.google.com' 14 | } 15 | }, function (res) { 16 | console.log('ok') 17 | console.log('# statusCode', res.statusCode) 18 | res.on('data', function (data) { 19 | console.log('# received', data.length, 'bytes'); 20 | console.log(data); 21 | }) 22 | }).on('error', function (e) { 23 | console.log('not ok -', e.message, '#SKIP') 24 | }); 25 | } catch (e) { 26 | console.log('not ok -', e.message, '#SKIP') 27 | } -------------------------------------------------------------------------------- /test/suite/keywords.js: -------------------------------------------------------------------------------- 1 | console.log('1..2') 2 | 3 | // first lua keywords 4 | var a = {}; 5 | a.and = 1; 6 | a.break = 1; 7 | a.do = 1; 8 | a.else = 1; 9 | a.elseif = 1; 10 | a.end = 1; 11 | a.false = 1; 12 | a.for = 1; 13 | a.function = 1; 14 | a.if = 1; 15 | a.in = 1; 16 | a.local = 1; 17 | a.nil = 1; 18 | a.not = 1; 19 | a.or = 1; 20 | a.repeat = 1; 21 | a.return = 1; 22 | a.then = 1; 23 | a.true = 1; 24 | a.until = 1; 25 | a.while = 1; 26 | a.error = 1; 27 | 28 | console.log('ok', 1) 29 | 30 | var repeat; 31 | repeat = true; 32 | while (repeat) { 33 | repeat = false; 34 | } 35 | repeat = true; 36 | for (; repeat; ){ 37 | repeat = false; 38 | } 39 | do { 40 | } while (repeat); 41 | 42 | console.log('ok'); 43 | -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_main.lp: -------------------------------------------------------------------------------- 1 | 2 | Embeded Lua Test 3 | 4 | 5 | cgi = { 6 | \n", vv, a, tostring(b)) 12 | end 13 | v = vv.."}" 14 | end 15 | ?> 16 | <%= i %> = <%= tostring(v) %>
17 | <% 18 | end 19 | %> 20 | } 21 |
22 | Remote address: <%= cgilua.servervariable"REMOTE_ADDR" %> 23 |
24 | Is persistent = <%= tostring (SAPI.Info.ispersistent) %> 25 |
26 | ap =
27 | lfcgi = <% = tostring(lfcgi) %>
28 | <%= (ap and ap.handler()) or "" %>
29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/dlmallocfork.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | 10 | #include 11 | 12 | void dlmallocfork_restore (void* _source, int source_max, void* _target, int target_max); 13 | void dlmallocfork_save (void* _source, int source_max, void* _target, int target_max); 14 | size_t dlmallocfork_save_size (void* _ptr, int max); -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_fs.lua: -------------------------------------------------------------------------------- 1 | function link_dir (dir, base) 2 | local path = base.."/"..dir 3 | local mode = lfs.attributes (path).mode 4 | if mode == "directory" then 5 | return string.format ('%s', 6 | cgilua.mkurlpath ("test_fs.lua", { dir = path }), 7 | dir) 8 | else 9 | return dir 10 | end 11 | end 12 | 13 | cgilua.htmlheader () 14 | cgilua.put ("

Testing Filesystem library

\n") 15 | cgilua.put ("\n") 16 | cgilua.put ("\n") 17 | local i = 0 18 | local dir = cgi.dir or "." 19 | for file in lfs.dir (dir) do 20 | i = i+1 21 | cgilua.put ("\n") 22 | end 23 | cgilua.put ("
Testing dir
"..i..""..link_dir(file, dir).."
\n") 24 | -------------------------------------------------------------------------------- /test/suite/process.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(7); 4 | 5 | tap.eq(typeof process.version, 'string', 'process version exists as a string'); 6 | 7 | var start = process.hrtime(); 8 | setTimeout(function () { 9 | var diff = process.hrtime(start); 10 | 11 | tap.ok(Array.isArray(start), 'hrtime returns an array') 12 | tap.eq(start.length, 2, 'hrtime returns a type of numbers') 13 | tap.eq(typeof start[0], 'number', 'hrtime returns an array') 14 | tap.eq(typeof start[1], 'number', 'hrtime returns an array') 15 | 16 | tap.ok(Array.isArray(diff), 'hr can take an argument and return a diff'); 17 | tap.ok(diff[0] == start[0] ? diff[0] <= start : diff[0] < start[0], 'hrtime diff is lower than start') 18 | }, 100); 19 | -------------------------------------------------------------------------------- /test/todo/https-get.js: -------------------------------------------------------------------------------- 1 | console.log('1..2') 2 | 3 | var https = require('https'); 4 | 5 | // Temporary tessel catchall 6 | try { 7 | https.get("https://api.github.com/", function (res) { 8 | console.log('ok') 9 | console.log('# statusCode', res.statusCode) 10 | 11 | var buf = ''; 12 | res.on('data', function (data) { 13 | console.log('# received', data.length, 'bytes'); 14 | buf += String(data); 15 | }) 16 | res.on('close', function () { 17 | console.log('# result:', JSON.parse(buf)); 18 | console.log('ok'); 19 | }) 20 | }).on('error', function (e) { 21 | console.log('not ok -', e.message, 'error event #SKIP') 22 | }); 23 | } catch (e) { 24 | console.log('not ok -', e.message, 'error thrown #SKIP') 25 | } -------------------------------------------------------------------------------- /test/issues/issue-beta-213.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(7); 4 | 5 | var n = 0xF0F0F0F0E1; 6 | tap.ok(String(n) == '1034834473185'); 7 | tap.ok(n.toString(10) == '1034834473185'); 8 | console.log("# base 10:", n.toString(10), '==', '1034834473185'); 9 | tap.ok(n.toString(16) == 'f0f0f0f0e1'); 10 | console.log("# base 16:", n.toString(16), '==', 'f0f0f0f0e1'); 11 | 12 | var n = 1034834473185; 13 | tap.ok(String(n) == '1034834473185'); 14 | tap.ok(n.toString(10) == '1034834473185'); 15 | console.log('# base 10:', n.toString(10), '==', '1034834473185'); 16 | tap.ok(n.toString(16) == 'f0f0f0f0e1'); 17 | console.log('# base 16:', n.toString(16), '==', 'f0f0f0f0e1'); 18 | 19 | tap.ok((0xFFFFFFFF * 2) > 0xFFFFFFFF, "supports > 0xFFFFFFFF") -------------------------------------------------------------------------------- /test/suite/tls.js: -------------------------------------------------------------------------------- 1 | var tls = require('tls'), 2 | tap = require('../tap'); 3 | 4 | tap.count(3); 5 | 6 | var options = { 7 | host : 'www.google.com', 8 | port : 443, 9 | //rejectUnauthorized: false 10 | }; 11 | 12 | var socket = tls.connect(options, function connected() { 13 | tap.eq(true, true, 'connect callback is called'); 14 | }); 15 | 16 | socket.once('secureConnect', function() { 17 | tap.eq(true, true, 'secureConnect event is called'); 18 | socket.write('GET / HTTP/1.1\nAccept: */*\nHost: www.google.com\nUser-Agent: HTTPie/0.7.2\n\n'); 19 | }); 20 | 21 | socket.once('data', function(data) { 22 | tap.eq(data.length > 0, true, 'we got data back from google over a secure TCP socket'); 23 | socket.destroy(); 24 | }); 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/todo/https-fail-sni.js: -------------------------------------------------------------------------------- 1 | console.log('1..2') 2 | 3 | var https = require('https'); 4 | var dns = require('dns'); 5 | 6 | // Temporary tessel catchall 7 | dns.resolve('sni.velox.ch', function (err, addresses) { 8 | https.get("https://" + addresses[0] + "/", function (res) { 9 | console.log('ok') 10 | console.log('# statusCode', res.statusCode) 11 | 12 | var buf = ''; 13 | res.on('data', function (data) { 14 | console.log('# received', data.length, 'bytes'); 15 | buf += String(data); 16 | }) 17 | res.on('close', function () { 18 | console.log('# result:', buf); 19 | console.log('ok'); 20 | }) 21 | }).on('error', function (e) { 22 | console.log('not ok -', e.message, 'error event #SKIP') 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /test/issues/issue-beta-162.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | var loopNum = 0; 6 | 7 | console.log('Starting outer loop.'); 8 | var outerLoop = setInterval(function(){ 9 | loopNum++; 10 | console.log('.. Starting inner loop #', loopNum); 11 | var myLoop = setInterval(function(){ 12 | console.log('.. -- looped [10ms]'); 13 | }, 10); 14 | setTimeout(function(){ 15 | console.log('.. Clearing inner loop #' + loopNum + ' after 50ms. (5 iterations)'); 16 | clearInterval(myLoop); 17 | }, 50); 18 | }, 60); 19 | 20 | setTimeout(function(){ 21 | console.log('Stopping outer loop after 1000ms (' + (1000/60 - 1).toFixed(0) + ' iterations)'); 22 | clearInterval(outerLoop); 23 | tap.ok(true); 24 | }, 1000); 25 | -------------------------------------------------------------------------------- /deps/axtls/www/lua/prepara_sql2.lua: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/lua 2 | 3 | MAX_ROWS = arg[1] or 10 4 | 5 | require"postgres" 6 | 7 | local env = assert (luasql.postgres ()) 8 | local conn = assert (env:connect ("luasql-test", "tomas")) 9 | 10 | -- Apaga restos de outros testes. 11 | conn:execute "drop table t2" 12 | conn:execute "drop table t1" 13 | 14 | -- Criando as tabelas. 15 | assert (conn:execute [[create table t1 ( 16 | a int, 17 | b int 18 | )]]) 19 | assert (conn:execute [[create table t2 ( 20 | c int, 21 | d int 22 | )]]) 23 | 24 | -- Preenchedo as tabelas. 25 | for i = 1, MAX_ROWS do 26 | local ii = 2*i 27 | assert (conn:execute (string.format ([[ 28 | insert into t1 values (%d, %d); 29 | insert into t2 values (%d, %d);]], 30 | ii, i, ii, i))) 31 | end 32 | -------------------------------------------------------------------------------- /test/issues/issue-beta-140.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(3); 4 | 5 | function arreq (a, b) { 6 | if (a.length != b.length) { 7 | return false; 8 | } 9 | for (var i = 0; i < a.length; i++) { 10 | if (a[i] != b[i]) { 11 | return false; 12 | } 13 | } 14 | return true; 15 | } 16 | 17 | var header = [0x02, 0x02, 0x00]; 18 | var data = new Array(0x02); 19 | tap.ok(header.concat(data).length == 5, 'array concat length') 20 | console.log('# -->', header.concat(data).length) 21 | tap.ok(arreq(header.concat(data), [2, 2, 0, undefined, undefined]), 'array concat') 22 | console.log('#', header.concat(data)) 23 | tap.ok([2, 2, 0, undefined, undefined].length == 5, 'array length'); 24 | console.log('#', [2, 2, 0, undefined, undefined].length); 25 | -------------------------------------------------------------------------------- /test/issues/issue-beta-342.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(6); 4 | 5 | var arg = "Hello Friends"; 6 | var ret = Buffer.concat( [ arg ] ); 7 | tap.eq(arg, ret); 8 | 9 | try { 10 | Buffer.concat( [ arg, arg ] ); 11 | tap.ok(false); 12 | } catch (e) { 13 | tap.ok(e); 14 | } 15 | 16 | var a = new Buffer(16); 17 | var b = new Buffer(16); 18 | a.copy(b, 256, 0, 0); 19 | tap.ok(true); 20 | 21 | var rando = new Buffer(16); 22 | Buffer.concat([rando, rando], 32); 23 | Buffer.concat([rando, rando], 31); 24 | Buffer.concat([rando, rando], 128); 25 | tap.ok(true); 26 | try { 27 | Buffer.concat([rando, rando], 8) 28 | tap.ok(false); 29 | } catch (e) { 30 | tap.ok(e); 31 | } 32 | 33 | try { 34 | Buffer.concat() 35 | } catch (e) { 36 | tap.ok(e); 37 | } 38 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-239.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(4); 4 | 5 | try { 6 | // Invalid use: not an array 7 | Buffer.concat(new Buffer([1, 2, 3]), 'hey', new Buffer([4, 5, 6])) 8 | } catch (e) { 9 | tap.ok(e instanceof TypeError); 10 | tap.ok(e.message && e.message.indexOf('Usage') > -1); 11 | } 12 | 13 | try { 14 | // Invalid use: no method .copy 15 | Buffer.concat([new Buffer([1, 2, 3]), 'hey', new Buffer([4, 5, 6])]) 16 | } catch (e) { 17 | tap.ok(String(e).indexOf('copy') > -1); 18 | } 19 | 20 | try { 21 | Buffer.concat([new Buffer([1, 2, 3]), new Buffer('hey'), new Buffer([4, 5, 6])]) 22 | tap.ok(true, 'correct Buffer.concat usage') 23 | } catch (e) { 24 | tap.ok(false, 'correct Buffer.concat usage') 25 | } -------------------------------------------------------------------------------- /test/suite/streams.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1); 4 | 5 | var Readable = require('stream').Readable; 6 | var Writable = require('stream').Writable; 7 | var Transform = require('stream').Transform; 8 | 9 | var input = ["1", "2", "3"] 10 | 11 | var A = new Readable(); 12 | A._read = function () { 13 | this.push(input.shift()); 14 | } 15 | 16 | var B = new Transform(); 17 | B._transform = function (chunk, encoding, callback) { 18 | this.push(chunk); 19 | setImmediate(callback); 20 | } 21 | 22 | var C = new Writable(); 23 | C._write = function (chunk, encoding, callback) { 24 | console.log('#', chunk); 25 | callback(); 26 | } 27 | 28 | A.pipe(B).pipe(C).on('finish', function () { 29 | tap.ok(true, 'stream piping ended with end event') 30 | }); 31 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_1024.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIB1zCCAUACCQCrCBinAwcn/TANBgkqhkiG9w0BAQUFADA0MTIwMAYDVQQKEylh 3 | eFRMUyBQcm9qZWN0IERvZGd5IENlcnRpZmljYXRlIEF1dGhvcml0eTAeFw0xMDEy 4 | MjYyMjMzMzlaFw0yNDA5MDMyMjMzMzlaMCwxFjAUBgNVBAoTDWF4VExTIFByb2pl 5 | Y3QxEjAQBgNVBAMTCTEyNy4wLjAuMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC 6 | gYEAzf2JSL42uZV21BMwDr+y7WcKwBY/UQmdKS+ybT8+bC+QgKFx3744xcupmkAU 7 | kAr5twcL4drnCb8NV0GGYKHBJ5FbCphGG/aihPhlx84tlheqkfhhBFBw67RDt9ya 8 | zDEBFNTNzMI3bWmC1sbEvvI0pcmmGVMyeoYOkYIPoUJUqgECAwEAATANBgkqhkiG 9 | 9w0BAQUFAAOBgQBAtJSaqIlyHQfls2uIIcI4Np56jElIaAwG6NsfTgXmMeP95g1r 10 | 2BMX4C0NuH7LIGyoc6f946f68wJgeB8TQEXudfUQ/Y9odNSsrgQJVSzb2AcHZWkn 11 | br9eYUBWi9czO/9uU36dP8BAOqugUE6AR0YNHttM8RtdPCpUp036e3JmxQ== 12 | -----END CERTIFICATE----- 13 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_1042.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIB2TCCAUICCQCrCBinAwcn/jANBgkqhkiG9w0BAQUFADA0MTIwMAYDVQQKEylh 3 | eFRMUyBQcm9qZWN0IERvZGd5IENlcnRpZmljYXRlIEF1dGhvcml0eTAeFw0xMDEy 4 | MjYyMjMzNDBaFw0yNDA5MDMyMjMzNDBaMCwxFjAUBgNVBAoTDWF4VExTIFByb2pl 5 | Y3QxEjAQBgNVBAMTCTEyNy4wLjAuMTCBoTANBgkqhkiG9w0BAQEFAAOBjwAwgYsC 6 | gYMDUYXtMubODhuyrWhYD7fomF6ZQMdjvQSYQIEEzdP0NsZq6a3wM1k6dMB1hmMs 7 | GbT5jNfen3JdhL2s8AQ4rio6HJD3RCegOKr9Rt2r62MvWFSMflc6X4bH+bFxsnIV 8 | jW6D+FLSeVPeVxpB0BVIQv2qSFNrTDlYbKU/RtGDx+TfgM354QIDAQABMA0GCSqG 9 | SIb3DQEBBQUAA4GBAIEoXdKa4a2ThBYfcfAO8CCwnU4qUKOpAut3k3XSRdwOnQrG 10 | epJ3UP1OpoMeoN2gtagcjcTzhXv/QPYbx5lRko5QfERFJwpNthy+Z8pa11JNY1dX 11 | YugRs4Ad1BoKrCBYnm/QE7ZKVPEGFt2b/geFAW8HpndNWzn2PnTcdDQ/tC2X 12 | -----END CERTIFICATE----- 13 | -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_sql2.lua: -------------------------------------------------------------------------------- 1 | require"postgres" 2 | 3 | local env = assert (luasql.postgres ()) 4 | local conn = assert (env:connect ("luasql-test", "tomas")) 5 | local cur = assert (conn:execute ("select count(*) from t1")) 6 | local total = tonumber (cur:fetch()) 7 | cur:close() 8 | local aleatorio = math.random(total) 9 | local cur = assert (conn:execute ("select * from t1, t2 where b = d and a != "..2*aleatorio)) 10 | 11 | cgilua.htmlheader() 12 | cgilua.put ("Aleatorio = "..aleatorio.."
\n") 13 | 14 | local a,b,c,d = cur:fetch() 15 | cgilua.put ("\n") 16 | while a do 17 | -- cgilua.put ("") 18 | a,b,c,d = cur:fetch() 19 | end 20 | cgilua.put ("
",a,"",b,"",c,"",d,"
\n") 21 | 22 | cur:close() 23 | conn:close() 24 | env:close() 25 | -------------------------------------------------------------------------------- /test/issues/issue-beta-179.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var util = require('util'); 6 | var events = require('events'); 7 | 8 | function Test(name) { 9 | this.name = name; 10 | } 11 | 12 | util.inherits(Test, events.EventEmitter); 13 | 14 | var t = new Test("t"); 15 | 16 | t.once('booted', bootSequence.bind(t)); 17 | 18 | var c = new Test("c"); 19 | 20 | c.once('booted', bootSequence.bind(c)); 21 | 22 | function bootSequence(data) { 23 | setImmediate(function() { 24 | tap.ok(data, this.name); 25 | }.bind(this)); 26 | } 27 | 28 | t.emit('booted', true); 29 | 30 | c.emit('booted', true); 31 | 32 | console.log('# no more not oks'); 33 | 34 | t.emit('booted', false); 35 | 36 | c.emit('booted', false); 37 | 38 | t.emit('booted', false); -------------------------------------------------------------------------------- /test/suite/parse-numbers.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(13); 4 | 5 | var s = '10'; 6 | tap.ok(parseInt(s,10) == 10); 7 | tap.ok(parseFloat(s,10) == 10); 8 | console.log("# base 10:", parseInt(s,10)); 9 | tap.ok(parseInt(s,16) == 16); 10 | tap.ok(parseFloat(s,16) == 10); 11 | console.log("# base 16:", parseInt(s,16)); 12 | tap.ok(parseInt(s,2) == 2); 13 | tap.ok(parseFloat(s,2) == 10); 14 | console.log("# base 2:", parseInt(s,2)); 15 | 16 | tap.ok(parseInt('0399') == 399, 'octal int'); 17 | tap.ok(parseFloat('0399') == 399, 'octal float'); 18 | 19 | // stress test invalid radixes 20 | tap.ok(parseInt(s,0) == 10, 'radix 0'); 21 | tap.ok(isNaN(parseInt(s,37))); 22 | tap.ok(isNaN(parseInt(s,1))); 23 | tap.ok(isNaN(parseInt(s,"1"))); 24 | tap.ok(!isNaN(parseFloat(s,0))); -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.ca_x509.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIB3zCCAUgCCQD76Ccq3Co3qjANBgkqhkiG9w0BAQUFADA0MTIwMAYDVQQKEylh 3 | eFRMUyBQcm9qZWN0IERvZGd5IENlcnRpZmljYXRlIEF1dGhvcml0eTAeFw0xMDEy 4 | MjYyMjMzMzdaFw0yNDA5MDMyMjMzMzdaMDQxMjAwBgNVBAoTKWF4VExTIFByb2pl 5 | Y3QgRG9kZ3kgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA 6 | A4GNADCBiQKBgQCfxX6VHEhZNsMIqPPxt53h1UpfX1jU7ctqwBR4dpWRj3H6cCBN 7 | EK8xj7IVcBTJq6vcMRDwrAUrElSIZl8Kv6+ZqhTss2j+E2tfzkzehP9LcAdAR+UM 8 | JPBsYXic/+vmH5JCMO7CXLUsDJmO2q2Z1TjTtchu2DgAueTo0hWRtMvbMwIDAQAB 9 | MA0GCSqGSIb3DQEBBQUAA4GBABoJU0aQMTocVLNbcY4tbfqLck2oAn/OVjG0p/8p 10 | GIJzlVKOtZ76ZkqHIbcXNKNlgjXy+4S3R+6+mkYcn0JVbVg7eN0tsDlMB04YyFaD 11 | 95D47KEzmDky4Yj2nqI4SmvVTf2lyYxV1zknrFUXND+WvjGxge3gpJxtMoTGE5E0 12 | Jc3F 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /test/suite/with.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(7); 4 | 5 | var internal = function () { 6 | return 'external'; 7 | } 8 | 9 | var external = function () { 10 | return 'external'; 11 | } 12 | 13 | var obj = { 14 | internal: function () { 15 | return 'internal'; 16 | } 17 | } 18 | 19 | var a = 5; 20 | with (obj) { 21 | tap.eq(internal(), 'internal') 22 | tap.eq(external(), 'external'); 23 | obj.external = function () { 24 | return 'internal'; 25 | } 26 | tap.eq(external(), 'internal'); 27 | a = 6; 28 | } 29 | tap.eq(a, 6); 30 | 31 | t = 5; 32 | var a, x, y; 33 | var r = 10; 34 | 35 | with (Math) { 36 | a = PI * r * r; 37 | x = r * cos(PI); 38 | y = r * sin(PI / 2); 39 | } 40 | 41 | tap.eq(a, Math.PI * 100) 42 | tap.eq(x, -10) 43 | tap.eq(y, 10) 44 | -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_variables.lp: -------------------------------------------------------------------------------- 1 | 2 | <% for _, var in pairs { "SERVER_SOFTWARE", "SERVER_NAME", "GATEWAY_INTERFACE", "SERVER_PROTOCOL", "SERVER_PORT", "REQUEST_METHOD", "PATH_INFO", "PATH_TRANSLATED", "SCRIPT_NAME", "QUERY_STRING", "REMOTE_HOST", "REMOTE_ADDR", "AUTH_TYPE", "REMOTE_USER", "REMOTE_IDENT", "CONTENT_TYPE", "CONTENT_LENGTH", "HTTP_REFERER", "HTTP_COOKIE", "SCRIPT_FILENAME", "DOCUMENT_ROOT", } do %> 3 | 4 | <% end %> 5 |
<%= var %>="<%= cgilua.servervariable(var) or "not defined"%>"
6 | 7 |

8 | 9 | <% for _, var in ipairs { "script_file", "script_path", "script_pdir", "script_vdir", "script_vpath", "urlpath", } do %> 10 | 11 | <% end %> 12 |
<%= var %>="<%= cgilua[var] %>"
13 | 14 |

15 | -------------------------------------------------------------------------------- /config/colony.gyp: -------------------------------------------------------------------------------- 1 | { 2 | "includes": [ 3 | "common.gypi", 4 | ], 5 | 6 | "targets": [ 7 | { 8 | "target_name": "colony", 9 | "product_name": "colony", 10 | "type": "executable", 11 | 'cflags': [ '-Wall', '-Wextra', '-Werror' ], 12 | "sources": [ 13 | '<(runtime_path)/colony/cli.c', 14 | ], 15 | 'xcode_settings': { 16 | 'OTHER_LDFLAGS': [ 17 | '-pagezero_size', '10000', '-image_base', '100000000' 18 | ], 19 | }, 20 | "include_dirs": [ 21 | '<(runtime_path)/', 22 | '<(runtime_path)/colony/', 23 | "<(colony_lua_path)/src", 24 | ], 25 | "dependencies": [ 26 | 'libcolony.gyp:libcolony', 27 | 'libtm.gyp:libtm', 28 | ], 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/ms_iis.cer: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIB5jCCAVOgAwIBAgIQWPe7KyA+U7lLUohulwW2HDAJBgUrDgMCHQUAMCExHzAd 3 | BgNVBAMTFmF4dGxzLmNlcm9jY2x1Yi5jb20uYXUwHhcNMDgwMzE3MTAyMTA2WhcN 4 | MDkwMzE3MTAyMTA2WjAhMR8wHQYDVQQDExZheHRscy5jZXJvY2NsdWIuY29tLmF1 5 | MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9JqHlQjrQMt3JW8yxcGhFagDa 6 | D4QiIY8+KItTt13fIBt5g1AG4VXniaylSqKKYNPwVzqSWl7WhxMmoFU73veF8o4M 7 | G0Zc5qbVB6ukrSV4WaTgHrIO6pWkyiaQ4L/eYfCo/2pByhl0IUKkf/TMN346/rFg 8 | JgrElx01l6QHNQrzVQIDAQABoycwJTATBgNVHSUEDDAKBggrBgEFBQcDATAOBgNV 9 | HQ8EBwMFALAAAAAwCQYFKw4DAh0FAAOBgQAbH94H1fryngROJ//Oa0D3vvTO8CJ3 10 | 8VW+3gQEwrPBOWmN6RV8OM0dE6pf8wD3s7PTCcM5+/HI1Qk53nUGrNiOmKM1s0JB 11 | bvsO9RT+UF8mtdbo/n30M0MHMWPCC76baW3R+ANBp/V/z4l1ytpUTt+MHvz0VlUs 12 | J4uJA3s3uh23Tg== 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /test/issues/issue-beta-394.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(5); 4 | 5 | var a = {}; 6 | 7 | Object.defineProperty(a, 'hello', { 8 | value: 'hi' 9 | }) 10 | 11 | tap.eq(a.hello, 'hi'); 12 | 13 | try { 14 | Object.defineProperty(null, 'hello', { 15 | value: 'hi' 16 | }) 17 | tap.ok(false); 18 | } catch (e) { 19 | tap.ok(true); 20 | } 21 | 22 | try { 23 | Object.defineProperty('', 'hello', { 24 | value: 'hi' 25 | }) 26 | tap.ok(false); 27 | } catch (e) { 28 | tap.ok(e); 29 | } 30 | 31 | try { 32 | Object.defineProperty(0, 'hello', { 33 | value: 'hi' 34 | }) 35 | tap.ok(false); 36 | } catch (e) { 37 | tap.ok(e); 38 | } 39 | 40 | try { 41 | Object.defineProperty(true, 'hello', { 42 | value: 'hi' 43 | }) 44 | tap.ok(false); 45 | } catch (e) { 46 | tap.ok(e); 47 | } 48 | -------------------------------------------------------------------------------- /test/issues/issue-beta-73.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(1); 4 | 5 | !function(){function n(n){function e(){for(;i=ap;){var u=a++,e=c[u],o=t.call(e,1);o.push(l(u)),++p,e[0].apply(null,o)}}function l(n){return function(u,t){--p,null==s&&(null!=u?(s=u,a=d=0/0,o()):(c[n]=t,--d?i||e():o()))}}function o(){null!=s?m(s):f?m(s,c):m.apply(null,[s].concat(c))}var r,i,f,c=[],a=0,p=0,d=0,s=null,m=u;return n||(n=1/0),r={defer:function(){return s||(c.push(arguments),++d,e()),r},await:function(n){return m=n,f=!1,d||o(),r},awaitAll:function(n){return m=n,f=!0,d||o(),r}}}function u(){}var t=[].slice;n.version="1.0.7","function"==typeof define&&define.amd?define(function(){return n}):"object"==typeof module&&module.exports?module.exports=n:this.queue=n}(); 6 | 7 | tap.ok(true, 'loaded minified code.'); 8 | -------------------------------------------------------------------------------- /test/suite/hash.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(1) 4 | 5 | var a = { hi: "hi", heya: "there", hellos: "amigos", hitheres: "goodbye" } 6 | 7 | console.log('... nullifying values') 8 | 9 | a.hellos = null 10 | a.hi = null 11 | 12 | console.log('... setting new values') 13 | 14 | a.abcdefghij = "pear" 15 | a.abcdefghijkl = "cob" 16 | 17 | console.log('... should output some undefined values:') 18 | for (var key in a) { 19 | console.log(key, '=>', a[key]) 20 | } 21 | 22 | console.log(); 23 | 24 | 25 | console.log('... array test'); 26 | var b = [1, 2, 3, 4, 5] 27 | console.log(b.length, '==5'); 28 | b[4] = null 29 | console.log(b.length, '==5'); 30 | b[2] = null 31 | console.log(b.length, '==5'); 32 | b[20] = 5 33 | console.log(b.length, '==21'); 34 | 35 | tap.ok(true, 'hash test passed without error'); 36 | -------------------------------------------------------------------------------- /deps/axtls/www/lua/env.lua: -------------------------------------------------------------------------------- 1 | -- This file should be executed before any script in this directory 2 | -- according to the configuration (cgilua/conf.lua). 3 | 4 | pcall (cgilua.enablesession) 5 | 6 | local put, mkurlpath = cgilua.put, cgilua.mkurlpath 7 | 8 | cgilua.addclosefunction (function () 9 | put [[ 10 |

11 | 12 | Main]] 13 | for _, test in { 14 | { "Get", "test_main.lua", {ab = "cd", ef = "gh"} }, 15 | { "Cookies", "test_cookies.lua", }, 16 | { "FileSystem", "test_fs.lua", }, 17 | { "Libraries", "test_lib.lua", }, 18 | { "Session", "test_session.lua", }, 19 | { "Variables", "test_variables.lp", }, 20 | } do 21 | put (string.format (' · %s', 22 | mkurlpath (test[2], test[3]), test[1])) 23 | end 24 | put [[ 25 | ]] 26 | end) 27 | -------------------------------------------------------------------------------- /test/suite/etters.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(8); 4 | 5 | var a = {} 6 | a.hello = 'A' 7 | tap.ok(a.hello == 'A', 'normal property getter') 8 | Object.defineProperties(a, { 9 | 'hello': { 10 | get: function () { 11 | return 'B'; 12 | } 13 | } 14 | }); 15 | a.__defineSetter__('hello', function (val) { 16 | tap.ok(true, 'called setter'); 17 | }); 18 | tap.ok(a.hello == 'B', 'getter defined'); 19 | a.hello = 'C' 20 | tap.ok(a.hello == 'B', 'setter worked'); 21 | 22 | var b = {}; 23 | b.hello = 'A'; 24 | tap.ok(b.hello == 'A', 'normal property getter'); 25 | b.__defineSetter__('hello', function (val) { 26 | tap.ok(true, 'setter without getter worked') 27 | }); 28 | tap.ok(b.hello == null, 'setter removed value #TODO') 29 | b.hello = 'B'; 30 | tap.ok(b.hello != 'B', 'setter didnt change value') -------------------------------------------------------------------------------- /test/issues/issue-beta-212.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(8); 4 | 5 | var n = 42; 6 | tap.ok(n.toString(10) == '42') 7 | console.log("# base 10:", JSON.stringify(n.toString(10))); 8 | tap.ok(n.toString(16) == '2a') 9 | console.log("# base 16:", JSON.stringify(n.toString(16))); 10 | tap.ok(n.toString(2) == '101010') 11 | console.log("# base 2:", JSON.stringify(n.toString(2))); 12 | tap.ok(n.toString(24) == '1i') 13 | console.log("# base 24:", JSON.stringify(n.toString(24))); 14 | 15 | console.log() 16 | 17 | // stress test invalid radixes 18 | try { n.toString(1); tap.ok(false); } 19 | catch (e) { tap.ok(e); } 20 | try { n.toString(0); tap.ok(false); } 21 | catch (e) { tap.ok(e); } 22 | try { n.toString(37); tap.ok(false); } 23 | catch (e) { tap.ok(e); } 24 | try { n.toString("1"); tap.ok(false); } 25 | catch (e) { tap.ok(e); } -------------------------------------------------------------------------------- /test/issues/issue-runtime-303.js: -------------------------------------------------------------------------------- 1 | // A JS error should be thrown on invalid Objects. 2 | 3 | var tap = require('../tap') 4 | 5 | tap.count(9) 6 | 7 | function test (source, isobject) { 8 | console.log(''); 9 | try { 10 | Object.keys(source); 11 | if (isobject) { 12 | tap.ok(true, 'no error on object') 13 | } else { 14 | tap.ok(false, 'error not generated for non-object'); 15 | } 16 | } catch (e) { 17 | if (isobject) { 18 | tap.ok(false, 'error generated on object'); 19 | tap.ok(false, 'error generated on object'); 20 | } else { 21 | tap.ok(e instanceof Error); 22 | tap.ok(e instanceof TypeError); 23 | console.log('#', e.message) 24 | } 25 | } 26 | } 27 | 28 | test(5, false); 29 | test('', false); 30 | test({}, true); 31 | test(null, false); 32 | test(true, false); 33 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-302.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | var tests = [ 4 | [function fn() { return ref; }, 'Function', 'function'], 5 | [Buffer([1,2,3]), 'Object', 'object'], 6 | [new Date(), 'Date', 'object'], 7 | [/abc/g, 'RegExp', 'object'], 8 | [new Error('baaaa'), 'Error', 'object'], 9 | [void 0, 'Undefined', 'undefined'], 10 | [true, 'Boolean', 'boolean'], 11 | // [null, 'Null', 'object'], 12 | ['a', 'String', 'string'], 13 | [42, 'Number', 'number'], 14 | [[], 'Array', 'object'], 15 | [(function () { return arguments; })(), 'Arguments', 'object'] 16 | ]; 17 | 18 | tap.count(tests.length * 2); 19 | 20 | tests.forEach(function (d) { 21 | console.log('#', d[0]) 22 | tap.eq(Object.prototype.toString.call(d[0]), '[object ' + d[1] + ']', 'Object.prototype.toString'); 23 | tap.eq(typeof d[0], d[2], 'typeof'); 24 | }); 25 | -------------------------------------------------------------------------------- /deps/fatfs/src/integer.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef _FF_INTEGER 6 | #define _FF_INTEGER 7 | 8 | #ifdef _WIN32 /* FatFs development platform */ 9 | 10 | #include 11 | #include 12 | 13 | #else /* Embedded platform */ 14 | 15 | /* This type MUST be 8 bit */ 16 | typedef unsigned char BYTE; 17 | 18 | /* These types MUST be 16 bit */ 19 | typedef short SHORT; 20 | typedef unsigned short WORD; 21 | typedef unsigned short WCHAR; 22 | 23 | /* These types MUST be 16 bit or 32 bit */ 24 | typedef int INT; 25 | typedef unsigned int UINT; 26 | 27 | /* These types MUST be 32 bit */ 28 | typedef long LONG; 29 | typedef unsigned long DWORD; 30 | 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "deps/hsregex"] 2 | path = deps/hsregex 3 | url = https://github.com/tessel/hsregex.git 4 | [submodule "deps/http-parser"] 5 | path = deps/http-parser 6 | url = https://github.com/joyent/http-parser.git 7 | [submodule "deps/lua-5.1"] 8 | path = deps/colony-lua 9 | url = https://github.com/tessel/colony-lua.git 10 | [submodule "deps/c-ares"] 11 | path = deps/c-ares 12 | url = https://github.com/tessel/c-ares.git 13 | [submodule "deps/fortuna"] 14 | path = deps/fortuna 15 | url = https://github.com/waitman/libfortuna.git 16 | [submodule "deps/miniz"] 17 | path = deps/miniz 18 | url = https://github.com/tessel/miniz 19 | [submodule "deps/rapidjson"] 20 | path = deps/rapidjson 21 | url = https://github.com/miloyip/rapidjson.git 22 | [submodule "deps/colony-luajit"] 23 | path = deps/colony-luajit 24 | url = https://github.com/tcr/luajit.git 25 | -------------------------------------------------------------------------------- /test/suite/truthy.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(16); 4 | 5 | tap.ok(!(0) == true, '0 is falsy'); 6 | tap.ok(!(false) == true, 'false is falsy'); 7 | tap.ok(!(undefined) == true, 'undefined is falsy') 8 | tap.ok(!(null) == true, 'null is falsy') 9 | tap.ok(!('') == true, '"" is falsy'); 10 | tap.ok(!!([]) == true, '[] is truthy'); 11 | tap.ok(!!("0") == true, '\"0\" is truthy'); 12 | tap.ok(!!({}) == true, '{} is truthy'); 13 | 14 | var a; 15 | a = 0; tap.ok(!(a) == true, '0 is falsy'); 16 | a = false; tap.ok(!(a) == true, 'false is falsy'); 17 | a = undefined; tap.ok(!(a) == true, 'undefined is falsy') 18 | a = null; tap.ok(!(a) == true, 'null is falsy') 19 | a = ''; tap.ok(!(a) == true, '"" is falsy'); 20 | a = []; tap.ok(!!(a) == true, '[] is truthy'); 21 | a = "0"; tap.ok(!!(a) == true, '\"0\" is truthy'); 22 | a = {}; tap.ok(!!(a) == true, '{} is truthy'); 23 | -------------------------------------------------------------------------------- /src/colony/lua_http_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 The Luvit Authors. All Rights Reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | * 16 | */ 17 | 18 | #ifndef LHTTP_PARSER 19 | #define LHTTP_PARSER 20 | 21 | #include "lua.h" 22 | #include "lauxlib.h" 23 | 24 | LUALIB_API int luaopen_http_parser (lua_State *L); 25 | 26 | #endif -------------------------------------------------------------------------------- /test/net/http-md5.js: -------------------------------------------------------------------------------- 1 | // TLS module 2 | if (!require('crypto')._tls) { 3 | var tap = require('../tap'); 4 | tap.count(1); 5 | tap.ok(false, 'crypto not enabled #SKIP'); 6 | process.exit(0); 7 | } 8 | 9 | var tap = require('../tap'); 10 | 11 | tap.count(2); 12 | 13 | var http = require('http'); 14 | var crypto = require('crypto'); 15 | 16 | http.get("http://tessel-httpbin.herokuapp.com/status/418", function (res) { 17 | tap.eq(typeof res.statusCode, 'number', 'statuscode is a number'); 18 | console.log('# statusCode', res.statusCode) 19 | 20 | var hash = crypto.createHash('md5'); 21 | res.pipe(hash); 22 | 23 | hash.on('readable', function () { 24 | var md5 = hash.read().toString('hex'); 25 | console.log('#', md5); 26 | tap.eq(md5, 'a039239a1eae504e41cb810c98419b99', 'teapot md5 works'); 27 | }) 28 | }).on('error', function (e) { 29 | tap.ok(false, String(e)); 30 | }); 31 | -------------------------------------------------------------------------------- /deps/luabitop-1.0/nsievebits.lua: -------------------------------------------------------------------------------- 1 | -- This is the (naive) Sieve of Eratosthenes. Public domain. 2 | 3 | local bit = require("bit") 4 | local band, bxor, rshift, rol = bit.band, bit.bxor, bit.rshift, bit.rol 5 | 6 | local function nsieve(p, m) 7 | local count = 0 8 | for i=0,rshift(m, 5) do p[i] = -1 end 9 | for i=2,m do 10 | if band(rshift(p[rshift(i, 5)], i), 1) ~= 0 then 11 | count = count + 1 12 | for j=i+i,m,i do 13 | local jx = rshift(j, 5) 14 | p[jx] = band(p[jx], rol(-2, j)) 15 | end 16 | end 17 | end 18 | return count 19 | end 20 | 21 | if arg and arg[1] then 22 | local N = tonumber(arg[1]) or 1 23 | if N < 2 then N = 2 end 24 | local primes = {} 25 | 26 | for i=0,2 do 27 | local m = (2^(N-i))*10000 28 | io.write(string.format("Primes up to %8d %8d\n", m, nsieve(primes, m))) 29 | end 30 | else 31 | assert(nsieve({}, 10000) == 1229) 32 | end 33 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-306.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(11); 4 | 5 | tap.ok((new Buffer([-1]))[0] == 0xff, 'wrap: -1 == 0xff'); 6 | tap.ok((new Buffer([0x555 % 0xFF]))[0] == 0x5a, 'wrap: 0x555 % 0xFF == 0x5a'); 7 | 8 | tap.ok((new Buffer([256]))[0] == 0x00, 'wrap: 256 == 0'); 9 | tap.ok((new Buffer([-256]))[0] == 0x00, 'wrap: -256 == 0'); 10 | tap.ok((new Buffer([0x555]))[0] == 0x55, 'wrap: 0x555 == 0x55'); 11 | tap.ok((new Buffer([300]))[0] == 0x2c, 'wrap: 300 == 0x2c'); 12 | tap.ok((new Buffer([-300]))[0] == 0xd4, 'wrap: -300 == 0xd4'); 13 | tap.ok((new Buffer([-0x555]))[0] == 0xab, 'wrap: -0x555 == 0xab'); 14 | 15 | var a = 0x555, b = 0xFF 16 | tap.ok((-a) % b == -90, 'modulus check: -0x555 % 0xFF == -90'); 17 | tap.ok((new Buffer([(-0x555) % 0xff]))[0] == 0xa6, 'wrap: -0x555 % 0xff == 0xa6'); 18 | 19 | var b = new Buffer(1); 20 | b.writeInt8(-1, 0); 21 | tap.ok(b[0] == 0xff, 'writing -1 yields 0'); -------------------------------------------------------------------------------- /test/suite/bind.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(4); 4 | 5 | var util = require('util'); 6 | var EventEmitter = require('events').EventEmitter; 7 | 8 | function UART(){} 9 | util.inherits(UART, EventEmitter); 10 | 11 | var globalUART = new UART(); 12 | function Test() { 13 | this.uart = globalUART; 14 | this.uart.on('data', this.parseIncoming.bind(this)); 15 | } 16 | 17 | var i = 1; 18 | Test.prototype.parseIncoming = function(data, _, _, _, _, c) { 19 | tap.ok(data == i, 'test ' + i + ' bound arguments correctly'); 20 | console.log('#', arguments) 21 | i++ 22 | if (i == 4) { 23 | tap.ok(c != null, 'last numerical value included'); 24 | } 25 | } 26 | 27 | var test = new Test(); 28 | setTimeout(function() { 29 | globalUART.emit('data', 1) 30 | globalUART.emit('data', 2, 'extra args'); 31 | globalUART.emit('data', 3, 'extra args', 'more extra args', 1, 2, 3); 32 | }, 0); -------------------------------------------------------------------------------- /test/suite/hasOwnProperty.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(9); 4 | 5 | var a = {x: 5} 6 | tap.eq(a.hasOwnProperty('x'), true, 'object hasOwnProperty positive') 7 | tap.eq(a.hasOwnProperty('y'), false, 'object hasOwnProperty negative') 8 | tap.eq(a.hasOwnProperty('hasOwnProperty'), false, 'object hasOwnProperty prototype') 9 | 10 | var f = function(){}; 11 | f.foo = 1 12 | tap.eq(f.hasOwnProperty('foo'), true, 'function hasOwnProperty positive') 13 | tap.eq(f.hasOwnProperty('bar'), false, 'function hasOwnProperty negative') 14 | 15 | var b = new Buffer(1); 16 | b.foo = 1; 17 | tap.eq(b.hasOwnProperty('foo'), true, 'buffer hasOwnProperty positive') 18 | tap.eq(b.hasOwnProperty('bar'), false, 'buffer hasOwnProperty negative') 19 | 20 | var s = 'string'; 21 | tap.eq(s.hasOwnProperty('length'), true, 'string hasOwnProperty positive') 22 | tap.eq(s.hasOwnProperty('bar'), false, 'string hasOwnProperty negative') 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "runtime", 3 | "version": "1.0.0", 4 | "private": true, 5 | "bin": { 6 | "colony": "./out/Release/colony", 7 | "colony-compiler": "./node_modules/colony-compiler/bin/colony-compiler.js", 8 | "colony-profile": "./bin/colony-profile.js" 9 | }, 10 | "directories": { 11 | "example": "examples", 12 | "test": "test" 13 | }, 14 | "scripts": { 15 | "test": "echo 'ERROR: Please use `make test` now.' && echo '' && exit 1", 16 | "install": "true" 17 | }, 18 | "dependencies": { 19 | "async": "~0.2.9", 20 | "bindings": "~1.2.0", 21 | "colony-compiler": "~0.6.23", 22 | "mkdirp": "~0.3.5", 23 | "semver": "^4.1.0" 24 | }, 25 | "devDependencies": { 26 | "nodejs-websocket": "^1.0.0", 27 | "faye-websocket": "~0.7.2", 28 | "tap": "git+https://github.com/tcr/node-tap.git#4f96b1", 29 | "tape": "~2.3.2", 30 | "tinytap": "^0.2.0" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_conc.lua: -------------------------------------------------------------------------------- 1 | cgilua.htmlheader() 2 | if ap then 3 | local pid, ppid = ap.pid () 4 | if not ppid then 5 | ppid = "no parent pid" 6 | end 7 | cgilua.put ("pid = "..pid.." ("..ppid..")".."\n") 8 | end 9 | 10 | assert(type(stable.get) == "function") 11 | assert(type(stable.set) == "function") 12 | 13 | cgilua.put"stable.pairs = {
\n" 14 | for i, v in stable.pairs () do 15 | cgilua.put (i.." = "..tostring(v).."
\n") 16 | end 17 | cgilua.put"}
\n" 18 | 19 | local counter = stable.get"counter" or 0 20 | stable.set ("counter", counter + 1) 21 | 22 | local f = stable.get"f" 23 | if not f then 24 | local d = os.date() 25 | stable.set ("f", function () return d end) 26 | else 27 | cgilua.put ("f() = "..tostring (f ())) 28 | end 29 | 30 | cgilua.put"
\n" 31 | for i = 1,800 do 32 | cgilua.put (i) 33 | for ii = 1,1000 do 34 | cgilua.put ("") 35 | end 36 | cgilua.put ("\n") 37 | end 38 | cgilua.put ("End") 39 | -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_lib.lua: -------------------------------------------------------------------------------- 1 | local function getfield (t, f) 2 | for w in string.gfind(f, "[%w_]+") do 3 | if not t then return nil end 4 | t = t[w] 5 | end 6 | return t 7 | end 8 | 9 | function test_lib (libname) 10 | local ok, err = pcall (require, libname) 11 | if not ok then 12 | cgilua.put ("Library "..libname.." not found
\n".. 13 | err) 14 | else 15 | cgilua.put ("Library "..libname.."
\n") 16 | local t = getfield (_G, libname) 17 | if type(t) ~= "table" then 18 | cgilua.put (tostring(t)) 19 | else 20 | for i, v in pairs (t) do 21 | cgilua.put ("  "..tostring(i).." = "..tostring(v).."
\n") 22 | end 23 | end 24 | end 25 | cgilua.put ("\n

\n") 26 | end 27 | 28 | cgilua.htmlheader () 29 | for _, lib in ipairs { "lfs", "socket", "luasql.postgres", "luasql", "lxp", "lxp.lom", "lualdap", "htk", "xmlrpc", "xmlrpc.http" } do 30 | test_lib (lib) 31 | end 32 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_2048.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICWzCCAcQCCQCrCBinAwcn/zANBgkqhkiG9w0BAQQFADA0MTIwMAYDVQQKEylh 3 | eFRMUyBQcm9qZWN0IERvZGd5IENlcnRpZmljYXRlIEF1dGhvcml0eTAeFw0xMDEy 4 | MjYyMjMzNDBaFw0yNDA5MDMyMjMzNDBaMCwxFjAUBgNVBAoTDWF4VExTIFByb2pl 5 | Y3QxEjAQBgNVBAMTCTEyNy4wLjAuMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC 6 | AQoCggEBAKWgulghnDyduQE0oEn5PgUqoW/gnHB8D83dumyQU+KaNUQhmkcX16w6 7 | jZt/1IQaqJd5dGyGt/zR6r9pZt54DNXrCZ8JgVk58gToqaUhNNoRIeUiYj/scqP3 8 | pZiBYjVPM+jl1RirIttS191JoiqFhr4OdkOkPEwV1FLyh7s3v9OHAoS8m3U3cbD4 9 | 5tZUwLEFSgEKsBMYUrE03i6RjwHK1sNGbJ1Jwv6eWlGLqYnlGI1TgoZrx5SeZ/2R 10 | ii1jXKv2TiKLrSuSe+WlwebSK2u8/sRiQ8F6FZI2vVt2S6FjHLgZPijjusxb6XRl 11 | v+AsfmR6k3xnmKRVgqIvvl4PMlUWiy0CAwEAATANBgkqhkiG9w0BAQQFAAOBgQAY 12 | uw++Zz6+68dQvmd9MiHeYZxVsajDJ0RVEiV9V/TFLsGmJXmtHHX0vVjZJSpDomWJ 13 | WKPZu/HvR6KrtOtz+HM2ap5FFfPcg5LA2Dqau2tvTub1KdvDSbfaTqRsh1cQ8FQI 14 | 222gV/DG5AZ8AlSuDzTgrMuIeWjKZ6hhkirZVIO+rg== 15 | -----END CERTIFICATE----- 16 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.ca_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXQIBAAKBgQCfxX6VHEhZNsMIqPPxt53h1UpfX1jU7ctqwBR4dpWRj3H6cCBN 3 | EK8xj7IVcBTJq6vcMRDwrAUrElSIZl8Kv6+ZqhTss2j+E2tfzkzehP9LcAdAR+UM 4 | JPBsYXic/+vmH5JCMO7CXLUsDJmO2q2Z1TjTtchu2DgAueTo0hWRtMvbMwIDAQAB 5 | AoGARYOF+ZZenAJJhSENUiPTm4hTXX98hNgZYw7DWU4u8S/6JT5Xr3AM6YFduBoV 6 | 0VDR63GlrzEI5p6JDPeNbn3MBl14ZNZVOOkzenxsCsymCHKhickxR8VlRoN26Xpb 7 | OcMxsnEOJ8zh0F97Re8bsE7OQhk4Z7KtArby2jY1bpSqkRECQQDQ0D9lIq0oINaS 8 | Uezmj/eSlmRjUwF+Vx8t16Yu8mD8CJZUVBEhDn/Xo2GWlkFgbWUoAPanr8zAwKJX 9 | 6gImgMVPAkEAw+AxIgMqxs0GmsiesQMPe3Rf5kRId7ApFdhCq15J4URGOTdnyIUj 10 | LBzJpGSiQFb/Fkt5dGrsDzawFd7hlBCa3QJAcWJCqiX0JDAAkx8NJfzSj7Q9+njd 11 | /L5N3dSVFjTiWLhI+K1VR7/ZxzueB+i6wyNjpB8xz8fzxE5VWKtmU4XknQJBAKW+ 12 | K/UK1wR3cnJA9j70RwKA27D98JAOaQWKBAf79en+mqlJn7EGL1fhWCKZ4M0ukBSu 13 | cqw22V6aOO+YtCpUzqUCQQCapy9lw3tDuCAljW8H3p9ce/+wuK1FTnF0TCalgHQp 14 | kn4btRLmj0josAj4lRrzi2uaYfwq39h9OIuy7ES7YKcv 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.device_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXAIBAAKBgQDH2LDa/QrOXOLHsqLCayRYs74qlWlk9yLTtIJVxumBJNo40TwG 3 | 8g+Sq6LhtZBAD7tZaM9XjgIi1iFjc1eKALFaEKpzT5pS9HM0mK48bgwO4DV0gbvC 4 | t1LlwfEC1EkXgoMDumZwF0bpoKldLK9ayp6sXOYe7dcBc8CVjOiqzVCDowIDAQAB 5 | AoGAZ2ap0xS8I5wRxouaBQgUrUSK71ORTalFPs6V5TXfGW/s7RrteRaDkjr2MtyT 6 | f2HkaNV++mlCl629ZsyGDaRgHjPI6skemqbwws4l+QMglXkLQ2ST6xuMqrNlCaKN 7 | Ys0l291VftlS6Bi/C/LD3bwMf6HTGThufchmQ87OvXYtNQkCQQD1jC5jypbk+Ilc 8 | X4aGXaOSsyzrf3QblhPFTsXTIHwV56JNap5D1405LUeH9XvAca+EZyYAg0N/pOXB 9 | rkSXww3PAkEA0Fp8+/zDI00liFOEud2hQ0A/VCqg0+SyCVGvA7AFnuXEURPbMkSB 10 | ktk/x4BBn5DZUJMfOOal/ewbgPNqbClV7QJAPMw31EeeMxWC1VdltLFMxg8NSUYm 11 | looDXTBS9SKu9rGC005Z34xokEaw1m4m9RBxGAR+OVRHCzzmEp22qCkIqwJAWSDM 12 | ZHMs+rXuv1GS7nuLl5wtOxD9OYeUTX4+0uIClYWOpGxNEUTS9QGwUeRgriSlgd1d 13 | ttab3XKaFWCLfvdzxQJBANuWeyBMYnNDBi3j++/NmmKEg9Reiby0dT3wSPe6oJKf 14 | ux9foG8SpLGGnHuJQerD1IkACP+GuaGxWUxsVzPxtns= 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.key_1024.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXQIBAAKBgQDN/YlIvja5lXbUEzAOv7LtZwrAFj9RCZ0pL7JtPz5sL5CAoXHf 3 | vjjFy6maQBSQCvm3Bwvh2ucJvw1XQYZgocEnkVsKmEYb9qKE+GXHzi2WF6qR+GEE 4 | UHDrtEO33JrMMQEU1M3MwjdtaYLWxsS+8jSlyaYZUzJ6hg6Rgg+hQlSqAQIDAQAB 5 | AoGBAJWqbhH1aouixkjGfDdrH1UQdiYkw/JcWt0u86QevHscgBCFvNhFPLiyBlO1 6 | 1XrnDpLmQsLiKtXRA59vU3Roco6/A7urvaH5gX0S1J22rkytyqjJgI0N1dChv+xg 7 | SEntlw9e7fw5FZaeXeK0XS4E3AiiZSktN/tikBt75TpYBVXBAkEA/GkoyajEXOPQ 8 | Xqra3od028tAeI4dEpYWYT+zPqMN3EmlJYfFl4Wdu7TwRP1s6NKM7DOBRh4QEjMW 9 | lQBPdbTleQJBANDrZQcQO9kD69xvS4/Dh8521sUUIU7nTxvoBfiEGuDF1uMIs1RX 10 | Ah/U2fv/QLFWHGD3rJHz08Z/hP2Eneom7skCQQCmzxxsgQMcXFYFaiZw79YTt3Qo 11 | 98pQ0S2DIWTk3T84uNbSQbMcmuoN9drfzRefmh4Vr0gcvZtjW63t1KGuqVkJAkBO 12 | CM6oj8C684MCyDNiFHfCf5MC89zpGu7qjoTEaZucf2kfTh2lkAZEG338aUAhvPdG 13 | pNw5e+iLSRBEnWdakYY5AkBBLE7+2ZCJAFyUCkp+GxqABgE32lBhnZz+JX/Y1MSe 14 | gfIMHjghHpA/1LpsU8vwd3mb8fo/gdzzIQJtt5XDLs7V 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /src/colony/modules/console.js: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | 10 | var util = require('util'), 11 | _log = process.binding('tm').log; 12 | 13 | exports.log = function () { 14 | _log(10, util.format.apply(util, arguments)); 15 | } 16 | exports.info = function () { 17 | _log(11, util.format.apply(util, arguments)); 18 | } 19 | exports.warn = function () { 20 | _log(12, util.format.apply(util, arguments)); 21 | } 22 | exports.error = function () { 23 | _log(13, util.format.apply(util, arguments)); 24 | } 25 | exports.trace = function () { 26 | // no-op 27 | } 28 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.key_1042.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICZwIBAAKBgwNRhe0y5s4OG7KtaFgPt+iYXplAx2O9BJhAgQTN0/Q2xmrprfAz 3 | WTp0wHWGYywZtPmM196fcl2EvazwBDiuKjockPdEJ6A4qv1G3avrYy9YVIx+Vzpf 4 | hsf5sXGychWNboP4UtJ5U95XGkHQFUhC/apIU2tMOVhspT9G0YPH5N+AzfnhAgMB 5 | AAECgYMBqUlbwxTK6UMygx9unofaOJV7MXPgWZs4QWqVphlK9DUHBu9eBcbQvewv 6 | qdRyGniASeMz/yy45qAyOIJUgdR//RU9oaW/J+HZOM4LJRqP12BPmSjujuVd10h4 7 | xRmEt3xCW5JwEIcBWhrMqhlU0QoiX/kT+tv5esBeCglE0yeynOqjtQJCAfUa/zZV 8 | ReqIEH7NaYWHMZ6NOhS35gB15Ka8JDR9avQFJVq0D2NpF1ysohGqorvB0Z19IhHW 9 | 9HfYZ4kBOAf856pDAkIBsf8PJGBnBema7096ZLFmykGaTiECDOJH52wLlqnWVr/W 10 | UmlNzC/Dh+WFDwxH5csW7iLciLkNwhFTLltOMEw7owsCQgHOjbgNIFOkdSq80cHY 11 | 5v2PfI+jdklSHYENw9eruCWU0Hc1rcYSnnxZKGWF5zvGEtf6Bvr++qu5QMH5fm2J 12 | OhNiXwJCANlis/f5ncEVaTjzq4/iWGV5BMybtgY0FeYydX+LJMShJL505rYfOqbI 13 | baTC9wSAfMTdi2+kmeKagPrYW0rP9JNPAkEwMQ3d0gOzgT6nxG1BCTXOABZKg4Gl 14 | Q7OOtmo+ZZEyjE8q/jfs5YsQi2TTFCpwwgS++LqrFAuXHzJZC3X4hrUNuw== 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /test/suite/url.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(14); 4 | 5 | var expected = { protocol: 'ws:', 6 | slashes: true, 7 | auth: 'user:pass', 8 | host: 'somedomain.com:1234', 9 | port: '1234', 10 | hostname: 'somedomain.com', 11 | hash: '#hash1', 12 | search: '?q=123', 13 | query: 'q=123', 14 | pathname: '/events', 15 | path: '/events?q=123', 16 | href: 'ws://user:pass@somedomain.com:1234/events?q=123#hash1' }; 17 | 18 | var url = require('url'); 19 | tap.ok(url.parse('http://tools.ietf.org/html/draft-ietf-6man-text-addr-representation-04#section-6'), 'url parses'); 20 | 21 | var actual = url.parse('ws://user:pass@somedomain.com:1234/events?q=123#hash1'); 22 | 23 | Object.keys(expected).forEach(function(k){ 24 | tap.eq(actual[k], expected[k], k + ' should matched expected ') 25 | }); 26 | 27 | tap.ok(url.parse('http://api.openweathermap.org/data/2.5/weather?id=5327684&units=imperial').hostname == 'api.openweathermap.org', 'hostname match'); 28 | -------------------------------------------------------------------------------- /test/issues/issue-beta-81.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(2); 4 | 5 | var actions = ["a", "b", "c", "d", "e", "f", "g"]; 6 | var _n = 1; 7 | tap.ok(actions[_n] == 'b', 'underscores in member properties not undefined'); 8 | var _j = {_k: 5} 9 | tap.ok(actions[_j._k] == 'f', 'underscores in member properties in member properties not undefined'); 10 | 11 | // var actions = ["a", "b", "c", "d", "e", "f", "g"]; 12 | // for (_n in actions) { 13 | // console.log("_n", _n); 14 | // console.log("actions[_n]", actions[_n]); 15 | // } 16 | // for (n in actions) { 17 | // console.log("n", n); 18 | // console.log("actions[n]", actions[n]); 19 | // } 20 | // var _i, _len; 21 | // for (_i = 0, _len = actions.length; _i < _len; _i++) { 22 | // console.log("_i", _i); 23 | // console.log("actions[_i]", actions[_i]); 24 | // } 25 | // var i, len; 26 | // for (i = 0, len = actions.length; i < len; i++) { 27 | // console.log("i", i); 28 | // console.log("actions[i]", actions[i]); 29 | // } -------------------------------------------------------------------------------- /test/suite/timers.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(4); 4 | 5 | var source = setTimeout(function () { 6 | // TODO this test differs between Node and browser. 7 | // tap.ok(this == source, '"this" value in timer is timer return value'); 8 | tap.ok(true, 'setTimeout is called'); 9 | }, 10); 10 | 11 | var id = setInterval(function () { 12 | tap.ok(false, 'error, interval was not cancelled'); 13 | process.exit(1); 14 | }, 100) 15 | clearInterval(id); 16 | 17 | console.log('# timeout id:', id) 18 | 19 | var count = 0; 20 | var jk = setInterval(function () { 21 | count++; 22 | clearInterval(jk); 23 | if (count > 1) { 24 | tap.ok(false, 'error, interval was not cancelled from inside interval') 25 | process.exit(1) 26 | } 27 | }, 0) 28 | 29 | setImmediate(function (arg1, arg2, arg3) { 30 | tap.ok(arg1 != null, 'args passed into callback'); 31 | tap.ok(arg2 == null, 'null args allowed in callback'); 32 | tap.ok(arg3 != null, 'null args allowed in callback'); 33 | }, 5, null, 6) -------------------------------------------------------------------------------- /deps/axtls/config/axtls.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Visual C++ generated resource script. 2 | // 3 | #define APSTUDIO_READONLY_SYMBOLS 4 | ///////////////////////////////////////////////////////////////////////////// 5 | // 6 | // Generated from the TEXTINCLUDE 2 resource. 7 | // 8 | #define APSTUDIO_HIDDEN_SYMBOLS 9 | #undef APSTUDIO_HIDDEN_SYMBOLS 10 | ///////////////////////////////////////////////////////////////////////////// 11 | #undef APSTUDIO_READONLY_SYMBOLS 12 | 13 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 14 | LANGUAGE 9, 1 15 | #pragma code_page(1252) 16 | 17 | ///////////////////////////////////////////////////////////////////////////// 18 | // 19 | // Icon 20 | // 21 | 22 | // Icon with lowest ID value placed first to ensure application icon 23 | // remains consistent on all systems. 24 | 25 | IDI_AXTLS ICON "../www/favicon.ico" 26 | 27 | 28 | #endif 29 | ///////////////////////////////////////////////////////////////////////////// 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /deps/luabitop-1.0/msvcbuild.bat: -------------------------------------------------------------------------------- 1 | @rem Script to build Lua BitOp with MSVC. 2 | 3 | @rem First change the paths to your Lua installation below. 4 | @rem Then open a "Visual Studio .NET Command Prompt", cd to this directory 5 | @rem and run this script. Afterwards copy the resulting bit.dll to 6 | @rem the directory where lua.exe is installed. 7 | 8 | @if not defined INCLUDE goto :FAIL 9 | 10 | @setlocal 11 | @rem Path to the Lua includes and the library file for the Lua DLL: 12 | @set LUA_INC=-I .. 13 | @set LUA_LIB=..\lua51.lib 14 | 15 | @set MYCOMPILE=cl /nologo /MD /O2 /W3 /c %LUA_INC% 16 | @set MYLINK=link /nologo 17 | @set MYMT=mt /nologo 18 | 19 | %MYCOMPILE% bit.c 20 | %MYLINK% /DLL /export:luaopen_bit /out:bit.dll bit.obj %LUA_LIB% 21 | if exist bit.dll.manifest^ 22 | %MYMT% -manifest bit.dll.manifest -outputresource:bit.dll;2 23 | 24 | del *.obj *.exp *.manifest 25 | 26 | @goto :END 27 | :FAIL 28 | @echo You must open a "Visual Studio .NET Command Prompt" to run this script 29 | :END 30 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/verisign.x509_ca.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICmDCCAgECECCol67bggLewTagTia9h3MwDQYJKoZIhvcNAQECBQAwgYwxCzAJ 3 | BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEwMC4GA1UECxMnRm9y 4 | IFRlc3QgUHVycG9zZXMgT25seS4gIE5vIGFzc3VyYW5jZXMuMTIwMAYDVQQDEylW 5 | ZXJpU2lnbiBUcmlhbCBTZWN1cmUgU2VydmVyIFRlc3QgUm9vdCBDQTAeFw0wNTAy 6 | MDkwMDAwMDBaFw0yNTAyMDgyMzU5NTlaMIGMMQswCQYDVQQGEwJVUzEXMBUGA1UE 7 | ChMOVmVyaVNpZ24sIEluYy4xMDAuBgNVBAsTJ0ZvciBUZXN0IFB1cnBvc2VzIE9u 8 | bHkuICBObyBhc3N1cmFuY2VzLjEyMDAGA1UEAxMpVmVyaVNpZ24gVHJpYWwgU2Vj 9 | dXJlIFNlcnZlciBUZXN0IFJvb3QgQ0EwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJ 10 | AoGBAJ8h98U7klaZH5cEn6CSEKmGWVBsTwHIaMAAVqGqCUn7Q9C10sEOIHBznyLy 11 | eSDjMs5M1nC/iAA7KCASf/yHz0AdlU+1IRSijwHTF/2dYSoTTxP2GCmtL1Ga4i7+ 12 | zDDo086V7+NiFAGJj+CYey47ue4Xa33o/4YOA9PGL87oqFe7AgMBAAEwDQYJKoZI 13 | hvcNAQECBQADgYEAOq447rP5EDqFEl3vhLhgTbnyaskNYwPvxk+0grnQyDA4sF/q 14 | gK8nFlnvLmAOF3DmfuqW6WSr4zqTYzpwmJlsn48Om/yWirL8GuWRftit2POxTfHS 15 | B8VmR+PZx2k24UgWUZyojDGxJtiHd3tjCdqFgTit4NK429cWOcZrh47xeOI= 16 | -----END CERTIFICATE----- 17 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICsDCCAhmgAwIBAgIJAIoxoOAgS75iMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV 3 | BAYTAkFVMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX 4 | aWRnaXRzIFB0eSBMdGQwHhcNMTEwNjI0MTE1NjExWhcNMTEwNzI0MTE1NjExWjBF 5 | MQswCQYDVQQGEwJBVTETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 6 | ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB 7 | gQCczEspLfQhmZ6ZdBDNCwvZR4C3Nn7KTnF/u+mU7f5k5E+z4930b4u6+gm24/uk 8 | XVF0Lf++IMrf/mjQDPFYU2LHCdtza/jUaUnjyln5VixPPDT6mS6zpgwg9ylAN1Us 9 | PumJkz21Z1NrXZm8BuoOHTYRrbG3lW7KDRi9/KJQPo56VwIDAQABo4GnMIGkMB0G 10 | A1UdDgQWBBQNb4zqgrkasyqy/JIajFF04Nbw/TB1BgNVHSMEbjBsgBQNb4zqgrka 11 | syqy/JIajFF04Nbw/aFJpEcwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgTClNvbWUt 12 | U3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAIoxoOAg 13 | S75iMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAhe4Gbo/SzwDHM3V7 14 | C0tDnfQjc6yvDtkTdSG6HbL24lJpjCcsaQh5Bgtkq4YnfjwhXuKD2oeBuqSm90o9 15 | uWXpCqPinE43xbfVDBSUe3IvChDyVFzqVVri2QnBhMWGNQFuodIHCtxTbSa0qX8t 16 | FuWK8ULggrqrVR91fuZsyOyncBw= 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-448.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(8); 4 | 5 | var testString = "This is a Test String"; 6 | var buffer = new Buffer(testString); 7 | tap.eq(buffer.toString(), testString, "default encoding doesn't return utf-8 encoded string."); 8 | tap.eq(buffer.toString('utf8'), testString, "utf-8 encoding doesn't return the correct string."); 9 | tap.eq(buffer.toString('utf8', 5, 7), testString.slice(5, 7), "Offset arguments not returning correct string"); 10 | tap.eq(buffer.toString('utf8', -5, -5), '', "Negative offset arguments return empty string"); 11 | tap.eq(buffer.toString('utf8', -5, 5), testString.slice(0, 5), "Negative start offset defaults to start offset of 0"); 12 | tap.eq(buffer.toString('utf8', 0, 1000), testString, "End offset larger then buffer defaults to end of buffer"); 13 | tap.eq(buffer.toString('utf8', 5, 1000), testString.slice(5), "End offset larger then buffer defaults to end of buffer while origin offset still slices"); 14 | 15 | var fakeEncoding = 'fake'; 16 | try { 17 | buffer.toString('fake'); 18 | } 19 | catch(e) { 20 | tap.eq(e.name, "TypeError", "Error thrown on invalid encoding."); 21 | } 22 | -------------------------------------------------------------------------------- /deps/axtls/binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'targets': [ 3 | { 4 | 'target_name': 'liblibaxtls', 5 | 'type': 'static_library', 6 | 'sources': [ 7 | 'crypto/aes.c', 8 | 'crypto/bigint.c', 9 | 'crypto/crypto_misc.c', 10 | 'crypto/hmac.c', 11 | 'crypto/md2.c', 12 | 'crypto/md5.c', 13 | 'crypto/rc4.c', 14 | 'crypto/rsa.c', 15 | 'crypto/sha1.c', 16 | 17 | 'ssl/asn1.c', 18 | 'ssl/gen_cert.c', 19 | 'ssl/loader.c', 20 | 'ssl/openssl.c', 21 | 'ssl/os_port.c', 22 | 'ssl/p12.c', 23 | 'ssl/tls1.c', 24 | 'ssl/tls1_svr.c', 25 | 'ssl/tls1_clnt.c', 26 | 'ssl/x509.c' 27 | ], 28 | 'include_dirs': [ 29 | 'ssl', 30 | 'crypto', 31 | 'config' 32 | ], 33 | 'direct_dependent_settings': { 34 | 'include_dirs': [ 35 | 'ssl', 36 | 'crypto', 37 | 'config' 38 | ] 39 | } 40 | }, 41 | { 42 | 'target_name': 'axssl', 43 | 'type': 'executable', 44 | 'dependencies': [ 45 | 'liblibaxtls' 46 | ], 47 | 'sources': [ 48 | 'samples/c/axssl.c' 49 | ] 50 | } 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /src/posix/tm_timestamp.c: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | 10 | #include "tm.h" 11 | #include "../colony/colony.h" 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | #include 19 | 20 | 21 | 22 | /** 23 | * timestamp 24 | */ 25 | 26 | 27 | // returns microseconds 28 | 29 | double tm_timestamp () 30 | { 31 | struct timeval tv; 32 | gettimeofday(&tv, NULL); 33 | 34 | double time_in_mill = (((double) tv.tv_sec) * 1000) + (((double) tv.tv_usec) / 1000); 35 | return (double) (time_in_mill * 1000); 36 | } 37 | 38 | int tm_timestamp_update (double millis) 39 | { 40 | fprintf(stderr, "ERROR: tm_timestamp_update does not work on this platform.\n"); 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2014 Technical Machine, Inc 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /examples/bench/json-parse.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var json2 = require('./json2'); 3 | 4 | var count = 5; 5 | var data = fs.readFileSync(__dirname + '/json-parse-test.json', 'utf-8'); 6 | var minsize = 100000; // not including whitespace, unicode issues 7 | 8 | var start1 = process.hrtime(); 9 | for (var i = 0; i < count; i++) { 10 | var attempt = JSON.parse(data); 11 | var out = JSON.stringify(attempt); 12 | if (out.length < minsize) { 13 | throw new Error('Invalid parsing by internal JSON parser'); 14 | } 15 | } 16 | var end1 = process.hrtime(); 17 | 18 | 19 | var start2 = process.hrtime(); 20 | for (var i = 0; i < count; i++) { 21 | var attempt = json2.parse(data); 22 | var out = json2.stringify(attempt); 23 | if (out.length < minsize) { 24 | throw new Error('Invalid parsing by JSON.js'); 25 | } 26 | } 27 | var end2 = process.hrtime(); 28 | 29 | var trial1 = (((end1[0]*1e9+end1[1]) - (start1[0]*1e9+start1[1])) / count)/1e9; 30 | var trial2 = (((end2[0]*1e9+end2[1]) - (start2[0]*1e9+start2[1])) / count)/1e9; 31 | 32 | console.log('Internal:\t', trial1.toFixed(3), 'seconds per iteration') 33 | console.log('JSON.js:\t', trial2.toFixed(3), 'seconds per iteration') 34 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-304.js: -------------------------------------------------------------------------------- 1 | // Tests throw/catch/finally blocks with return statements. 2 | 3 | var tap = require('../tap'); 4 | 5 | tap.count(3); 6 | 7 | function test (dothrow) { 8 | var a = []; 9 | 10 | function fn () { 11 | try { 12 | a.push('try'); 13 | if (dothrow) { 14 | throw up; 15 | } else { 16 | return 'try'; 17 | } 18 | } catch (e) { 19 | a.push('catch'); 20 | return 'catch'; 21 | } finally { 22 | a.push('finally'); 23 | } 24 | a.push('function'); 25 | return 'function'; 26 | } 27 | 28 | var ret = fn(); 29 | a.push('->', ret); 30 | return a.join(' '); 31 | } 32 | 33 | tap.eq(test(false), 'try finally -> try'); 34 | tap.eq(test(true), 'try catch finally -> catch'); 35 | 36 | // This is an edge case for colony-compiler where try{} and catch{} 37 | // blocks are actually evaluated closures. Before 0.6.16, try blocks can 38 | // "return null" and actually continue with execution(!) 39 | 40 | var ret = (function () { 41 | try { 42 | return null 43 | } catch (e) { } 44 | tap.ok(false); 45 | return true; 46 | })(); 47 | if (ret == null) { 48 | tap.ok(true); 49 | } 50 | -------------------------------------------------------------------------------- /test/suite/math.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(16); 4 | 5 | // number encoding 6 | tap.ok(0644 == 420, 'octal encoding'); 7 | 8 | // variables 9 | tap.ok(Math.E == 2.718281828459045, 'Math.E') 10 | tap.ok(Math.LN2 == 0.6931471805599453, 'Math.LN2') 11 | tap.ok(Math.LN10 == 2.302585092994046, 'Math.LN10') 12 | tap.ok(Math.LOG2E == 1.4426950408889634, 'Math.LOG2E') 13 | tap.ok(Math.LOG10E == 0.4342944819032518, 'Math.LOG10E') 14 | tap.ok(Math.PI == 3.141592653589793, 'Math.PI') 15 | tap.ok(Math.SQRT1_2 == 0.7071067811865476, 'Math.SQRT1_2') 16 | tap.ok(Math.SQRT2 == 1.4142135623730951, 'Math.SQRT2') 17 | 18 | // round 19 | tap.ok(Math.round(20.49) == 20, 'Math.round(20.49)') 20 | tap.ok(Math.round(20.5) == 21, 'Math.round(20.5)') 21 | tap.ok(Math.round(-20.5) == -20, 'Math.round(-20.5)') 22 | tap.ok(Math.round(-20.51) == -21, 'Math.round(-20.51)') 23 | // Note the rounding error because of inaccurate floating point arithmetics 24 | tap.ok((Math.round(1.005*100)/100) == 1, 'Math.round(1.005*100)/100'); 25 | 26 | // etc 27 | tap.ok(Math.pow(2, 2) == 4, 'Math.pow') 28 | 29 | // nan 30 | console.log('#', String(0/0)) 31 | tap.ok(String(0/0) == 'NaN', 'NaN is NaN and not nan'); 32 | -------------------------------------------------------------------------------- /src/colony/modules/dns.js: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | var tm = process.binding('tm'); 10 | 11 | exports.resolve = function (domain, type, callback) { 12 | if (typeof type == 'function') { 13 | callback = type; 14 | type = null 15 | }; 16 | 17 | // TODO use type 18 | 19 | var tries = 3; 20 | setImmediate(function poll () { 21 | // CC3000 can flake with cares. Three time's the charm. 22 | var ipl = tm._sync_gethostbyname(domain); 23 | if (ipl == 0) { 24 | tries--; 25 | if (tries > 0) { 26 | return poll(); 27 | } 28 | callback(new Error('ENOENT')); 29 | } else { 30 | callback(null, [[(ipl >> 24) & 0xFF, (ipl >> 16) & 0xFF, (ipl >> 8) & 0xFF, (ipl >> 0) & 0xFF].join('.')]) 31 | } 32 | }); 33 | } 34 | 35 | // TODO the rest! -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_session.lua: -------------------------------------------------------------------------------- 1 | cgilua.enablesession () 2 | 3 | function pt (tab) 4 | for i, v in pairs (tab) do 5 | local vv = v 6 | if type(v) == "table" then 7 | vv = "" 8 | for _i, _v in pairs (v) do 9 | vv = vv..string.format ("%s = %q, ", _i, _v) 10 | end 11 | vv = '{'..vv..'}' 12 | end 13 | cgilua.put (string.format ("%s = %s
\n", tostring (i), tostring (vv))) 14 | end 15 | end 16 | 17 | 18 | if cgi.field then 19 | if not cgilua.session.data.field then 20 | cgilua.session.data.field = {} 21 | end 22 | table.insert (cgilua.session.data.field, cgi.field) 23 | end 24 | cgilua.htmlheader() 25 | if cgilua.session then 26 | cgilua.put "cgi = {
\n" 27 | pt (cgi) 28 | cgilua.put "}
\n" 29 | cgilua.put "cgilua.session.data = {
\n" 30 | pt (cgilua.session.data) 31 | cgilua.put "}
\n" 32 | 33 | cgilua.put [[

36 | field:
39 |
40 |
]] 41 | else 42 | cgilua.put "Sessions library is not available or not well configured" 43 | end 44 | -------------------------------------------------------------------------------- /deps/fatfs/doc/img/app1.c: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------/ 2 | / Open or create a file in append mode 3 | /------------------------------------------------------------*/ 4 | 5 | FRESULT open_append ( 6 | FIL* fp, /* [OUT] File object to create */ 7 | const char* path /* [IN] File name to be opened */ 8 | ) 9 | { 10 | FRESULT fr; 11 | 12 | /* Opens an existing file. If not exist, creates a new file. */ 13 | fr = f_open(fp, path, FA_WRITE | FA_OPEN_ALWAYS); 14 | if (fr == FR_OK) { 15 | /* Seek to end of the file to append data */ 16 | fr = f_lseek(fp, f_size(fp)); 17 | if (fr != FR_OK) 18 | f_close(fp); 19 | } 20 | return fr; 21 | } 22 | 23 | 24 | int main (void) 25 | { 26 | FRESULT fr; 27 | FATFS fs; 28 | FIL fil; 29 | 30 | /* Open or create a log file and ready to append */ 31 | f_mount(&fs, "", 0); 32 | fr = open_append(&fil, "logfile.txt"); 33 | if (fr != FR_OK) return 1; 34 | 35 | /* Append a line */ 36 | f_printf(&fil, "%02u/%02u/%u, %2u:%02u\n", Mday, Mon, Year, Hour, Min); 37 | 38 | /* Close the file */ 39 | f_close(&fil); 40 | 41 | return 0; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-373.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(6); 4 | 5 | var fruits = ["Banana", "Orange", "Apple", "Mango", "Cherry"]; 6 | fruits.splice(0, 4); 7 | tap.eq(fruits.toString(), 'Cherry', 'splice is correct w/ deleting at 0'); 8 | 9 | var fruits = ["Banana", "Orange", "Apple", "Mango", "Cherry"]; 10 | fruits.splice(0, 4, 'Pear'); 11 | tap.eq(fruits.toString(), 'Pear,Cherry', 'splice is correct w/ deleting and inserting at 0'); 12 | 13 | var fruits = ["Banana", "Orange", "Apple", "Mango", "Cherry"]; 14 | fruits.splice(0, 0, 'Pear'); 15 | tap.eq(fruits.toString(), 'Pear,Banana,Orange,Apple,Mango,Cherry', 'splice is correct w/ inserting at 0'); 16 | 17 | var fruits = ["Banana", "Orange", "Apple", "Mango", "Cherry"]; 18 | fruits.splice(1, 4); 19 | tap.eq(fruits.toString(), 'Banana', 'splice is correct w/ deleting at 1'); 20 | 21 | var fruits = ["Banana", "Orange", "Apple", "Mango", "Cherry"]; 22 | fruits.splice(1, 4, 'Pear'); 23 | tap.eq(fruits.toString(), 'Banana,Pear', 'splice is correct w/ deleting and inserting at 1'); 24 | 25 | var fruits = ["Banana", "Orange", "Apple", "Mango", "Cherry"]; 26 | fruits.splice(1, 0, 'Pear'); 27 | tap.eq(fruits.toString(), 'Banana,Pear,Orange,Apple,Mango,Cherry', 'splice is correct w/ inserting at 1'); 28 | -------------------------------------------------------------------------------- /deps/node-libs/constants.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | module.exports = process.binding('constants'); 23 | -------------------------------------------------------------------------------- /test/suite/bug-underscores.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(9); 4 | 5 | _typeof = function () { tap.ok(false, 'typeof overwritten'); } 6 | typeof 5; 7 | 8 | var dlow = 6; 9 | dlow = 5; 10 | tap.ok(dlow != 6, 'simple variable scoping'); 11 | 12 | var d_high; 13 | d__high = 6; 14 | (function () { 15 | var d_high; 16 | d__high = 5; 17 | })(); 18 | tap.ok(d__high == 5, 'var decl underscores are escaped properly'); 19 | 20 | var a_b = 'hi'; 21 | tap.ok(a_b == 'hi', 'var underscores'); 22 | 23 | a_b += ' there'; 24 | tap.ok(a_b == 'hi there', 'var underscores in lvalue of assignment'); 25 | 26 | tap.ok(a_b.toUpperCase() == 'HI THERE', 'underscore in lvalue of member expression'); 27 | 28 | var c_d = {}; 29 | c_d.cool_beans = 5; 30 | tap.ok(c_d['cool_beans'] == 5, 'dynamic property values') 31 | 32 | c_d.func_tastic = function () { 33 | tap.ok(true, 'underscore in member and base') 34 | } 35 | c_d.func__tastic = function () { 36 | tap.ok(false,' underscore in member and base'); 37 | } 38 | c_d.func_tastic(); 39 | 40 | var actions = ["a", "b", "c", "d", "e", "f", "g"]; 41 | var _n = 1; 42 | tap.ok(actions[_n] != undefined, 'underscores in member properties not undefined'); 43 | var _j = {_k: 5} 44 | tap.ok(actions[_j._k] != undefined, 'underscores in member properties in member properties not undefined'); -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_4096.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDWzCCAsQCCQCrCBinAwcoADANBgkqhkiG9w0BAQQFADA0MTIwMAYDVQQKEylh 3 | eFRMUyBQcm9qZWN0IERvZGd5IENlcnRpZmljYXRlIEF1dGhvcml0eTAeFw0xMDEy 4 | MjYyMjMzNDFaFw0yNDA5MDMyMjMzNDFaMCwxFjAUBgNVBAoTDWF4VExTIFByb2pl 5 | Y3QxEjAQBgNVBAMTCTEyNy4wLjAuMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCC 6 | AgoCggIBAKOYAobI/sEAa0jY3Wnh2UBTQbKzLIEF0/PuVOehqtnXZ1T+7LPTuks8 7 | ijWm+OXN/uvLg0YZQDpOtjut7Jog6X3PDr1fnGCZB9ByzUqVDCC3OtY3Vlp8ax0b 8 | x0JuQ65ZHP7PlQn+2DDcmzsymooHXWdajCOb7TXdZCt48fau9fE/1pp4+Z0sKUiu 9 | bld/ihm5IgbmwSbRWrbHzZJ3MavMCHMKwCvCUDMU1s4Vek+DxZta3ApKPB5aQrW9 10 | fupNT01XEJkQBjpO8m8zPrcXQWKU0m2Ylj+7KXobNw+YuFgoZRhJLEdUaGN/RUVU 11 | pjdTZ8A6rCquiOMg1SaVm1pCP4zDk2wYrklfHSM/I9CZxBoixWEmYcVNAxREcm5Q 12 | LmLWhvE8PTL5MoOhkaOAn37NFtzqjfSHoTMMmXzqFjV1tKZJstQ+/vc61IKp5CcK 13 | e6vPZfZH/t7Zx9h/7rgQQmwYfDRbv0GIKwTwFI5hxH9XipPQpS0CvOU/SemhqSVY 14 | 9MdVZtv75Wq7Oagcd00qwvgSoNhVUKEym2zeckkt2ukcllohpLr5H7xRSlk1vXfJ 15 | aXh9Yr1zxr1FWeSzlv9lu6VAFd7RV++i0fj99FnjgWMFUHvfXVExCS+jnD1VzfqW 16 | Hc1arikSZ1C1OaTL3eEDyC0RyPfRwCFWk4onUbaUbJgEegk1UQkBAgMBAAEwDQYJ 17 | KoZIhvcNAQEEBQADgYEAihEFhLAmC2H+wWMajxFOuGnKwIACS2XZiYX24/8wNUbJ 18 | CvE/iTv170ZPnT16Asfrc+PJWdVPU3j72bllHjKHtihgBoSCGceK2rN5I/vgVzm6 19 | EbMBJBZVch8FHLNHqR0GXEtge1k8B4mI6rL3f9ZjmCkYgG9Ii7b8o3s2NT1e4E4= 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /tools/compile_certs.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var fs = require('fs'); 4 | var exec = require('child_process').exec; 5 | var packageFolder = require('./package-folder'); 6 | 7 | var out = process.argv[2]; 8 | var pemdir = out + '.pem/'; 9 | var derdir = out + '.der/'; 10 | var infile = process.argv[4]; 11 | 12 | var pem = fs.readFileSync(infile, 'utf-8'); 13 | var certs = pem.split(/\n\n/g).filter(function (cert) { 14 | return cert.indexOf('---') > -1; 15 | }); 16 | 17 | try { 18 | fs.mkdirSync(pemdir); 19 | } catch (e) { } 20 | try { 21 | fs.mkdirSync(derdir); 22 | } catch (e) { } 23 | 24 | var outfiles = []; 25 | var i = 0; 26 | (function loop () { 27 | var cert = certs[i]; 28 | 29 | var incert = pemdir + 'cert-' + i + '.pem'; 30 | var outcert = derdir + 'cert-' + i + '.der'; 31 | outfiles.push(outcert); 32 | 33 | fs.writeFileSync(incert, cert); 34 | exec('openssl x509 -in ' + incert + ' -inform PEM -out ' + outcert + ' -outform DER', function (code, stdout, stderr) { 35 | if (code) { 36 | console.log(stdout); 37 | console.error(stderr); 38 | process.exit(code); 39 | } 40 | i++; 41 | if (certs.length > i) { 42 | loop(); 43 | } else { 44 | packageFolder(outfiles, process.argv[3], function (err, out) { 45 | fs.writeFileSync(process.argv[2], out); 46 | }); 47 | } 48 | }) 49 | })(); -------------------------------------------------------------------------------- /src/order32.h: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | 10 | #ifndef ORDER32_H 11 | #define ORDER32_H 12 | 13 | #include 14 | #include 15 | 16 | #if CHAR_BIT != 8 17 | #error "unsupported char size" 18 | #endif 19 | 20 | enum 21 | { 22 | O32_LITTLE_ENDIAN = 0x03020100ul, 23 | O32_BIG_ENDIAN = 0x00010203ul, 24 | O32_PDP_ENDIAN = 0x01000302ul 25 | }; 26 | 27 | static const union { unsigned char bytes[4]; uint32_t value; } o32_host_order = 28 | { { 0, 1, 2, 3 } }; 29 | 30 | #define O32_HOST_ORDER (o32_host_order.value) 31 | #define O32_SWAP(x) __builtin_bswap32(x) 32 | 33 | #define O32_HOST_TO_BE(x) ((O32_HOST_ORDER == O32_LITTLE_ENDIAN) ? (O32_SWAP(x)) : (x)) 34 | #define O32_HOST_TO_LE(x) ((O32_HOST_ORDER == O32_BIG_ENDIAN) ? (O32_SWAP(x)) : (x)) 35 | 36 | #define O32_BE_TO_HOST(x) O32_HOST_TO_BE(x) 37 | #define O32_LE_TO_HOST(x) O32_HOST_TO_LE(x) 38 | 39 | 40 | #endif -------------------------------------------------------------------------------- /test/colony/floatint.js: -------------------------------------------------------------------------------- 1 | // Tests float v int implementation details of Lua engine. 2 | // Compares 32-bit ints with floats when treated silently 3 | // by underlying engine (as LuaJIT with DUAL_NUM does) 4 | 5 | var tap = require('../tap'); 6 | 7 | tap.count(10); 8 | 9 | var tm = process.binding('tm'); 10 | 11 | function float_0() { 12 | // Signed-fill right shift generates float 13 | // (as it preserves negative numbers) 14 | var v = 0; 15 | return v >> 0; 16 | }; 17 | 18 | function float_1() { 19 | // Signed-fill right shift generates float 20 | // (as it preserves negative numbers) 21 | var v = 1; 22 | return v >> 0; 23 | }; 24 | 25 | function int_0(){ 26 | return 0; 27 | } 28 | 29 | function int_1(){ 30 | return 1; 31 | } 32 | 33 | tap.eq(0, float_0(), 'float 0'); 34 | tap.eq(true, !float_0(), 'not float 0'); 35 | 36 | tap.eq(1, float_1(), 'float 1'); 37 | tap.eq(false, !float_1(), 'not float 1'); 38 | 39 | tap.eq(0, int_0(), 'int 0'); 40 | tap.eq(true, !int_0(), 'not int 0'); 41 | 42 | tap.eq(1, int_1(), 'int 1'); 43 | tap.eq(false, !int_1(), 'not int 1'); 44 | 45 | if (float_0()) { 46 | tap.ok(false, 'if float 0'); 47 | } 48 | 49 | if (float_1()) { 50 | tap.ok(true, 'if float 1'); 51 | } v 52 | 53 | if (int_0()) { 54 | tap.ok(false, 'if int 0'); 55 | } 56 | 57 | if (int_1()) { 58 | tap.ok(true, 'if int 1'); 59 | } 60 | -------------------------------------------------------------------------------- /test/issues/issue-runtime-287.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap') 2 | 3 | tap.count(15) 4 | 5 | var arr = [1, 2, 3, 1, 2, 3]; 6 | 7 | console.log('#', arr.indexOf(2)); 8 | tap.eq(arr.indexOf(2), 1); 9 | 10 | console.log('#', arr.indexOf(2, 0)); 11 | tap.eq(arr.indexOf(2, 0), 1); 12 | 13 | console.log('#', arr.indexOf(2, 1)); 14 | tap.eq(arr.indexOf(2, 1), 1); 15 | 16 | console.log('#', arr.indexOf(2, 2)); 17 | tap.eq(arr.indexOf(2, 2), 4); 18 | 19 | console.log('#', arr.indexOf(2, 4)); 20 | tap.eq(arr.indexOf(2, 4), 4); 21 | 22 | console.log('#', arr.indexOf(2, 5)); 23 | tap.eq(arr.indexOf(2, 5), -1); 24 | 25 | console.log('#', arr.indexOf(3, 5)); 26 | tap.eq(arr.indexOf(3, 5), 5); 27 | 28 | console.log('#', arr.indexOf(3, 6)); 29 | tap.eq(arr.indexOf(3, 6), -1); 30 | 31 | console.log('#', arr.indexOf(2, 10)); 32 | tap.eq(arr.indexOf(2, 10), -1); 33 | 34 | console.log('#', arr.indexOf(2, -1)); 35 | tap.eq(arr.indexOf(2, -1), -1); 36 | 37 | console.log('#', arr.indexOf(2, -2)); 38 | tap.eq(arr.indexOf(2, -2), 4); 39 | 40 | console.log('#', arr.indexOf(2, -2)); 41 | tap.eq(arr.indexOf(2, -2), 4); 42 | 43 | console.log('#', arr.indexOf(2, -4)); 44 | tap.eq(arr.indexOf(2, -4), 4); 45 | 46 | console.log('#', arr.indexOf(2, -5)); 47 | tap.eq(arr.indexOf(2, -5), 1); 48 | 49 | console.log('#', arr.indexOf(2, -10)); 50 | tap.eq(arr.indexOf(2, -10), 1); 51 | 52 | -------------------------------------------------------------------------------- /deps/axtls/www/lua/test_main.lua: -------------------------------------------------------------------------------- 1 | cgilua.htmlheader() 2 | cgilua.put[[ 3 | 4 | Script Lua Test 5 | 6 | 7 | cgi = { 8 | ]] 9 | 10 | for i,v in pairs (cgi) do 11 | if type(v) == "table" then 12 | local vv = "{" 13 | for a,b in pairs(v) do 14 | vv = string.format ("%s%s = %s
\n", vv, a, tostring(b)) 15 | end 16 | v = vv.."}" 17 | end 18 | cgilua.put (string.format ("%s = %s
\n", i, tostring(v))) 19 | end 20 | cgilua.put "}
\n" 21 | cgilua.put ("Remote address: "..cgilua.servervariable"REMOTE_ADDR") 22 | cgilua.put "
\n" 23 | cgilua.put ("Is persistent = "..tostring (SAPI.Info.ispersistent).."
\n") 24 | cgilua.put ("ap="..tostring(ap).."
\n") 25 | cgilua.put ("lfcgi="..tostring(lfcgi).."
\n") 26 | 27 | -- Checking Virtual Environment 28 | local my_output = cgilua.put 29 | cgilua.put = nil 30 | local status, err = pcall (function () 31 | assert (cgilua.put == nil, "cannot change cgilua.put value") 32 | end) 33 | cgilua.put = my_output 34 | assert (status == true, err) 35 | 36 | -- Checking require 37 | local status, err = pcall (function () require"unknown_module" end) 38 | assert (status == false, "unknown_module loaded!") 39 | -- assert (package == nil, "Access to package table allowed!") 40 | 41 | cgilua.put[[ 42 |

43 | 44 | 45 | ]] 46 | cgilua = nil 47 | -------------------------------------------------------------------------------- /deps/node-libs/sys.js: -------------------------------------------------------------------------------- 1 | // Copyright Joyent, Inc. and other Node contributors. 2 | // 3 | // Permission is hereby granted, free of charge, to any person obtaining a 4 | // copy of this software and associated documentation files (the 5 | // "Software"), to deal in the Software without restriction, including 6 | // without limitation the rights to use, copy, modify, merge, publish, 7 | // distribute, sublicense, and/or sell copies of the Software, and to permit 8 | // persons to whom the Software is furnished to do so, subject to the 9 | // following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included 12 | // in all copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 17 | // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20 | // USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | // the sys module was renamed to 'util'. 23 | // this shim remains to keep old programs working. 24 | module.exports = require('util'); 25 | -------------------------------------------------------------------------------- /src/tm_itoa.c: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Technical Machine, Inc. See the COPYRIGHT 2 | // file at the top-level directory of this distribution. 3 | // 4 | // Licensed under the Apache License, Version 2.0 or the MIT license 6 | // , at your 7 | // option. This file may not be copied, modified, or distributed 8 | // except according to those terms. 9 | 10 | #include 11 | 12 | // https://groups.google.com/forum/#!topic/comp.lang.c/IyWWejPrgts 13 | 14 | #define itoa_numorchar(A) ((A) > 9 ? 'a' + ((A) - 10) : '0' + (A)) 15 | 16 | char* tm_itoa (long long i, char *s, unsigned int radix) 17 | { 18 | char *p = s; 19 | char *q = s; 20 | 21 | if (i >= 0) { 22 | do { 23 | *q++ = itoa_numorchar(i % radix); 24 | } 25 | while (i /= radix); 26 | } else if (-1 % 2 < 0) { 27 | *q++ = '-'; 28 | p++; 29 | 30 | do { 31 | *q++ = itoa_numorchar(i % radix); 32 | } while (i /= radix); 33 | } else { 34 | *q++ = '-'; 35 | p++; 36 | 37 | do { 38 | int d = i % radix; 39 | i = i / radix; 40 | if (d) { i++; d = radix - d; } 41 | *q++ = itoa_numorchar(d); 42 | } while (i); 43 | } 44 | 45 | for (*q = 0; p < --q; p++) { 46 | char c = *p; 47 | *p = *q; 48 | *q = c; 49 | } 50 | 51 | return s; 52 | } -------------------------------------------------------------------------------- /test/issues/issue-beta-334.js: -------------------------------------------------------------------------------- 1 | var tap = require('../tap'); 2 | 3 | tap.count(11); 4 | 5 | var buf = new Buffer(4); 6 | 7 | buf.writeUInt32BE(0xdeadbeef, 0); 8 | tap.ok(buf[0] == 0xde, 'UInt32'); 9 | tap.ok(buf[1] == 0xad, 'UInt32'); 10 | tap.ok(buf[2] == 0xbe, 'UInt32'); 11 | tap.ok(buf[3] == 0xef, 'UInt32'); 12 | buf.fill(0); 13 | 14 | try { 15 | buf.writeUInt32LE(0xdeadbeef, 2); 16 | tap.ok(false, 'error not thrown by out of bounds write') 17 | } catch (e) { 18 | tap.ok(true, 'error thrown by out of bounds write') 19 | } 20 | 21 | try { 22 | buf.writeUInt32LE(0xdeadbeef, 2, true); 23 | tap.ok(true, 'error not thrown by out of bounds write') 24 | } catch (e) { 25 | tap.ok(false, 'error thrown by out of bounds write') 26 | } 27 | tap.ok(buf[2] == 0xef, 'out of bounds write still writes'); 28 | tap.ok(buf[3] == 0xbe, 'out of bounds write still writes'); 29 | 30 | try { 31 | buf.readUInt32LE(2); 32 | tap.ok(false, 'error not thrown by out of bounds read') 33 | } catch (e) { 34 | tap.ok(true, 'error thrown by out of bounds write') 35 | } 36 | 37 | buf[0] = 0; 38 | buf[1] = 0; 39 | buf[2] = 0xFF; 40 | buf[3] = 0xFF; 41 | var value = buf.readUInt32LE(0, true); 42 | tap.ok(value == 4294901760, 'in bounds write succeeds') 43 | var value = buf.readUInt32LE(2, true); 44 | tap.ok(isNaN(value) || (value == 65535), 'out of bounds write returns 65535 (older) or NaN (newer) depending on Node version') -------------------------------------------------------------------------------- /bin/colony-profile.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var fs = require('fs'); 4 | 5 | var data = fs.readFileSync('colony.log', 'utf-8'); 6 | 7 | var traces = data.match(/(^|\n)stack traceback:[\s\S]+?(\n\n|\s*?$)/g); 8 | 9 | var sections = { 10 | C: {}, 11 | T: {}, 12 | app: {} 13 | }; 14 | 15 | traces.map(function (trace) { 16 | var lines = trace.split(/\t\s*/).slice(2, 3); 17 | lines.forEach(function (line) { 18 | var entries = line.split(/: in ?f?u?n?c?t?i?o?n?\s*/); 19 | var line = (entries[0] + ' in ' + (entries[1] || '?')).replace(/[\n\s]*$/, '').replace(/__/g, '_'); 20 | if (!line.match(/[^a-z0-9\/.\[\]A-Z:_$<>\?\'_\- ]/)) { 21 | if (line.match(/^\[T\]/) || line.match(/^builtin\//)) { 22 | var t = sections.T; 23 | } else if (line.match(/^\[C\]/)) { 24 | var t = sections.C; 25 | } else { 26 | var t = sections.app; 27 | } 28 | t[line] || (t[line] = 0); 29 | t[line]++; 30 | } 31 | }); 32 | }) 33 | 34 | Object.keys(sections).map(function (ticktype) { 35 | var ticks = sections[ticktype]; 36 | console.log('functions by tick in section [' + ticktype + ']'); 37 | Object.keys(ticks).map(function (key) { 38 | return [key, ticks[key]]; 39 | }).sort(function (a, b) { 40 | return a[1] > b[1] ? -1 : a[1] < b[1] ? 1 : 0; 41 | }).reverse().forEach(function (tick) { 42 | console.log((' ' + tick[1]).slice(-8), tick[0]); 43 | }); 44 | console.log(''); 45 | }); 46 | -------------------------------------------------------------------------------- /deps/axtls/ssl/test/axTLS.x509_device.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBjTCCATcCCQCrCBinAwcoATANBgkqhkiG9w0BAQUFADAsMRYwFAYDVQQKEw1h 3 | eFRMUyBQcm9qZWN0MRIwEAYDVQQDEwkxMjcuMC4wLjEwHhcNMTAxMjI2MjIzMzQy 4 | WhcNMjQwOTAzMjIzMzQyWjArMSkwJwYDVQQKEyBheFRMUyBQcm9qZWN0IERldmlj 5 | ZSBDZXJ0aWZpY2F0ZTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAx9iw2v0K 6 | zlzix7KiwmskWLO+KpVpZPci07SCVcbpgSTaONE8BvIPkqui4bWQQA+7WWjPV44C 7 | ItYhY3NXigCxWhCqc0+aUvRzNJiuPG4MDuA1dIG7wrdS5cHxAtRJF4KDA7pmcBdG 8 | 6aCpXSyvWsqerFzmHu3XAXPAlYzoqs1Qg6MCAwEAATANBgkqhkiG9w0BAQUFAANB 9 | ALx4Z9moVhA05QsUrMiyy/+NCiFhaOtZfe6kElJoAl4B1EcGQor8ozE3cFuLOLeQ 10 | YuAX5YpbpxuafYbzw1AdAU8= 11 | -----END CERTIFICATE----- 12 | -----BEGIN CERTIFICATE----- 13 | MIIB3zCCAUgCCQD76Ccq3Co3qjANBgkqhkiG9w0BAQUFADA0MTIwMAYDVQQKEylh 14 | eFRMUyBQcm9qZWN0IERvZGd5IENlcnRpZmljYXRlIEF1dGhvcml0eTAeFw0xMDEy 15 | MjYyMjMzMzdaFw0yNDA5MDMyMjMzMzdaMDQxMjAwBgNVBAoTKWF4VExTIFByb2pl 16 | Y3QgRG9kZ3kgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA 17 | A4GNADCBiQKBgQCfxX6VHEhZNsMIqPPxt53h1UpfX1jU7ctqwBR4dpWRj3H6cCBN 18 | EK8xj7IVcBTJq6vcMRDwrAUrElSIZl8Kv6+ZqhTss2j+E2tfzkzehP9LcAdAR+UM 19 | JPBsYXic/+vmH5JCMO7CXLUsDJmO2q2Z1TjTtchu2DgAueTo0hWRtMvbMwIDAQAB 20 | MA0GCSqGSIb3DQEBBQUAA4GBABoJU0aQMTocVLNbcY4tbfqLck2oAn/OVjG0p/8p 21 | GIJzlVKOtZ76ZkqHIbcXNKNlgjXy+4S3R+6+mkYcn0JVbVg7eN0tsDlMB04YyFaD 22 | 95D47KEzmDky4Yj2nqI4SmvVTf2lyYxV1zknrFUXND+WvjGxge3gpJxtMoTGE5E0 23 | Jc3F 24 | -----END CERTIFICATE----- 25 | -------------------------------------------------------------------------------- /deps/luabitop-1.0/Makefile.mingw: -------------------------------------------------------------------------------- 1 | # Makefile for Lua BitOp -- a bit operations library for Lua 5.1/5.2. 2 | # This is a modified Makefile for MinGW. C:\MinGW\bin must be in your PATH. 3 | # Compile: mingw32-make -f Makefile.mingw 4 | # Install: mingw32-make -f Makefile.mingw install 5 | 6 | # Lua executable name. Used for testing. 7 | LUA= lua 8 | 9 | # Include path where lua.h, luaconf.h and lauxlib.h reside: 10 | INCLUDES= "-I.." 11 | 12 | # Path of lua51.dll: 13 | LUADLLPATH= "..\lua51.dll" 14 | 15 | # Path where C modules for Lua should be installed: 16 | LUACMODPATH= ".." 17 | 18 | CC= gcc 19 | CCOPT= -O2 -fomit-frame-pointer 20 | CCWARN = -Wall 21 | SOCC= $(CC) -shared 22 | SOCFLAGS= $(CCOPT) $(CCWARN) $(INCLUDES) $(CFLAGS) 23 | SOLDFLAGS= $(LDFLAGS) 24 | RM= del 25 | STRIP= strip --strip-unneeded 26 | INSTALL= copy 27 | 28 | MODNAME= bit 29 | MODSO= $(MODNAME).dll 30 | 31 | all: $(MODSO) 32 | 33 | $(MODNAME).o: $(MODNAME).c 34 | $(CC) $(SOCFLAGS) -c -o $@ $< 35 | 36 | $(MODSO): $(MODNAME).o 37 | $(SOCC) $(SOLDFLAGS) -o $@ $< $(LUADLLPATH) 38 | $(STRIP) $@ 39 | 40 | install: $(MODSO) 41 | $(INSTALL) $< $(LUACMODPATH) 42 | 43 | test: $(MODSO) 44 | @$(LUA) bittest.lua && echo "basic test OK" 45 | @$(LUA) nsievebits.lua && echo "nsievebits test OK" 46 | @$(LUA) md5test.lua && echo "MD5 test OK" 47 | 48 | clean: 49 | $(RM) *.o *.so *.obj *.lib *.exp *.dll *.manifest 50 | 51 | .PHONY: all install test clean 52 | 53 | --------------------------------------------------------------------------------