scripting: regression: missing try catch on code compilation
This commit is contained in:
parent
291eb669c5
commit
5e85baa278
1 changed files with 9 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
var ScriptVm = require('./script-vm'),
|
||||
scriptVm = new ScriptVm()
|
||||
scriptVm = new ScriptVm(),
|
||||
noop = ()=>{}
|
||||
|
||||
class Script {
|
||||
|
||||
|
|
@ -13,11 +14,16 @@ class Script {
|
|||
|
||||
if (!options.code) {
|
||||
|
||||
this.script = ()=>{}
|
||||
this.script = noop
|
||||
|
||||
} else {
|
||||
|
||||
this.script = scriptVm.compile(options.code, options.context)
|
||||
try {
|
||||
this.script = scriptVm.compile(options.code, options.context)
|
||||
} catch(err) {
|
||||
this.widget.errorProp(this.property, 'javascript', err)
|
||||
this.script = noop
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue