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

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

Issue 1303093004: Fix a segment-fault caused by Value::IntegerValue Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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
« src/api.cc ('K') | « 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 4656 matching lines...) Expand 10 before | Expand all | Expand 10 after
4667 CHECK(obj->IsInt32()); 4667 CHECK(obj->IsInt32());
4668 CHECK(obj->IsUint32()); 4668 CHECK(obj->IsUint32());
4669 // Positive zero 4669 // Positive zero
4670 CompileRun("var obj = -0.0;"); 4670 CompileRun("var obj = -0.0;");
4671 obj = env->Global()->Get(v8_str("obj")); 4671 obj = env->Global()->Get(v8_str("obj"));
4672 CHECK(!obj->IsInt32()); 4672 CHECK(!obj->IsInt32());
4673 CHECK(!obj->IsUint32()); 4673 CHECK(!obj->IsUint32());
4674 } 4674 }
4675 4675
4676 4676
4677 THREADED_TEST(NoSegmentationFault) {
4678 LocalContext env;
4679 v8::Isolate* isolate = env->GetIsolate();
4680 v8::HandleScope scope(isolate);
4681 CompileRun("var obj = {a: 1};");
4682 Local<Value> obj = env->Global()->Get(v8_str("obj"));
4683
4684 int64_t integer_value = obj->IntegerValue();
4685 CHECK_EQ(0, integer_value);
4686 }
4687
4688
4677 THREADED_TEST(ConversionException) { 4689 THREADED_TEST(ConversionException) {
4678 LocalContext env; 4690 LocalContext env;
4679 v8::Isolate* isolate = env->GetIsolate(); 4691 v8::Isolate* isolate = env->GetIsolate();
4680 v8::HandleScope scope(isolate); 4692 v8::HandleScope scope(isolate);
4681 CompileRun( 4693 CompileRun(
4682 "function TestClass() { };" 4694 "function TestClass() { };"
4683 "TestClass.prototype.toString = function () { throw 'uncle?'; };" 4695 "TestClass.prototype.toString = function () { throw 'uncle?'; };"
4684 "var obj = new TestClass();"); 4696 "var obj = new TestClass();");
4685 Local<Value> obj = env->Global()->Get(v8_str("obj")); 4697 Local<Value> obj = env->Global()->Get(v8_str("obj"));
4686 4698
(...skipping 17164 matching lines...) Expand 10 before | Expand all | Expand 10 after
21851 timeout_thread.Join(); 21863 timeout_thread.Join();
21852 } 21864 }
21853 21865
21854 21866
21855 TEST(EstimatedContextSize) { 21867 TEST(EstimatedContextSize) {
21856 v8::Isolate* isolate = CcTest::isolate(); 21868 v8::Isolate* isolate = CcTest::isolate();
21857 v8::HandleScope scope(isolate); 21869 v8::HandleScope scope(isolate);
21858 LocalContext env; 21870 LocalContext env;
21859 CHECK(50000 < env->EstimatedSize()); 21871 CHECK(50000 < env->EstimatedSize());
21860 } 21872 }
OLDNEW
« src/api.cc ('K') | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698