OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 | 2 |
3 // Check that we can traverse very deep stacks of ConsStrings using | 3 // Check that we can traverse very deep stacks of ConsStrings using |
4 // StringInputBuffer. Check that Get(int) works on very deep stacks | 4 // StringInputBuffer. Check that Get(int) works on very deep stacks |
5 // of ConsStrings. These operations may not be very fast, but they | 5 // of ConsStrings. These operations may not be very fast, but they |
6 // should be possible without getting errors due to too deep recursion. | 6 // should be possible without getting errors due to too deep recursion. |
7 | 7 |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 | 9 |
10 #include "v8.h" | 10 #include "v8.h" |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 thirtyseven, | 466 thirtyseven, |
467 fortytwo, | 467 fortytwo, |
468 thirtyseven // Bug yielded 42 here. | 468 thirtyseven // Bug yielded 42 here. |
469 }; | 469 }; |
470 | 470 |
471 const char* line; | 471 const char* line; |
472 for (int i = 0; (line = lines[i]); i++) { | 472 for (int i = 0; (line = lines[i]); i++) { |
473 printf("%s\n", line); | 473 printf("%s\n", line); |
474 v8::Local<v8::Value> result = | 474 v8::Local<v8::Value> result = |
475 v8::Script::Compile(v8::String::New(line))->Run(); | 475 v8::Script::Compile(v8::String::New(line))->Run(); |
476 ASSERT_EQ(results[i]->IsUndefined(), result->IsUndefined()); | 476 CHECK_EQ(results[i]->IsUndefined(), result->IsUndefined()); |
477 ASSERT_EQ(results[i]->IsNumber(), result->IsNumber()); | 477 CHECK_EQ(results[i]->IsNumber(), result->IsNumber()); |
478 if (result->IsNumber()) { | 478 if (result->IsNumber()) { |
479 ASSERT_EQ(Smi::cast(results[i]->ToSmi())->value(), | 479 CHECK_EQ(Smi::cast(results[i]->ToSmi())->value(), |
480 result->ToInt32()->Value()); | 480 result->ToInt32()->Value()); |
481 } | 481 } |
482 } | 482 } |
483 } | 483 } |
OLD | NEW |