delete esprima escodegen

Signed-off-by: bojiang <jiangbo91@huawei.com>
Change-Id: Ia09d82301c5fd1c896bf8e554ff34ae6c8598ad2
This commit is contained in:
bojiang 2023-05-23 14:35:09 +08:00
parent a0aa5bb823
commit 136b9d4dba

View File

@ -1,6 +1,3 @@
var esprima = require('esprima')
var escodegen = require('escodegen')
// code sample of hacking old script
;({
"type": "Program",
@ -151,22 +148,11 @@ function convertValueAst(value) {
}
return data
}
function format(code, needCodegen) {
var ast = esprima.parse(code)
var prop = findDataValue(ast)
if (prop) {
prop.value = convertValueAst(prop.value)
needCodegen = true
}
return needCodegen ? escodegen.generate(ast) : code
return code
}
function formatBetter(code) {
esprima.parse(code, {range: true})
return code
}