Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: preparser/preparser-process.cc

Issue 6990056: Add tests for function statements in strict mode. (Closed)
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/preparser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 if (!reader.throws()) { 234 if (!reader.throws()) {
235 if (expects->type == NULL) { 235 if (expects->type == NULL) {
236 fail(data, "Didn't throw as expected\n"); 236 fail(data, "Didn't throw as expected\n");
237 } else { 237 } else {
238 fail(data, "Didn't throw \"%s\" as expected\n", expects->type); 238 fail(data, "Didn't throw \"%s\" as expected\n", expects->type);
239 } 239 }
240 } 240 }
241 if (expects->type != NULL) { 241 if (expects->type != NULL) {
242 const char* actual_message = reader.message(); 242 const char* actual_message = reader.message();
243 if (strcmp(expects->type, actual_message)) { 243 if (strcmp(expects->type, actual_message)) {
244 fail(data, "Wrong error message. Expected <%s>, found <%s>\n", 244 fail(data, "Wrong error message. Expected <%s>, found <%s> at %d..%d\n",
245 expects->type, actual_message); 245 expects->type, actual_message, reader.beg_pos(), reader.end_pos());
246 } 246 }
247 } 247 }
248 if (expects->beg_pos >= 0) { 248 if (expects->beg_pos >= 0) {
249 if (expects->beg_pos != reader.beg_pos()) { 249 if (expects->beg_pos != reader.beg_pos()) {
250 fail(data, "Wrong error start position: Expected %i, found %i\n", 250 fail(data, "Wrong error start position: Expected %i, found %i\n",
251 expects->beg_pos, reader.beg_pos()); 251 expects->beg_pos, reader.beg_pos());
252 } 252 }
253 } 253 }
254 if (expects->end_pos >= 0) { 254 if (expects->end_pos >= 0) {
255 if (expects->end_pos != reader.end_pos()) { 255 if (expects->end_pos != reader.end_pos()) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 if (data.stack_overflow()) { 369 if (data.stack_overflow()) {
370 fail(&data, "ERROR: Stack overflow\n"); 370 fail(&data, "ERROR: Stack overflow\n");
371 } 371 }
372 372
373 // Check that the expected exception is thrown, if an exception is 373 // Check that the expected exception is thrown, if an exception is
374 // expected. 374 // expected.
375 CheckException(&data, &expects); 375 CheckException(&data, &expects);
376 376
377 return EXIT_SUCCESS; 377 return EXIT_SUCCESS;
378 } 378 }
OLDNEW
« no previous file with comments | « no previous file | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698