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

Side by Side Diff: test/fuzzer/regexp.cc

Issue 2207923002: Properly handle exceptions in cctests (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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 | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> 5 #include <limits.h>
6 #include <stddef.h> 6 #include <stddef.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "include/v8.h" 9 #include "include/v8.h"
10 #include "src/factory.h" 10 #include "src/factory.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 i::Handle<i::String> two_byte = 55 i::Handle<i::String> two_byte =
56 factory->NewStringFromTwoByte(i::Vector<const i::uc16>(two_byte_array, 6)) 56 factory->NewStringFromTwoByte(i::Vector<const i::uc16>(two_byte_array, 6))
57 .ToHandleChecked(); 57 .ToHandleChecked();
58 58
59 for (int flags = 0; flags <= kAllFlags; flags++) { 59 for (int flags = 0; flags <= kAllFlags; flags++) {
60 i::Handle<i::JSRegExp> regexp; 60 i::Handle<i::JSRegExp> regexp;
61 { 61 {
62 v8::TryCatch try_catch(isolate); 62 v8::TryCatch try_catch(isolate);
63 i::MaybeHandle<i::JSRegExp> maybe_regexp = 63 i::MaybeHandle<i::JSRegExp> maybe_regexp =
64 i::JSRegExp::New(source, static_cast<i::JSRegExp::Flags>(flags)); 64 i::JSRegExp::New(source, static_cast<i::JSRegExp::Flags>(flags));
65 if (!maybe_regexp.ToHandle(&regexp)) continue; 65 if (!maybe_regexp.ToHandle(&regexp)) {
66 i_isolate->clear_pending_exception();
67 continue;
68 }
66 } 69 }
67 Test(isolate, regexp, one_byte, results_array); 70 Test(isolate, regexp, one_byte, results_array);
68 Test(isolate, regexp, two_byte, results_array); 71 Test(isolate, regexp, two_byte, results_array);
69 Test(isolate, regexp, factory->empty_string(), results_array); 72 Test(isolate, regexp, factory->empty_string(), results_array);
70 Test(isolate, regexp, source, results_array); 73 Test(isolate, regexp, source, results_array);
71 } 74 }
72 75
73 isolate->RequestGarbageCollectionForTesting( 76 isolate->RequestGarbageCollectionForTesting(
74 v8::Isolate::kFullGarbageCollection); 77 v8::Isolate::kFullGarbageCollection);
75 return 0; 78 return 0;
76 } 79 }
OLDNEW
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698