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

Side by Side Diff: test/cctest/test-strings.cc

Issue 236303015: Remove some uses of MaybeObject methods. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « test/cctest/test-global-handles.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 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 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 }; 1080 };
1081 1081
1082 const char* line; 1082 const char* line;
1083 for (int i = 0; (line = lines[i]); i++) { 1083 for (int i = 0; (line = lines[i]); i++) {
1084 printf("%s\n", line); 1084 printf("%s\n", line);
1085 v8::Local<v8::Value> result = v8::Script::Compile( 1085 v8::Local<v8::Value> result = v8::Script::Compile(
1086 v8::String::NewFromUtf8(CcTest::isolate(), line))->Run(); 1086 v8::String::NewFromUtf8(CcTest::isolate(), line))->Run();
1087 CHECK_EQ(results[i]->IsUndefined(), result->IsUndefined()); 1087 CHECK_EQ(results[i]->IsUndefined(), result->IsUndefined());
1088 CHECK_EQ(results[i]->IsNumber(), result->IsNumber()); 1088 CHECK_EQ(results[i]->IsNumber(), result->IsNumber());
1089 if (result->IsNumber()) { 1089 if (result->IsNumber()) {
1090 CHECK_EQ(Smi::cast(results[i]->ToSmi()->ToObjectChecked())->value(), 1090 CHECK_EQ(Handle<Smi>::cast(Object::ToSmi(isolate, results[i]))->value(),
1091 result->ToInt32()->Value()); 1091 result->ToInt32()->Value());
1092 } 1092 }
1093 } 1093 }
1094 } 1094 }
1095 1095
1096 1096
1097 TEST(SliceFromCons) { 1097 TEST(SliceFromCons) {
1098 FLAG_string_slices = true; 1098 FLAG_string_slices = true;
1099 CcTest::InitializeVM(); 1099 CcTest::InitializeVM();
1100 Factory* factory = CcTest::i_isolate()->factory(); 1100 Factory* factory = CcTest::i_isolate()->factory();
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
1415 dummy.Dispose(); \ 1415 dummy.Dispose(); \
1416 } 1416 }
1417 1417
1418 INVALID_STRING_TEST(NewStringFromAscii, char) 1418 INVALID_STRING_TEST(NewStringFromAscii, char)
1419 INVALID_STRING_TEST(NewStringFromUtf8, char) 1419 INVALID_STRING_TEST(NewStringFromUtf8, char)
1420 INVALID_STRING_TEST(NewStringFromOneByte, uint8_t) 1420 INVALID_STRING_TEST(NewStringFromOneByte, uint8_t)
1421 INVALID_STRING_TEST(InternalizeOneByteString, uint8_t) 1421 INVALID_STRING_TEST(InternalizeOneByteString, uint8_t)
1422 INVALID_STRING_TEST(InternalizeUtf8String, char) 1422 INVALID_STRING_TEST(InternalizeUtf8String, char)
1423 1423
1424 #undef INVALID_STRING_TEST 1424 #undef INVALID_STRING_TEST
OLDNEW
« no previous file with comments | « test/cctest/test-global-handles.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698