summaryrefslogtreecommitdiff
path: root/src/js/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/lib')
-rw-r--r--src/js/lib/myutils.js31
1 files changed, 30 insertions, 1 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