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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 instance->Set(String::New("foo"), String::New("bar")); | 713 instance->Set(String::New("foo"), String::New("bar")); |
714 CompileRun(""); // trigger delivery | 714 CompileRun(""); // trigger delivery |
715 const RecordExpectation expected_records2[] = { | 715 const RecordExpectation expected_records2[] = { |
716 { instance, "new", "5", Handle<Value>() }, | 716 { instance, "new", "5", Handle<Value>() }, |
717 { instance, "new", "foo", Handle<Value>() } | 717 { instance, "new", "foo", Handle<Value>() } |
718 }; | 718 }; |
719 EXPECT_RECORDS(CompileRun("records2"), expected_records2); | 719 EXPECT_RECORDS(CompileRun("records2"), expected_records2); |
720 } | 720 } |
721 CHECK(CompileRun("records")->IsNull()); | 721 CHECK(CompileRun("records")->IsNull()); |
722 } | 722 } |
| 723 |
| 724 |
| 725 TEST(HiddenPropertiesLeakage) { |
| 726 HarmonyIsolate isolate; |
| 727 HandleScope scope(isolate.GetIsolate()); |
| 728 LocalContext context(isolate.GetIsolate()); |
| 729 CompileRun("var obj = {};" |
| 730 "var records = null;" |
| 731 "var observer = function(r) { records = r };" |
| 732 "Object.observe(obj, observer);"); |
| 733 Handle<Value> obj = context->Global()->Get(String::New("obj")); |
| 734 Handle<Object>::Cast(obj)->SetHiddenValue(String::New("foo"), Null()); |
| 735 CompileRun(""); // trigger delivery |
| 736 CHECK(CompileRun("records")->IsNull()); |
| 737 } |
OLD | NEW |