OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 } | 556 } |
557 v8::Handle<v8::Value> result = script->Run(); | 557 v8::Handle<v8::Value> result = script->Run(); |
558 if (result.IsEmpty()) { | 558 if (result.IsEmpty()) { |
559 v8::String::Utf8Value exception(try_catch.Exception()); | 559 v8::String::Utf8Value exception(try_catch.Exception()); |
560 printf("run: %s\n", *exception); | 560 printf("run: %s\n", *exception); |
561 CHECK(false); | 561 CHECK(false); |
562 } | 562 } |
563 // The result either be a "true" literal or problem description. | 563 // The result either be a "true" literal or problem description. |
564 if (!result->IsTrue()) { | 564 if (!result->IsTrue()) { |
565 v8::Local<v8::String> s = result->ToString(); | 565 v8::Local<v8::String> s = result->ToString(); |
566 i::ScopedVector<char> data(s->Length() + 1); | 566 i::ScopedVector<char> data(s->Utf8Length() + 1); |
567 CHECK_NE(NULL, data.start()); | 567 CHECK_NE(NULL, data.start()); |
568 s->WriteAscii(data.start()); | 568 s->WriteUtf8(data.start()); |
569 printf("%s\n", data.start()); | 569 printf("%s\n", data.start()); |
570 // Make sure that our output is written prior crash due to CHECK failure. | 570 // Make sure that our output is written prior crash due to CHECK failure. |
571 fflush(stdout); | 571 fflush(stdout); |
572 CHECK(false); | 572 CHECK(false); |
573 } | 573 } |
574 } | 574 } |
OLD | NEW |