From d0b12fe696c05afc25c0a3354e4d7e0c8b2dc123 Mon Sep 17 00:00:00 2001 From: duralog Date: Sat, 25 Oct 2014 06:08:41 +0200 Subject: [PATCH] BUG: arguments being evaluated as a local variable one-liner. surprised no one has ran into it before... --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 499c8e3..db05621 100644 --- a/index.js +++ b/index.js @@ -70,7 +70,7 @@ function preprocess(func) { //Retrieves a local variable function createLocal(id) { - var nstr = prefix + id.replace(/\_/g, "__") + var nstr = id !== 'arguments' ? prefix + id.replace(/\_/g, "__") : 'arguments' localVars.push(nstr) return nstr } @@ -192,4 +192,4 @@ function preprocess(func) { return routine } -module.exports = preprocess \ No newline at end of file +module.exports = preprocess