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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 i::ExternalTwoByteString::cast(*v8::Utils::OpenHandle(*source))); | 385 i::ExternalTwoByteString::cast(*v8::Utils::OpenHandle(*source))); |
386 // This situation can happen if source was an external string disposed | 386 // This situation can happen if source was an external string disposed |
387 // by its owner. | 387 // by its owner. |
388 i_source->set_resource(NULL); | 388 i_source->set_resource(NULL); |
389 | 389 |
390 // Must not crash. | 390 // Must not crash. |
391 i::Isolate::Current()->logger()->LogCompiledFunctions(); | 391 i::Isolate::Current()->logger()->LogCompiledFunctions(); |
392 } | 392 } |
393 | 393 |
394 | 394 |
395 static v8::Handle<v8::Value> ObjMethod1(const v8::Arguments& args) { | 395 static void ObjMethod1(const v8::FunctionCallbackInfo<v8::Value>& args) { |
396 return v8::Handle<v8::Value>(); | |
397 } | 396 } |
398 | 397 |
399 TEST(LogCallbacks) { | 398 TEST(LogCallbacks) { |
400 ScopedLoggerInitializer initialize_logger(false); | 399 ScopedLoggerInitializer initialize_logger(false); |
401 Logger* logger = initialize_logger.logger(); | 400 Logger* logger = initialize_logger.logger(); |
402 | 401 |
403 v8::Local<v8::FunctionTemplate> obj = | 402 v8::Local<v8::FunctionTemplate> obj = |
404 v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), | 403 v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), |
405 v8::FunctionTemplate::New()); | 404 v8::FunctionTemplate::New()); |
406 obj->SetClassName(v8_str("Obj")); | 405 obj->SetClassName(v8_str("Obj")); |
(...skipping 17 matching lines...) Expand all Loading... |
424 | 423 |
425 i::EmbeddedVector<char, 100> ref_data; | 424 i::EmbeddedVector<char, 100> ref_data; |
426 i::OS::SNPrintF(ref_data, | 425 i::OS::SNPrintF(ref_data, |
427 "code-creation,Callback,-3,0x%" V8PRIxPTR ",1,\"method1\"\0", | 426 "code-creation,Callback,-3,0x%" V8PRIxPTR ",1,\"method1\"\0", |
428 ObjMethod1); | 427 ObjMethod1); |
429 | 428 |
430 CHECK_NE(NULL, StrNStr(log.start(), ref_data.start(), log.length())); | 429 CHECK_NE(NULL, StrNStr(log.start(), ref_data.start(), log.length())); |
431 } | 430 } |
432 | 431 |
433 | 432 |
434 static v8::Handle<v8::Value> Prop1Getter(v8::Local<v8::String> property, | 433 static void Prop1Getter(v8::Local<v8::String> property, |
435 const v8::AccessorInfo& info) { | 434 const v8::PropertyCallbackInfo<v8::Value>& info) { |
436 return v8::Handle<v8::Value>(); | |
437 } | 435 } |
438 | 436 |
439 static void Prop1Setter(v8::Local<v8::String> property, | 437 static void Prop1Setter(v8::Local<v8::String> property, |
440 v8::Local<v8::Value> value, | 438 v8::Local<v8::Value> value, |
441 const v8::AccessorInfo& info) { | 439 const v8::PropertyCallbackInfo<void>& info) { |
442 } | 440 } |
443 | 441 |
444 static v8::Handle<v8::Value> Prop2Getter(v8::Local<v8::String> property, | 442 static void Prop2Getter(v8::Local<v8::String> property, |
445 const v8::AccessorInfo& info) { | 443 const v8::PropertyCallbackInfo<v8::Value>& info) { |
446 return v8::Handle<v8::Value>(); | |
447 } | 444 } |
448 | 445 |
449 TEST(LogAccessorCallbacks) { | 446 TEST(LogAccessorCallbacks) { |
450 ScopedLoggerInitializer initialize_logger(false); | 447 ScopedLoggerInitializer initialize_logger(false); |
451 Logger* logger = initialize_logger.logger(); | 448 Logger* logger = initialize_logger.logger(); |
452 | 449 |
453 v8::Local<v8::FunctionTemplate> obj = | 450 v8::Local<v8::FunctionTemplate> obj = |
454 v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), | 451 v8::Local<v8::FunctionTemplate>::New(v8::Isolate::GetCurrent(), |
455 v8::FunctionTemplate::New()); | 452 v8::FunctionTemplate::New()); |
456 obj->SetClassName(v8_str("Obj")); | 453 obj->SetClassName(v8_str("Obj")); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 v8::Local<v8::String> s = result->ToString(); | 558 v8::Local<v8::String> s = result->ToString(); |
562 i::ScopedVector<char> data(s->Utf8Length() + 1); | 559 i::ScopedVector<char> data(s->Utf8Length() + 1); |
563 CHECK_NE(NULL, data.start()); | 560 CHECK_NE(NULL, data.start()); |
564 s->WriteUtf8(data.start()); | 561 s->WriteUtf8(data.start()); |
565 printf("%s\n", data.start()); | 562 printf("%s\n", data.start()); |
566 // Make sure that our output is written prior crash due to CHECK failure. | 563 // Make sure that our output is written prior crash due to CHECK failure. |
567 fflush(stdout); | 564 fflush(stdout); |
568 CHECK(false); | 565 CHECK(false); |
569 } | 566 } |
570 } | 567 } |
OLD | NEW |