From fbd75297f47e5107128e700292217dd153e392b1 Mon Sep 17 00:00:00 2001 From: Matthew Wright Date: Tue, 26 Jul 2016 23:12:31 -0600 Subject: [PATCH] Merge pull request #1 from Picolab/fix-operator-`klog` ensure klog operator returns its object --- packages/node-krl-stdlib/src/index.js | 1 + packages/node-krl-stdlib/src/tests.js | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/node-krl-stdlib/src/index.js b/packages/node-krl-stdlib/src/index.js index 9b0d42b31..cb1b013b8 100644 --- a/packages/node-krl-stdlib/src/index.js +++ b/packages/node-krl-stdlib/src/index.js @@ -101,6 +101,7 @@ stdlib.isnull = function(val){ stdlib.klog = function(val, message){ console.log("[KLOG]", message, val); + return val; }; stdlib["typeof"] = function(val){ diff --git a/packages/node-krl-stdlib/src/tests.js b/packages/node-krl-stdlib/src/tests.js index 7cb89856b..482334c83 100644 --- a/packages/node-krl-stdlib/src/tests.js +++ b/packages/node-krl-stdlib/src/tests.js @@ -56,6 +56,7 @@ test("general operators", function(t){ t.equals(stdlib.isnull({}), false); t.ok(_.isFunction(stdlib.klog), "just checking that it's there"); + t.equals(stdlib.klog(42,"log message for"),42); t.equals(stdlib["typeof"](""), "String"); t.equals(stdlib["typeof"](0), "Number");