summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorspv420 <unomilliono@gmail.com>2022-04-24 09:37:59 -0400
committerspv420 <unomilliono@gmail.com>2022-04-24 09:37:59 -0400
commit7696be307f95423066348555f04546782e08ff22 (patch)
treec8e1adcbf306c334ca254875c1e0e6d99afbb9c8 /src
parent4615ba8d10dddbbef72a160d075ad974ae9431a5 (diff)
rad
Diffstat (limited to 'src')
-rw-r--r--src/js/lib/myutils.js31
-rw-r--r--src/js/main.js3
2 files changed, 32 insertions, 2 deletions
diff --git a/src/js/lib/myutils.js b/src/js/lib/myutils.js
index 0106402..29085c3 100644
--- a/src/js/lib/myutils.js
+++ b/src/js/lib/myutils.js
@@ -27,6 +27,7 @@ function printf() {
return calls4arg.apply(this, args_to_pass);
}
+/*
function syslog() {
if (arguments.length > 4) {
return printf("warning: tried to printf with %d args, max %d.\n", arguments.length, 4);
@@ -60,4 +61,32 @@ function syslog() {
function sleep(t) {
return calls4arg("sleep", t, 0, 0, 0);
-} \ No newline at end of file
+}
+ */
+
+function scall_wrapper() {
+ function _scall_wrapper() {
+ var args_to_pass = new Array();
+ args_to_pass.push(arguments.callee.func_name);
+
+ if (arguments.callee.hasOwnProperty("pre_args")) {
+ args_to_pass = args_to_pass.concat(arguments.callee.pre_args);
+ }
+
+ args_to_pass = args_to_pass.concat(Array.from(arguments));
+
+ if (arguments.callee.hasOwnProperty("post_args")) {
+ args_to_pass = args_to_pass.concat(arguments.callee.post_args);
+ }
+
+ return scall.apply(this, args_to_pass);
+ }
+
+ return _scall_wrapper;
+}
+
+var syslog = scall_wrapper();
+syslog.func_name = "syslog";
+
+var sleep = scall_wrapper();
+sleep.func_name = "sleep"; \ No newline at end of file
diff --git a/src/js/main.js b/src/js/main.js
index 908b582..018e514 100644
--- a/src/js/main.js
+++ b/src/js/main.js
@@ -48,7 +48,8 @@ function main() {
var i = 0;
while (true) {
- scall("printf", "get rekt from jsc %d (slide=%x)\n", i, slide);
+// scall("printf", "get rekt from jsc %d (slide=%x)\n", i, slide);
+ syslog(LOG_SYSLOG, "get rekt from jsc %d (slide=%x)\n", i, slide);
sleep(0);
i++;
}