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

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

Issue 7037024: Added preparser strict-mode tests. (Closed)
Patch Set: Address review comment. 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/preparse-data.cc » ('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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 245 }
246 } 246 }
247 if (expects->end_pos >= 0) { 247 if (expects->end_pos >= 0) {
248 if (expects->end_pos != reader.end_pos()) { 248 if (expects->end_pos != reader.end_pos()) {
249 fail(data, "Wrong error end position: Expected %i, found %i\n", 249 fail(data, "Wrong error end position: Expected %i, found %i\n",
250 expects->end_pos, reader.end_pos()); 250 expects->end_pos, reader.end_pos());
251 } 251 }
252 } 252 }
253 } else if (reader.throws()) { 253 } else if (reader.throws()) {
254 const char* message = reader.message(); 254 const char* message = reader.message();
255 fail(data, "Throws unexpectedly with message: %s\n", message); 255 fail(data, "Throws unexpectedly with message: %s at location %d-%d\n",
256 message, reader.beg_pos(), reader.end_pos());
256 } 257 }
257 } 258 }
258 259
259 260
260 ExceptionExpectation ParseExpectation(int argc, const char* argv[]) { 261 ExceptionExpectation ParseExpectation(int argc, const char* argv[]) {
261 ExceptionExpectation expects; 262 ExceptionExpectation expects;
262 263
263 // Parse exception expectations from (the remainder of) the command line. 264 // Parse exception expectations from (the remainder of) the command line.
264 int arg_index = 0; 265 int arg_index = 0;
265 // Skip any flags. 266 // Skip any flags.
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 if (data.stack_overflow()) { 348 if (data.stack_overflow()) {
348 fail(&data, "ERROR: Stack overflow\n"); 349 fail(&data, "ERROR: Stack overflow\n");
349 } 350 }
350 351
351 // Check that the expected exception is thrown, if an exception is 352 // Check that the expected exception is thrown, if an exception is
352 // expected. 353 // expected.
353 CheckException(&data, &expects); 354 CheckException(&data, &expects);
354 355
355 return EXIT_SUCCESS; 356 return EXIT_SUCCESS;
356 } 357 }
OLDNEW
« no previous file with comments | « no previous file | src/preparse-data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698