index.js 343 B

12345678910111213
  1. var codegen = require("..");
  2. // new require("benchmark").Suite().add("add", function() {
  3. var add = codegen(["a", "b"], "add")
  4. ("// awesome comment")
  5. ("return a + b - c + %d", 1)
  6. ({ c: 1 });
  7. if (add(1, 2) !== 3)
  8. throw Error("failed");
  9. // }).on("cycle", function(event) { process.stdout.write(String(event.target) + "\n"); }).run();