OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 { "{", "}" }, | 1140 { "{", "}" }, |
1141 { "if (true) ", " else {}" }, | 1141 { "if (true) ", " else {}" }, |
1142 { "if (true) {} else ", "" }, | 1142 { "if (true) {} else ", "" }, |
1143 { "if (true) ", "" }, | 1143 { "if (true) ", "" }, |
1144 { "do ", " while (false)" }, | 1144 { "do ", " while (false)" }, |
1145 { "while (false) ", "" }, | 1145 { "while (false) ", "" }, |
1146 { "for (;;) ", "" }, | 1146 { "for (;;) ", "" }, |
1147 { "with ({})", "" }, | 1147 { "with ({})", "" }, |
1148 { "switch (12) { case 12: ", "}" }, | 1148 { "switch (12) { case 12: ", "}" }, |
1149 { "switch (12) { default: ", "}" }, | 1149 { "switch (12) { default: ", "}" }, |
| 1150 { "switch (12) { ", "case 12: }" }, |
1150 { "label2: ", "" }, | 1151 { "label2: ", "" }, |
1151 { NULL, NULL } | 1152 { NULL, NULL } |
1152 }; | 1153 }; |
1153 | 1154 |
1154 const char* statement_data[] = { | 1155 const char* statement_data[] = { |
1155 "{}", | 1156 "{}", |
1156 "var x", | 1157 "var x", |
1157 "var x = 1", | 1158 "var x = 1", |
1158 "const x", | 1159 "const x", |
1159 "const x = 1", | 1160 "const x = 1", |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 " b = function() { \n" | 1253 " b = function() { \n" |
1253 " 01; \n" | 1254 " 01; \n" |
1254 " }; \n" | 1255 " }; \n" |
1255 "}; \n"; | 1256 "}; \n"; |
1256 v8::Script::Compile(v8::String::New(script)); | 1257 v8::Script::Compile(v8::String::New(script)); |
1257 CHECK(try_catch.HasCaught()); | 1258 CHECK(try_catch.HasCaught()); |
1258 v8::String::Utf8Value exception(try_catch.Exception()); | 1259 v8::String::Utf8Value exception(try_catch.Exception()); |
1259 CHECK_EQ("SyntaxError: Octal literals are not allowed in strict mode.", | 1260 CHECK_EQ("SyntaxError: Octal literals are not allowed in strict mode.", |
1260 *exception); | 1261 *exception); |
1261 } | 1262 } |
OLD | NEW |