| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 CHECK_EQ(count_before, count_after); | 234 CHECK_EQ(count_before, count_after); |
| 235 } | 235 } |
| 236 | 236 |
| 237 static v8::Handle<Value> CheckAccessorArgsCorrect(Local<String> name, | 237 static v8::Handle<Value> CheckAccessorArgsCorrect(Local<String> name, |
| 238 const AccessorInfo& info) { | 238 const AccessorInfo& info) { |
| 239 CHECK(info.This() == info.Holder()); | 239 CHECK(info.This() == info.Holder()); |
| 240 CHECK(info.Data()->Equals(v8::String::New("data"))); | 240 CHECK(info.Data()->Equals(v8::String::New("data"))); |
| 241 ApiTestFuzzer::Fuzz(); | 241 ApiTestFuzzer::Fuzz(); |
| 242 CHECK(info.This() == info.Holder()); | 242 CHECK(info.This() == info.Holder()); |
| 243 CHECK(info.Data()->Equals(v8::String::New("data"))); | 243 CHECK(info.Data()->Equals(v8::String::New("data"))); |
| 244 HEAP->CollectAllGarbage(true); | 244 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags); |
| 245 CHECK(info.This() == info.Holder()); | 245 CHECK(info.This() == info.Holder()); |
| 246 CHECK(info.Data()->Equals(v8::String::New("data"))); | 246 CHECK(info.Data()->Equals(v8::String::New("data"))); |
| 247 return v8::Integer::New(17); | 247 return v8::Integer::New(17); |
| 248 } | 248 } |
| 249 | 249 |
| 250 THREADED_TEST(DirectCall) { | 250 THREADED_TEST(DirectCall) { |
| 251 v8::HandleScope scope; | 251 v8::HandleScope scope; |
| 252 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); | 252 v8::Handle<v8::ObjectTemplate> obj = ObjectTemplate::New(); |
| 253 obj->SetAccessor(v8_str("xxx"), | 253 obj->SetAccessor(v8_str("xxx"), |
| 254 CheckAccessorArgsCorrect, | 254 CheckAccessorArgsCorrect, |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 obj->SetAccessor(v8_str("xxx"), AllocateHandles); | 439 obj->SetAccessor(v8_str("xxx"), AllocateHandles); |
| 440 LocalContext env; | 440 LocalContext env; |
| 441 env->Global()->Set(v8_str("obj"), obj->NewInstance()); | 441 env->Global()->Set(v8_str("obj"), obj->NewInstance()); |
| 442 v8::Handle<v8::Value> result = Script::Compile(String::New( | 442 v8::Handle<v8::Value> result = Script::Compile(String::New( |
| 443 "var result;" | 443 "var result;" |
| 444 "for (var i = 0; i < 4; i++)" | 444 "for (var i = 0; i < 4; i++)" |
| 445 " result = obj.xxx;" | 445 " result = obj.xxx;" |
| 446 "result;"))->Run(); | 446 "result;"))->Run(); |
| 447 CHECK_EQ(100, result->Int32Value()); | 447 CHECK_EQ(100, result->Int32Value()); |
| 448 } | 448 } |
| OLD | NEW |