| 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 | 398 |
| 399 TEST(LogCallbacks) { | 399 TEST(LogCallbacks) { |
| 400 ScopedLoggerInitializer initialize_logger(false); | 400 ScopedLoggerInitializer initialize_logger(false); |
| 401 Logger* logger = initialize_logger.logger(); | 401 Logger* logger = initialize_logger.logger(); |
| 402 | 402 |
| 403 v8::Local<v8::FunctionTemplate> obj = | 403 v8::Local<v8::FunctionTemplate> obj = |
| 404 v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), | 404 v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), |
| 405 v8::FunctionTemplate::New()); | 405 v8::FunctionTemplate::New()); |
| 406 obj->SetClassName(v8_str("Obj")); | 406 obj->SetClassName(v8_str("Obj")); |
| 407 v8::Handle<v8::ObjectTemplate> proto = obj->PrototypeTemplate(); | 407 v8::Handle<v8::ObjectTemplate> proto = obj->PrototypeTemplate(); |
| 408 v8::Local<v8::Signature> signature = | 408 v8::Local<v8::Signature> signature = v8::Signature::New(obj); |
| 409 v8::Signature::New(v8::Handle<v8::FunctionTemplate>(*obj)); | |
| 410 proto->Set(v8_str("method1"), | 409 proto->Set(v8_str("method1"), |
| 411 v8::FunctionTemplate::New(ObjMethod1, | 410 v8::FunctionTemplate::New(ObjMethod1, |
| 412 v8::Handle<v8::Value>(), | 411 v8::Handle<v8::Value>(), |
| 413 signature), | 412 signature), |
| 414 static_cast<v8::PropertyAttribute>(v8::DontDelete)); | 413 static_cast<v8::PropertyAttribute>(v8::DontDelete)); |
| 415 | 414 |
| 416 initialize_logger.env()->Global()->Set(v8_str("Obj"), obj->GetFunction()); | 415 initialize_logger.env()->Global()->Set(v8_str("Obj"), obj->GetFunction()); |
| 417 CompileRun("Obj.prototype.method1.toString();"); | 416 CompileRun("Obj.prototype.method1.toString();"); |
| 418 | 417 |
| 419 logger->LogCompiledFunctions(); | 418 logger->LogCompiledFunctions(); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 v8::Local<v8::String> s = result->ToString(); | 561 v8::Local<v8::String> s = result->ToString(); |
| 563 i::ScopedVector<char> data(s->Utf8Length() + 1); | 562 i::ScopedVector<char> data(s->Utf8Length() + 1); |
| 564 CHECK_NE(NULL, data.start()); | 563 CHECK_NE(NULL, data.start()); |
| 565 s->WriteUtf8(data.start()); | 564 s->WriteUtf8(data.start()); |
| 566 printf("%s\n", data.start()); | 565 printf("%s\n", data.start()); |
| 567 // Make sure that our output is written prior crash due to CHECK failure. | 566 // Make sure that our output is written prior crash due to CHECK failure. |
| 568 fflush(stdout); | 567 fflush(stdout); |
| 569 CHECK(false); | 568 CHECK(false); |
| 570 } | 569 } |
| 571 } | 570 } |
| OLD | NEW |