fix bug with json output
This commit is contained in:
parent
a9536edce6
commit
5ab047cbed
|
@ -1,13 +1,10 @@
|
|||
'use strict';
|
||||
/**
|
||||
* @typedef {{color: boolean, cwd: string, report: function(string), warn: function(string), getMessages: function():Array.<MESSAGE>}}
|
||||
* @typedef {{color: boolean, cwd: string, report: function(string), warn: function(string), getMessages: function():Array.<MESSAGE>}} CONTEXT
|
||||
*/
|
||||
/*eslint no-unused-vars:0*/
|
||||
var CONTEXT = null;
|
||||
/**
|
||||
* @typedef {{msg: string, level: MESSAGE_LEVEL, file: string}}
|
||||
* @typedef {{msg: string, level: MESSAGE_LEVEL, file: string}} MESSAGE
|
||||
*/
|
||||
var MESSAGE = null;
|
||||
|
||||
/**
|
||||
* Enum for tri-state values.
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
'use strict';
|
||||
var fs = require('fs');
|
||||
//var path = require('path');
|
||||
|
||||
/**
|
||||
* @param {string} source
|
||||
|
|
|
@ -383,14 +383,14 @@ function convertTemplateToReact(html, options) {
|
|||
var data = {body: body, injectedFunctions: '', requireNames: requireVars, requirePaths: requirePaths, vars: vars, name: options.name};
|
||||
data.injectedFunctions = context.injectedFunctions.join('\n');
|
||||
var code = generate(data, options);
|
||||
try {
|
||||
//try {
|
||||
var tree = esprima.parse(code, {range: true, tokens: true, comment: true});
|
||||
tree = escodegen.attachComments(tree, tree.comments, tree.tokens);
|
||||
code = escodegen.generate(tree, {comment: true});
|
||||
} catch (e) {
|
||||
//} catch (e) {
|
||||
// TODO error handling
|
||||
console.log(e);
|
||||
}
|
||||
//console.log(e);
|
||||
//}
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue