├── compiler-interface ├── tests │ ├── data │ │ ├── empty │ │ │ └── empty │ │ │ │ └── main.js │ │ └── stmts │ │ │ └── for-loop │ │ │ ├── init.json │ │ │ ├── expected.json │ │ │ └── test.js │ ├── .compiled │ │ └── readme │ └── integration.rs ├── Cargo.toml └── src │ ├── errors.rs │ ├── options.rs │ ├── main.rs │ └── composer.rs ├── playground ├── minimal │ └── unobfuscated │ │ ├── code.js │ │ ├── cmd.txt │ │ └── index.html └── snake │ ├── unobfuscated │ ├── make.sh │ ├── README.md │ ├── index.html │ └── snake.js │ └── obfuscated │ ├── bytecode.base64 │ ├── index.html │ └── vm.js ├── Cargo.toml ├── vm ├── tests │ ├── test_helper.js │ └── vm.test.js └── vm.js ├── codecov.yml ├── package.json ├── compiler ├── src │ ├── lib.rs │ ├── jshelper.rs │ ├── error.rs │ ├── scope.rs │ ├── instruction_set.rs │ └── bytecode.rs ├── Cargo.toml └── tests │ └── lib.rs ├── .travis.yml ├── .gitignore ├── README.md ├── LICENSE.md └── Cargo.lock /compiler-interface/tests/data/empty/empty/main.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /playground/minimal/unobfuscated/code.js: -------------------------------------------------------------------------------- 1 | console.log("Hello World"); 2 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = ["compiler", "compiler-interface"] 3 | -------------------------------------------------------------------------------- /compiler-interface/tests/data/stmts/for-loop/init.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": 10 3 | } 4 | -------------------------------------------------------------------------------- /compiler-interface/tests/data/stmts/for-loop/expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "i": 10, 3 | "a": 20 4 | } 5 | -------------------------------------------------------------------------------- /compiler-interface/tests/data/stmts/for-loop/test.js: -------------------------------------------------------------------------------- 1 | for(var i = 0;i<10;i++) { 2 | a++; 3 | } 4 | -------------------------------------------------------------------------------- /playground/snake/unobfuscated/make.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cargo run --target-dir ../../../compiler-interface snake.js ../../../vm/vm.js ../obfuscated -------------------------------------------------------------------------------- /vm/tests/test_helper.js: -------------------------------------------------------------------------------- 1 | module.exports = function() { 2 | this.chai = require('chai'); 3 | this.assert = chai.assert; 4 | this.expect = chai.expect; 5 | } 6 | -------------------------------------------------------------------------------- /compiler-interface/tests/.compiled/readme: -------------------------------------------------------------------------------- 1 | This dir contains the compiled bytecode and a vm ready to be used. These testcases will then be 2 | called by the node.js test infrastructure. 3 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: 2 | layout: "header, diff, tree, changes, files" 3 | behavior: default 4 | require_changes: false 5 | require_base: no 6 | require_head: yes 7 | branches: null 8 | -------------------------------------------------------------------------------- /playground/minimal/unobfuscated/cmd.txt: -------------------------------------------------------------------------------- 1 | cargo run "../playground/minimal/unobfuscated/code.js" "../vm/vm.js" "../playground/minimal/obfuscated" -d 2 | 3 | cargo run "playground/minimal/unobfuscated/code.js" "vm/vm.js" "playground/minimal/obfuscated" "playground/minimal/unobfuscated/index.html" -d 4 | -------------------------------------------------------------------------------- /playground/snake/unobfuscated/README.md: -------------------------------------------------------------------------------- 1 | ### Snake 2 | 3 | This is an implementation of the classic Snake-game. However, it is not an educational 4 | example on how to implement Snake right. As it uses a rather reduced set of features of 5 | JavaScript with the sole purpose to be compliable by the rusty-jsyc compiler. 6 | -------------------------------------------------------------------------------- /playground/minimal/unobfuscated/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |(self, filepath: P) -> CompositionResult<()>
27 | where P: AsRef