From 32af2ca49e12b22487f98d332af51b127b03c7e1 Mon Sep 17 00:00:00 2001 From: David Bonnet Date: Wed, 23 Apr 2014 22:57:28 +0200 Subject: [PATCH] Fixed TryStatement AST reformat when using acorn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As shown in http://mzl.la/1hkKgkE there is no property named `handlers` in the TryStatement node, but one named `handler`. Previously, a TypeError (cannot reach `[0]` of `M.handlers`) exception was thrown when using `uglifyjs` with the `—acorn` switch. --- lib/mozilla-ast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mozilla-ast.js b/lib/mozilla-ast.js index d7950942..721fa4a1 100644 --- a/lib/mozilla-ast.js +++ b/lib/mozilla-ast.js @@ -51,7 +51,7 @@ start : my_start_token(M), end : my_end_token(M), body : from_moz(M.block).body, - bcatch : from_moz(M.handlers[0]), + bcatch : from_moz(M.handler), bfinally : M.finalizer ? new AST_Finally(from_moz(M.finalizer)) : null }); },