Clone test options object since calling parse is destructive for it.

This commit is contained in:
Ingvar Stepanyan 2014-10-26 19:20:00 +02:00 committed by Marijn Haverbeke
parent 61d2067b2b
commit c26fd33826

View File

@ -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);