1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/tests/js1_8_1/extensions/new-parenthesization.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,21 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* 1.6 + * Any copyright is dedicated to the Public Domain. 1.7 + * http://creativecommons.org/licenses/publicdomain/ 1.8 + * Contributor: Jesse Ruderman 1.9 + */ 1.10 + 1.11 +//----------------------------------------------------------------------------- 1.12 +var BUGNUMBER = 521456; 1.13 +var summary = 1.14 + 'Incorrect decompilation of new (eval(v)).s and new (f.apply(2)).s'; 1.15 +printBugNumber(BUGNUMBER); 1.16 +printStatus(summary); 1.17 + 1.18 +function foo(c) { return new (eval(c)).s; } 1.19 +function bar(f) { var a = new (f.apply(2).s); return a; } 1.20 + 1.21 +assertEq(bar.toString().search(/new\s+f/), -1); 1.22 +assertEq(foo.toString().search(/new\s+eval/), -1); 1.23 + 1.24 +reportCompare(true, true);