Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: test/cctest/test-object-observe.cc

Issue 26592012: Prevent changes to hidden properties from being observable via Object.observe (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: moar Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/harmony/object-observe.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/harmony/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698