!151 delete esprima escodegen

Merge pull request !151 from Bo Jiang/master
This commit is contained in:
openharmony_ci 2023-05-24 03:20:47 +00:00 committed by Gitee
commit 7b363a1369
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

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
}