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

Unified Diff: test/cctest/test-parsing.cc

Issue 239243018: Heap::AllocateStringFromOneByte() and major part of its callers handlified. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing comment + some cleanup Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index cd38724e3746d8bbf0507f87bbc7c00caf577aea..e0c21f449e628e32d5b842002c079495c8cf8052 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -533,8 +533,7 @@ TEST(Regress928) {
"var bar = function () { /* second */ }";
v8::HandleScope handles(CcTest::isolate());
- i::Handle<i::String> source(
- factory->NewStringFromAscii(i::CStrVector(program)));
+ i::Handle<i::String> source = factory->NewStringFromAsciiChecked(program);
i::GenericStringUtf16CharacterStream stream(source, 0, source->length());
i::CompleteParserRecorder log;
i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
@@ -630,8 +629,8 @@ void TestCharacterStream(const char* ascii_source,
uc16_buffer[i] = static_cast<i::uc16>(ascii_source[i]);
}
i::Vector<const char> ascii_vector(ascii_source, static_cast<int>(length));
- i::Handle<i::String> ascii_string(
- factory->NewStringFromAscii(ascii_vector));
+ i::Handle<i::String> ascii_string =
+ factory->NewStringFromAscii(ascii_vector).ToHandleChecked();
TestExternalResource resource(uc16_buffer.get(), length);
i::Handle<i::String> uc16_string(
factory->NewExternalStringFromTwoByte(&resource).ToHandleChecked());
@@ -1209,8 +1208,8 @@ TEST(ScopePositions) {
source_data[i].outer_suffix);
// Parse program source.
- i::Handle<i::String> source(
- factory->NewStringFromUtf8(i::CStrVector(program.start())));
+ i::Handle<i::String> source = factory->NewStringFromUtf8(
+ i::CStrVector(program.start())).ToHandleChecked();
CHECK_EQ(source->length(), kProgramSize);
i::Handle<i::Script> script = factory->NewScript(source);
i::CompilationInfoWithZone info(script);
@@ -1403,7 +1402,7 @@ void TestParserSync(const char* source,
size_t flag_list_length,
ParserSyncTestResult result = kSuccessOrError) {
i::Handle<i::String> str =
- CcTest::i_isolate()->factory()->NewStringFromAscii(i::CStrVector(source));
+ CcTest::i_isolate()->factory()->NewStringFromAsciiChecked(source);
for (int bits = 0; bits < (1 << flag_list_length); bits++) {
i::EnumSet<ParserFlag> flags;
for (size_t flag_index = 0; flag_index < flag_list_length; flag_index++) {
@@ -2100,8 +2099,8 @@ TEST(DontRegressPreParserDataSizes) {
for (int i = 0; test_cases[i].program; i++) {
const char* program = test_cases[i].program;
i::Factory* factory = CcTest::i_isolate()->factory();
- i::Handle<i::String> source(
- factory->NewStringFromUtf8(i::CStrVector(program)));
+ i::Handle<i::String> source =
+ factory->NewStringFromUtf8(i::CStrVector(program)).ToHandleChecked();
i::Handle<i::Script> script = factory->NewScript(source);
i::CompilationInfoWithZone info(script);
i::ScriptData* data = NULL;
« no previous file with comments | « test/cctest/test-heap-profiler.cc ('k') | test/cctest/test-regexp.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698