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

Side by Side Diff: test/cctest/test-api.cc

Issue 10825196: Allow SetHiddenValue to accept empty value. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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/api.cc ('k') | no next file » | 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 2063 matching lines...) Expand 10 before | Expand all | Expand 10 after
2074 // slow case. 2074 // slow case.
2075 CHECK(obj->Set(prop_name, v8::Integer::New(2008))); 2075 CHECK(obj->Set(prop_name, v8::Integer::New(2008)));
2076 CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value()); 2076 CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
2077 CHECK_EQ(2008, obj->Get(prop_name)->Int32Value()); 2077 CHECK_EQ(2008, obj->Get(prop_name)->Int32Value());
2078 CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value()); 2078 CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
2079 CHECK(obj->Delete(prop_name)); 2079 CHECK(obj->Delete(prop_name));
2080 CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value()); 2080 CHECK_EQ(2002, obj->GetHiddenValue(key)->Int32Value());
2081 2081
2082 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags); 2082 HEAP->CollectAllGarbage(i::Heap::kNoGCFlags);
2083 2083
2084 CHECK(obj->SetHiddenValue(key, Handle<Value>()));
2085 CHECK(obj->GetHiddenValue(key).IsEmpty());
2086
2087 CHECK(obj->SetHiddenValue(key, v8::Integer::New(2002)));
2084 CHECK(obj->DeleteHiddenValue(key)); 2088 CHECK(obj->DeleteHiddenValue(key));
2085 CHECK(obj->GetHiddenValue(key).IsEmpty()); 2089 CHECK(obj->GetHiddenValue(key).IsEmpty());
2086 } 2090 }
2087 2091
2088 2092
2089 THREADED_TEST(Regress97784) { 2093 THREADED_TEST(Regress97784) {
2090 // Regression test for crbug.com/97784 2094 // Regression test for crbug.com/97784
2091 // Messing with the Object.prototype should not have effect on 2095 // Messing with the Object.prototype should not have effect on
2092 // hidden properties. 2096 // hidden properties.
2093 v8::HandleScope scope; 2097 v8::HandleScope scope;
(...skipping 14959 matching lines...) Expand 10 before | Expand all | Expand 10 after
17053 v8::HandleScope scope; 17057 v8::HandleScope scope;
17054 LocalContext context; 17058 LocalContext context;
17055 17059
17056 // Compile a try-finally clause where the finally block causes a GC 17060 // Compile a try-finally clause where the finally block causes a GC
17057 // while there still is a message pending for external reporting. 17061 // while there still is a message pending for external reporting.
17058 TryCatch try_catch; 17062 TryCatch try_catch;
17059 try_catch.SetVerbose(true); 17063 try_catch.SetVerbose(true);
17060 CompileRun("try { throw new Error(); } finally { gc(); }"); 17064 CompileRun("try { throw new Error(); } finally { gc(); }");
17061 CHECK(try_catch.HasCaught()); 17065 CHECK(try_catch.HasCaught());
17062 } 17066 }
OLDNEW
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698