OLD | NEW |
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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 for (int i = 0; (line = lines[i]); i++) { | 1103 for (int i = 0; (line = lines[i]); i++) { |
1104 printf("%s\n", line); | 1104 printf("%s\n", line); |
1105 v8::Local<v8::Value> result = | 1105 v8::Local<v8::Value> result = |
1106 v8::Script::Compile(context, | 1106 v8::Script::Compile(context, |
1107 v8::String::NewFromUtf8(CcTest::isolate(), line, | 1107 v8::String::NewFromUtf8(CcTest::isolate(), line, |
1108 v8::NewStringType::kNormal) | 1108 v8::NewStringType::kNormal) |
1109 .ToLocalChecked()) | 1109 .ToLocalChecked()) |
1110 .ToLocalChecked() | 1110 .ToLocalChecked() |
1111 ->Run(context) | 1111 ->Run(context) |
1112 .ToLocalChecked(); | 1112 .ToLocalChecked(); |
1113 CHECK_EQ(results[i]->IsUndefined(CcTest::i_isolate()), | 1113 CHECK_EQ(results[i]->IsUndefined(), result->IsUndefined()); |
1114 result->IsUndefined()); | |
1115 CHECK_EQ(results[i]->IsNumber(), result->IsNumber()); | 1114 CHECK_EQ(results[i]->IsNumber(), result->IsNumber()); |
1116 if (result->IsNumber()) { | 1115 if (result->IsNumber()) { |
1117 int32_t value = 0; | 1116 int32_t value = 0; |
1118 CHECK(results[i]->ToInt32(&value)); | 1117 CHECK(results[i]->ToInt32(&value)); |
1119 CHECK_EQ(value, result->ToInt32(context).ToLocalChecked()->Value()); | 1118 CHECK_EQ(value, result->ToInt32(context).ToLocalChecked()->Value()); |
1120 } | 1119 } |
1121 } | 1120 } |
1122 } | 1121 } |
1123 | 1122 |
1124 | 1123 |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1524 } | 1523 } |
1525 { | 1524 { |
1526 HandleScope scope(isolate); | 1525 HandleScope scope(isolate); |
1527 v8::Local<v8::Value> result = CompileRun( | 1526 v8::Local<v8::Value> result = CompileRun( |
1528 "String.fromCharCode(432, 432, 432, 432, 432, " | 1527 "String.fromCharCode(432, 432, 432, 432, 432, " |
1529 "432, 432, 432, 432, 432, 432, 432, 432, 432, " | 1528 "432, 432, 432, 432, 432, 432, 432, 432, 432, " |
1530 "432, 432, 432, 432, 432, 432, 432, 432, 432)"); | 1529 "432, 432, 432, 432, 432, 432, 432, 432, 432)"); |
1531 CHECK(v8::Utils::OpenHandle(*result)->IsSeqTwoByteString()); | 1530 CHECK(v8::Utils::OpenHandle(*result)->IsSeqTwoByteString()); |
1532 } | 1531 } |
1533 } | 1532 } |
OLD | NEW |