mirror of
https://gitee.com/openharmony/third_party_weex-loader
synced 2024-11-23 07:20:51 +00:00
delete esprima escodegen Signed-off-by: bojiang <jiangbo91@huawei.com> Change-Id: Ia09d82301c5fd1c896bf8e554ff34ae6c8598ad2
This commit is contained in:
parent
a0aa5bb823
commit
136b9d4dba
16
deps/weex-scripter/lib/fix.js
vendored
16
deps/weex-scripter/lib/fix.js
vendored
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user