// Previously mis-spelt as theadName
scope.put("threadName", scope, Thread.currentThread().getName()); //$NON-NLS-1$
scope.put("sampler", scope, currentSampler); //$NON-NLS-1$
scope.put("sampleResult", scope, previousResult); //$NON-NLS-1$
Object result = cx.evaluateString(scope, script, "<cmd>", 1, null); //$NON-NLS-1$
resultStr = Context.toString(result);
if (varName != null && vars != null) {// vars can be null if run from TestPlan
vars.put(varName, resultStr);
}