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

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

Issue 6269021: Fix another message object leak. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 11 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/messages.js ('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 2007-2009 the V8 project authors. All rights reserved. 1 // Copyright 2007-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 2371 matching lines...) Expand 10 before | Expand all | Expand 10 after
2382 CompileRun("ReferenceError.prototype.constructor.name = void 0;"); 2382 CompileRun("ReferenceError.prototype.constructor.name = void 0;");
2383 CompileRun("asdf;"); 2383 CompileRun("asdf;");
2384 CompileRun("ReferenceError.prototype.constructor = void 0;"); 2384 CompileRun("ReferenceError.prototype.constructor = void 0;");
2385 CompileRun("asdf;"); 2385 CompileRun("asdf;");
2386 CompileRun("ReferenceError.prototype.__proto__ = new Object();"); 2386 CompileRun("ReferenceError.prototype.__proto__ = new Object();");
2387 CompileRun("asdf;"); 2387 CompileRun("asdf;");
2388 CompileRun("ReferenceError.prototype = new Object();"); 2388 CompileRun("ReferenceError.prototype = new Object();");
2389 CompileRun("asdf;"); 2389 CompileRun("asdf;");
2390 v8::Handle<Value> string = CompileRun("try { asdf; } catch(e) { e + ''; }"); 2390 v8::Handle<Value> string = CompileRun("try { asdf; } catch(e) { e + ''; }");
2391 CHECK(string->Equals(v8_str("Whoops"))); 2391 CHECK(string->Equals(v8_str("Whoops")));
2392 CompileRun("ReferenceError.prototype.constructor = new Object();"
2393 "ReferenceError.prototype.constructor.name = 1;"
2394 "Number.prototype.toString = function() { return 'Whoops'; };"
2395 "ReferenceError.prototype.toString = Object.prototype.toString;");
2396 CompileRun("asdf;");
2392 v8::V8::RemoveMessageListeners(check_message); 2397 v8::V8::RemoveMessageListeners(check_message);
2393 } 2398 }
2394 2399
2395 2400
2396 static void receive_message(v8::Handle<v8::Message> message, 2401 static void receive_message(v8::Handle<v8::Message> message,
2397 v8::Handle<v8::Value> data) { 2402 v8::Handle<v8::Value> data) {
2398 message->Get(); 2403 message->Get();
2399 message_received = true; 2404 message_received = true;
2400 } 2405 }
2401 2406
(...skipping 9803 matching lines...) Expand 10 before | Expand all | Expand 10 after
12205 v8::Context::Scope context_scope(context.local()); 12210 v8::Context::Scope context_scope(context.local());
12206 12211
12207 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(); 12212 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New();
12208 tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator); 12213 tmpl->SetNamedPropertyHandler(Getter, NULL, NULL, NULL, Enumerator);
12209 context->Global()->Set(v8_str("o"), tmpl->NewInstance()); 12214 context->Global()->Set(v8_str("o"), tmpl->NewInstance());
12210 v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun( 12215 v8::Handle<v8::Array> result = v8::Handle<v8::Array>::Cast(CompileRun(
12211 "var result = []; for (var k in o) result.push(k); result")); 12216 "var result = []; for (var k in o) result.push(k); result"));
12212 CHECK_EQ(1, result->Length()); 12217 CHECK_EQ(1, result->Length());
12213 CHECK_EQ(v8_str("universalAnswer"), result->Get(0)); 12218 CHECK_EQ(v8_str("universalAnswer"), result->Get(0));
12214 } 12219 }
OLDNEW
« no previous file with comments | « src/messages.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698