OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 | 422 |
423 TEST(ObservationWeakMap) { | 423 TEST(ObservationWeakMap) { |
424 HarmonyIsolate isolate; | 424 HarmonyIsolate isolate; |
425 HandleScope scope(isolate.GetIsolate()); | 425 HandleScope scope(isolate.GetIsolate()); |
426 LocalContext context; | 426 LocalContext context; |
427 CompileRun( | 427 CompileRun( |
428 "var obj = {};" | 428 "var obj = {};" |
429 "Object.observe(obj, function(){});" | 429 "Object.observe(obj, function(){});" |
430 "Object.getNotifier(obj);" | 430 "Object.getNotifier(obj);" |
431 "obj = null;"); | 431 "obj = null;"); |
| 432 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate.GetIsolate()); |
432 i::Handle<i::JSObject> observation_state = | 433 i::Handle<i::JSObject> observation_state = |
433 i::Isolate::Current()->factory()->observation_state(); | 434 i_isolate->factory()->observation_state(); |
434 i::Handle<i::JSWeakMap> callbackInfoMap = | 435 i::Handle<i::JSWeakMap> callbackInfoMap = |
435 i::Handle<i::JSWeakMap>::cast( | 436 i::Handle<i::JSWeakMap>::cast( |
436 i::GetProperty(observation_state, "callbackInfoMap")); | 437 i::GetProperty(observation_state, "callbackInfoMap")); |
437 i::Handle<i::JSWeakMap> objectInfoMap = | 438 i::Handle<i::JSWeakMap> objectInfoMap = |
438 i::Handle<i::JSWeakMap>::cast( | 439 i::Handle<i::JSWeakMap>::cast( |
439 i::GetProperty(observation_state, "objectInfoMap")); | 440 i::GetProperty(observation_state, "objectInfoMap")); |
440 i::Handle<i::JSWeakMap> notifierObjectInfoMap = | 441 i::Handle<i::JSWeakMap> notifierObjectInfoMap = |
441 i::Handle<i::JSWeakMap>::cast( | 442 i::Handle<i::JSWeakMap>::cast( |
442 i::GetProperty(observation_state, "notifierObjectInfoMap")); | 443 i::GetProperty(observation_state, "notifierObjectInfoMap")); |
443 CHECK_EQ(1, NumberOfElements(callbackInfoMap)); | 444 CHECK_EQ(1, NumberOfElements(callbackInfoMap)); |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 instance->Set(String::New("foo"), String::New("bar")); | 709 instance->Set(String::New("foo"), String::New("bar")); |
709 CompileRun(""); // trigger delivery | 710 CompileRun(""); // trigger delivery |
710 const RecordExpectation expected_records2[] = { | 711 const RecordExpectation expected_records2[] = { |
711 { instance, "new", "5", Handle<Value>() }, | 712 { instance, "new", "5", Handle<Value>() }, |
712 { instance, "new", "foo", Handle<Value>() } | 713 { instance, "new", "foo", Handle<Value>() } |
713 }; | 714 }; |
714 EXPECT_RECORDS(CompileRun("records2"), expected_records2); | 715 EXPECT_RECORDS(CompileRun("records2"), expected_records2); |
715 } | 716 } |
716 CHECK(CompileRun("records")->IsNull()); | 717 CHECK(CompileRun("records")->IsNull()); |
717 } | 718 } |
OLD | NEW |