From 750aedd5c8744d10f9d0b73503b54c22185d2036 Mon Sep 17 00:00:00 2001 From: kzc Date: Fri, 19 May 2017 01:39:09 -0400 Subject: [PATCH] add a minify error example --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 2b5b2a7b..579390ce 100644 --- a/README.md +++ b/README.md @@ -329,6 +329,13 @@ console.log(result.warnings); // [ 'Dropping unused variable u [0:1,18]' ] console.log(result.error); // runtime error, not defined in this case ``` +An error example: +```javascript +var result = UglifyJS.minify({"foo.js" : "if (0) else console.log(1);"}); +console.log(JSON.stringify(result.error)); +// {"message":"Unexpected token: keyword (else)","filename":"foo.js","line":1,"col":7,"pos":7} +``` + ## Minify options - `warnings` (default `false`) — pass `true` to return compressor warnings