* @param {string | number | Object} option * @param {string | number | boolean} value
(option, value)
| 402 | * @param {string | number | boolean} value |
| 403 | */ |
| 404 | setOption(option, value) { |
| 405 | if (typeof option == "string") |
| 406 | option = this.options[option]; |
| 407 | if (value == "false") value = false; |
| 408 | if (value == "true") value = true; |
| 409 | if (value == "null") value = null; |
| 410 | if (value == "undefined") value = undefined; |
| 411 | if (typeof value == "string" && parseFloat(value).toString() == value) |
| 412 | value = parseFloat(value); |
| 413 | if (option.onchange) |
| 414 | option.onchange(value); |
| 415 | else if (option.path) |
| 416 | this.editor.setOption(option.path, value); |
| 417 | this._signal("setOption", {name: option.path, value: value}); |
| 418 | } |
| 419 | |
| 420 | getOption(option) { |
| 421 | if (option.getValue) |
no test coverage detected