diff options
author | Mihai Bazon <mihai@bazon.net> | 2013-10-30 13:59:59 +0200 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2013-10-30 13:59:59 +0200 |
commit | 63287c0e681154698a2aeb73380ea9b40260c6b0 (patch) | |
tree | 3bcc21f5319d669831cf6b6712045d9109fe6704 /lib | |
parent | c5ed2292bf2b78fcfb6913ef8819bb53f9e80132 (diff) | |
download | tracifyjs-63287c0e681154698a2aeb73380ea9b40260c6b0.tar.gz tracifyjs-63287c0e681154698a2aeb73380ea9b40260c6b0.zip |
Workaround for Safari bug
Close #313
Diffstat (limited to 'lib')
-rw-r--r-- | lib/output.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/output.js b/lib/output.js index 7f88d1f1..37e30c0e 100644 --- a/lib/output.js +++ b/lib/output.js @@ -508,8 +508,17 @@ function OutputStream(options) { }); PARENS(AST_Call, function(output){ - var p = output.parent(); - return p instanceof AST_New && p.expression === this; + var p = output.parent(), p1; + if (p instanceof AST_New && p.expression === this) + return true; + + // workaround for Safari bug. + // https://bugs.webkit.org/show_bug.cgi?id=123506 + return this.expression instanceof AST_Function + && p instanceof AST_PropAccess + && p.expression === this + && (p1 = output.parent(1)) instanceof AST_Assign + && p1.left === p; }); PARENS(AST_New, function(output){ |