fix JS exception handling in evaluator

This fixes the case where the return value of evaluate is a value but an
internal exception is thrown.

Change-Id: I01edcd6bc64de176da5da3a499c594db45eee789
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>