From c26fd33826de858c1edfbea66db31984002664e0 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 26 Oct 2014 19:20:00 +0200 Subject: [PATCH] Clone test options object since calling `parse` is destructive for it. --- test/driver.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/driver.js b/test/driver.js index 8b812bfdca..5c71b1eeff 100644 --- a/test/driver.js +++ b/test/driver.js @@ -32,8 +32,9 @@ var test = tests[i]; try { comments = []; - if (test.options && !test.options.onComment) test.options.onComment = onComment; - var ast = parse(test.code, test.options || opts); + var testOpts = JSON.parse(JSON.stringify(test.options || opts)); + if (!testOpts.onComment) testOpts.onComment = onComment; + var ast = parse(test.code, testOpts); if (test.error) { if (config.loose) { callback("ok", test.code);