StringObjectUse should not be a structure check for the original string object structure
[WebKit-https.git] / LayoutTests / sputnik / Conformance / 07_Lexical_Conventions / 7.3_Line_Terminators / S7.3_A7_T6.html
1 <html>
2 <head>
3 <meta charset='utf-8'>
4 <style>
5 .pass {
6     font-weight: bold;
7     color: green;
8 }
9 .fail {
10     font-weight: bold;
11     color: red;
12 }
13 </style>
14
15 <script>
16 if (window.testRunner)
17     testRunner.dumpAsText();
18
19 function SputnikError(message)
20 {
21     this.message = message;
22 }
23
24 SputnikError.prototype.toString = function ()
25 {
26     return 'SputnikError: ' + this.message;
27 };
28
29 var sputnikException;
30
31 function testPrint(msg)
32 {
33     var span = document.createElement("span");
34     document.getElementById("console").appendChild(span); // insert it first so XHTML knows the namespace 
35     span.innerHTML = msg + '<br />';
36 }
37
38 function escapeHTML(text)
39 {
40     return text.toString().replace(/&/g, "&amp;").replace(/</g, "&lt;");
41 }
42
43 function printTestPassed(msg)
44 {
45     testPrint('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
46 }
47
48 function printTestFailed(msg)
49 {
50     testPrint('<span><span class="fail">FAIL</span> ' + escapeHTML(msg) + '</span>');
51 }
52
53 function testFailed(msg)
54 {
55     throw new SputnikError(msg);
56 }
57
58 var successfullyParsed = false;
59 </script>
60
61 </head>
62 <body>
63 <p>S7.3_A7_T6</p>
64 <div id='console'></div>
65 <script>
66 try {
67
68 /**
69  * @name: S7.3_A7_T6;
70  * @section: 7.3;
71  * @assertion: Line Terminators between operators are allowed;
72  * @description: Insert Line Terminator in var x=y>>z;  
73 */
74
75 // CHECK#1
76 var y=16;
77 var z=3;
78 var
79 x
80 =
81 y
82 >>
83 z
84 ;
85 if (x !== 2) {
86   testFailed('#1: var\\nx\\n=\\ny\\n>>\\nz\\n; x === 2. Actual: ' + (x));
87 }
88 x=0;
89
90 // CHECK#2
91 var y=16;
92 var z=3;
93 var
94 x
95 =
96 y
97 >>
98 z
99 ;
100 if (x !== 2) {
101   testFailed('#2: var\\nx\\n=\\ny\\n>>\\nz\\n; x === 2. Actual: ' + (x));
102 }
103 x=0;
104
105 // CHECK#3
106 var y=16;
107 var z=3;
108 eval("\u2028var\u2028x\u2028=\u2028y\u2028>>\u2028z\u2028");
109 if (x !== 2) {
110   testFailed('#3: eval("\\u2028var\\u2028x\\u2028=\\u2028y\\u2028>>\\u2028z\\u2028"); x === 2. Actual: ' + (x));
111 }
112 x=0;
113
114 // CHECK#4
115 var y=16;
116 var z=3;
117 eval("\u2029var\u2029x\u2029=\u2029y\u2029>>\u2029z\u2029");
118 if (x !== 2) {
119   testFailed('#4: eval("\\u2029var\\u2029x\\u2029=\\u2029y\\u2029>>\\u2029z\\u2029"); x === 2. Actual: ' + (x));
120 }
121
122 } catch (ex) {
123     sputnikException = ex;
124 }
125
126 var successfullyParsed = true;
127 </script>
128
129 <script>
130 if (!successfullyParsed)
131     printTestFailed('successfullyParsed is not set');
132 else if (sputnikException)
133     printTestFailed(sputnikException);
134 else
135     printTestPassed("");
136 testPrint('<br /><span class="pass">TEST COMPLETE</span>');
137 </script>
138 </body>
139 </html>