Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-309242.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var gTestfile = 'regress-309242.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 309242;
9 var summary = 'E4X should be on by default while preserving comment hack';
10 var actual = '';
11 var expect = '';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 /*
17 E4X should be available regardless of script type
18 <!-- and --> should begin comment to end of line
19 unless type=text/javascript;e4x=1
20 */
21
22 expect = true;
23 actual = true;
24 // the next line will be ignored when e4x is not requested
25 <!-- comment -->; actual = false;
26
27 reportCompare(expect, actual, summary + ': &lt;!-- is comment to end of line');
28
29 expect = true;
30 actual = false;
31 // the next line will be ignored when e4x is not requested
32 <!--
33 actual = true;
34 // -->
35
36 reportCompare(expect, actual, summary + ': comment hack works inside script');
37
38 // E4X is available always
39
40 var x = <foo/>;
41
42 expect = 'element';
43 actual = x.nodeKind();
44
45 reportCompare(expect, actual, summary + ': E4X is available');