From ed98d8572434213b5b1dc533798eeea024794669 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 26 Sep 2016 23:45:26 +0300 Subject: [PATCH] added undefined placeholder to force returning undefined... Signed-off-by: Alex A. Naanou --- actions.js | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/actions.js b/actions.js index fd7af02..0f324c0 100755 --- a/actions.js +++ b/actions.js @@ -15,6 +15,9 @@ var object = require('ig-object') var args2array = function(a){ return [].slice.call(a) } +var UNDEFINED = +module.UNDEFINED = ['undefined placeholder'] + /*********************************************************************/ @@ -457,6 +460,8 @@ Action.prototype.pre = function(context, args){ a.post = res // reset the result... + // NOTE: this is the only difference between this + // and wrapper stages... res = context } } @@ -465,6 +470,7 @@ Action.prototype.pre = function(context, args){ // return context if nothing specific is returned... res = res === undefined ? context : res + res = res === UNDEFINED ? undefined : res return { arguments: args, diff --git a/package.json b/package.json index 20244bf..1519904 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ig-actions", - "version": "1.1.0", + "version": "1.2.0", "description": "", "main": "actions.js", "scripts": {