StringObjectUse should not be a structure check for the original string object structure
[WebKit-https.git] / LayoutTests / sputnik / Conformance / 07_Lexical_Conventions / 7.9_Automatic_Semicolon_Insertion / S7.9_A2.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.9_A2</p>
64 <div id='console'></div>
65 <script>
66 try {
67
68 /**
69  * @name: S7.9_A2;
70  * @section: 7.9, 12.8, 12.12;
71  * @assertion: Check Break Statement for automatic semicolon insertion;
72  * @description: Try use break \n Label construction; 
73 */
74
75 //CHECK#1
76 label1: for (var i = 0; i <= 0; i++) {
77   for (var j = 0; j <= 0; j++) {
78     break label1;
79   }
80   testFailed('#1: Check break statement for automatic semicolon insertion');
81 }
82
83 //CHECK#2
84 var result = false;
85 label2: for (var i = 0; i <= 0; i++) {
86   for (var j = 0; j <= 0; j++) {
87     break 
88     label2;
89   }  
90   result = true;
91 }
92
93 if (result !== true) {
94   testFailed('#2: Check break statement for automatic semicolon insertion');
95 }
96
97 } catch (ex) {
98     sputnikException = ex;
99 }
100
101 var successfullyParsed = true;
102 </script>
103
104 <script>
105 if (!successfullyParsed)
106     printTestFailed('successfullyParsed is not set');
107 else if (sputnikException)
108     printTestFailed(sputnikException);
109 else
110     printTestPassed("");
111 testPrint('<br /><span class="pass">TEST COMPLETE</span>');
112 </script>
113 </body>
114 </html>