Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / tests / js1_8_1 / decompilation / regress-530537.js
1 /* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * Any copyright is dedicated to the Public Domain.
4  * http://creativecommons.org/licenses/publicdomain/
5  * Contributor: Blake Kaplan
6  */
7
8 //-----------------------------------------------------------------------------
9 var BUGNUMBER = 530537;
10 var summary = 'Decompilation of JSOP_CONCATN with a ternary operator';
11 var actual = '';
12 var expect = '';
13
14
15 //-----------------------------------------------------------------------------
16 test();
17 //-----------------------------------------------------------------------------
18
19 function test()
20 {
21   enterFunc ('test');
22   printBugNumber(BUGNUMBER);
23   printStatus (summary);
24
25   // NB: Control: test JSOP_ADD first.
26   var f = function (b) { dump((b ? "yes" : "no") + "_bye"); }
27   expect = 'function (b) { dump((b ? "yes" : "no") + "_bye"); }';
28   actual = f + '';
29
30   compareSource(expect, actual, summary.replace("ternary", "plus"));
31
32   var f = function (b) { dump("hi_" + (b ? "yes" : "no") + "_bye"); }
33   expect = 'function (b) { dump("hi_" + (b ? "yes" : "no") + "_bye"); }';
34   actual = f + '';
35
36   compareSource(expect, actual, summary);
37
38   exitFunc ('test');
39 }
40