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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 CHECK_EQ(results[i]->IsUndefined(), result->IsUndefined()); | 476 CHECK_EQ(results[i]->IsUndefined(), result->IsUndefined()); |
477 CHECK_EQ(results[i]->IsNumber(), result->IsNumber()); | 477 CHECK_EQ(results[i]->IsNumber(), result->IsNumber()); |
478 if (result->IsNumber()) { | 478 if (result->IsNumber()) { |
479 CHECK_EQ(Smi::cast(results[i]->ToSmi())->value(), | 479 CHECK_EQ(Smi::cast(results[i]->ToSmi()->ToObjectChecked())->value(), |
480 result->ToInt32()->Value()); | 480 result->ToInt32()->Value()); |
481 } | 481 } |
482 } | 482 } |
483 } | 483 } |
OLD | NEW |