mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
ESM: Tidied up recently ported ops
This commit is contained in:
parent
905bc6699e
commit
6768038a2f
14 changed files with 47 additions and 27 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
import Operation from "../Operation";
|
||||
import OperationError from "../errors/OperationError";
|
||||
import escodegen from "escodegen";
|
||||
import * as esprima from "esprima";
|
||||
|
||||
|
@ -84,7 +85,7 @@ class JavaScriptBeautify extends Operation {
|
|||
result = escodegen.generate(AST, options);
|
||||
} catch (e) {
|
||||
// Leave original error so the user can see the detail
|
||||
throw "Unable to parse JavaScript.<br>" + e.message;
|
||||
throw new OperationError("Unable to parse JavaScript.<br>" + e.message);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue