Index: test/cctest/test-api.cc |
=================================================================== |
--- test/cctest/test-api.cc (revision 5696) |
+++ test/cctest/test-api.cc (working copy) |
@@ -9278,7 +9278,9 @@ |
// Inject the input as a global variable. |
i::Handle<i::String> input_name = |
i::Factory::NewStringFromAscii(i::Vector<const char>("input", 5)); |
- i::Top::global_context()->global()->SetProperty(*input_name, *input_, NONE); |
+ i::Top::global_context()->global()->SetProperty(*input_name, |
+ *input_, |
+ NONE)->ToObjectChecked(); |
MorphThread morph_thread(this); |
@@ -9750,7 +9752,7 @@ |
// Set the elements to be the pixels. |
// jsobj->set_elements(*pixels); |
obj->SetIndexedPropertiesToPixelData(pixel_data, kElementCount); |
- CHECK_EQ(1, i::Smi::cast(jsobj->GetElement(1))->value()); |
+ CHECK_EQ(1, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value()); |
obj->Set(v8_str("field"), v8::Int32::New(1503)); |
context->Global()->Set(v8_str("pixels"), obj); |
v8::Handle<v8::Value> result = CompileRun("pixels.field"); |
@@ -9802,27 +9804,34 @@ |
i::Handle<i::Smi> value(i::Smi::FromInt(2)); |
i::SetElement(jsobj, 1, value); |
- CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(1))->value()); |
+ CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value()); |
*value.location() = i::Smi::FromInt(256); |
i::SetElement(jsobj, 1, value); |
- CHECK_EQ(255, i::Smi::cast(jsobj->GetElement(1))->value()); |
+ CHECK_EQ(255, |
+ i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value()); |
*value.location() = i::Smi::FromInt(-1); |
i::SetElement(jsobj, 1, value); |
- CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(1))->value()); |
+ CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value()); |
result = CompileRun("for (var i = 0; i < 8; i++) {" |
" pixels[i] = (i * 65) - 109;" |
"}" |
"pixels[1] + pixels[6];"); |
CHECK_EQ(255, result->Int32Value()); |
- CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(0))->value()); |
- CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(1))->value()); |
- CHECK_EQ(21, i::Smi::cast(jsobj->GetElement(2))->value()); |
- CHECK_EQ(86, i::Smi::cast(jsobj->GetElement(3))->value()); |
- CHECK_EQ(151, i::Smi::cast(jsobj->GetElement(4))->value()); |
- CHECK_EQ(216, i::Smi::cast(jsobj->GetElement(5))->value()); |
- CHECK_EQ(255, i::Smi::cast(jsobj->GetElement(6))->value()); |
- CHECK_EQ(255, i::Smi::cast(jsobj->GetElement(7))->value()); |
+ CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(0)->ToObjectChecked())->value()); |
+ CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value()); |
+ CHECK_EQ(21, |
+ i::Smi::cast(jsobj->GetElement(2)->ToObjectChecked())->value()); |
+ CHECK_EQ(86, |
+ i::Smi::cast(jsobj->GetElement(3)->ToObjectChecked())->value()); |
+ CHECK_EQ(151, |
+ i::Smi::cast(jsobj->GetElement(4)->ToObjectChecked())->value()); |
+ CHECK_EQ(216, |
+ i::Smi::cast(jsobj->GetElement(5)->ToObjectChecked())->value()); |
+ CHECK_EQ(255, |
+ i::Smi::cast(jsobj->GetElement(6)->ToObjectChecked())->value()); |
+ CHECK_EQ(255, |
+ i::Smi::cast(jsobj->GetElement(7)->ToObjectChecked())->value()); |
result = CompileRun("var sum = 0;" |
"for (var i = 0; i < 8; i++) {" |
" sum += pixels[i];" |
@@ -9835,49 +9844,50 @@ |
"}" |
"pixels[1] + pixels[6];"); |
CHECK_EQ(8, result->Int32Value()); |
- CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(0))->value()); |
- CHECK_EQ(1, i::Smi::cast(jsobj->GetElement(1))->value()); |
- CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(2))->value()); |
- CHECK_EQ(3, i::Smi::cast(jsobj->GetElement(3))->value()); |
- CHECK_EQ(4, i::Smi::cast(jsobj->GetElement(4))->value()); |
- CHECK_EQ(6, i::Smi::cast(jsobj->GetElement(5))->value()); |
- CHECK_EQ(7, i::Smi::cast(jsobj->GetElement(6))->value()); |
- CHECK_EQ(8, i::Smi::cast(jsobj->GetElement(7))->value()); |
+ CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(0)->ToObjectChecked())->value()); |
+ CHECK_EQ(1, i::Smi::cast(jsobj->GetElement(1)->ToObjectChecked())->value()); |
+ CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(2)->ToObjectChecked())->value()); |
+ CHECK_EQ(3, i::Smi::cast(jsobj->GetElement(3)->ToObjectChecked())->value()); |
+ CHECK_EQ(4, i::Smi::cast(jsobj->GetElement(4)->ToObjectChecked())->value()); |
+ CHECK_EQ(6, i::Smi::cast(jsobj->GetElement(5)->ToObjectChecked())->value()); |
+ CHECK_EQ(7, i::Smi::cast(jsobj->GetElement(6)->ToObjectChecked())->value()); |
+ CHECK_EQ(8, i::Smi::cast(jsobj->GetElement(7)->ToObjectChecked())->value()); |
result = CompileRun("for (var i = 0; i < 8; i++) {" |
" pixels[7] = undefined;" |
"}" |
"pixels[7];"); |
CHECK_EQ(0, result->Int32Value()); |
- CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(7))->value()); |
+ CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(7)->ToObjectChecked())->value()); |
result = CompileRun("for (var i = 0; i < 8; i++) {" |
" pixels[6] = '2.3';" |
"}" |
"pixels[6];"); |
CHECK_EQ(2, result->Int32Value()); |
- CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(6))->value()); |
+ CHECK_EQ(2, i::Smi::cast(jsobj->GetElement(6)->ToObjectChecked())->value()); |
result = CompileRun("for (var i = 0; i < 8; i++) {" |
" pixels[5] = NaN;" |
"}" |
"pixels[5];"); |
CHECK_EQ(0, result->Int32Value()); |
- CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(5))->value()); |
+ CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(5)->ToObjectChecked())->value()); |
result = CompileRun("for (var i = 0; i < 8; i++) {" |
" pixels[8] = Infinity;" |
"}" |
"pixels[8];"); |
CHECK_EQ(255, result->Int32Value()); |
- CHECK_EQ(255, i::Smi::cast(jsobj->GetElement(8))->value()); |
+ CHECK_EQ(255, |
+ i::Smi::cast(jsobj->GetElement(8)->ToObjectChecked())->value()); |
result = CompileRun("for (var i = 0; i < 8; i++) {" |
" pixels[9] = -Infinity;" |
"}" |
"pixels[9];"); |
CHECK_EQ(0, result->Int32Value()); |
- CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(9))->value()); |
+ CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(9)->ToObjectChecked())->value()); |
result = CompileRun("pixels[3] = 33;" |
"delete pixels[3];" |
@@ -9987,7 +9997,8 @@ |
obj->SetIndexedPropertiesToExternalArrayData(array_data, |
array_type, |
kElementCount); |
- CHECK_EQ(1, static_cast<int>(jsobj->GetElement(1)->Number())); |
+ CHECK_EQ( |
+ 1, static_cast<int>(jsobj->GetElement(1)->ToObjectChecked()->Number())); |
obj->Set(v8_str("field"), v8::Int32::New(1503)); |
context->Global()->Set(v8_str("ext_array"), obj); |
v8::Handle<v8::Value> result = CompileRun("ext_array.field"); |
@@ -10126,14 +10137,16 @@ |
"}" |
"ext_array[7];"); |
CHECK_EQ(0, result->Int32Value()); |
- CHECK_EQ(0, static_cast<int>(jsobj->GetElement(7)->Number())); |
+ CHECK_EQ( |
+ 0, static_cast<int>(jsobj->GetElement(7)->ToObjectChecked()->Number())); |
result = CompileRun("for (var i = 0; i < 8; i++) {" |
" ext_array[6] = '2.3';" |
"}" |
"ext_array[6];"); |
CHECK_EQ(2, result->Int32Value()); |
- CHECK_EQ(2, static_cast<int>(jsobj->GetElement(6)->Number())); |
+ CHECK_EQ( |
+ 2, static_cast<int>(jsobj->GetElement(6)->ToObjectChecked()->Number())); |
if (array_type != v8::kExternalFloatArray) { |
// Though the specification doesn't state it, be explicit about |
@@ -10146,7 +10159,8 @@ |
"}" |
"ext_array[5];"); |
CHECK_EQ(0, result->Int32Value()); |
- CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(5))->value()); |
+ CHECK_EQ(0, |
+ i::Smi::cast(jsobj->GetElement(5)->ToObjectChecked())->value()); |
result = CompileRun("for (var i = 0; i < 8; i++) {" |
" ext_array[i] = 5;" |
@@ -10156,7 +10170,8 @@ |
"}" |
"ext_array[5];"); |
CHECK_EQ(0, result->Int32Value()); |
- CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(5))->value()); |
+ CHECK_EQ(0, |
+ i::Smi::cast(jsobj->GetElement(5)->ToObjectChecked())->value()); |
result = CompileRun("for (var i = 0; i < 8; i++) {" |
" ext_array[i] = 5;" |
@@ -10166,7 +10181,8 @@ |
"}" |
"ext_array[5];"); |
CHECK_EQ(0, result->Int32Value()); |
- CHECK_EQ(0, i::Smi::cast(jsobj->GetElement(5))->value()); |
+ CHECK_EQ(0, |
+ i::Smi::cast(jsobj->GetElement(5)->ToObjectChecked())->value()); |
} |
result = CompileRun("ext_array[3] = 33;" |