Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index fe5baa86aa5a7bc17aed3662e0872d4ae176e708..c0e83948d9d4fc7d839ccaf363986e7067b0238c 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -16780,8 +16780,6 @@ |
v8::AccessType type, |
Local<v8::Value> data) { |
CcTest::heap()->CollectAllGarbage(); |
- CcTest::isolate()->ThrowException( |
- v8::Exception::Error(v8_str("cross context"))); |
} |
@@ -16812,42 +16810,28 @@ |
LocalContext context1(NULL, global_template); |
context1->Global()->Set(v8_str("other"), global0); |
- v8::TryCatch try_catch(isolate); |
- |
// Get property with failed access check. |
- CHECK(CompileRun("other.x").IsEmpty()); |
- CHECK(try_catch.HasCaught()); |
- try_catch.Reset(); |
+ ExpectUndefined("other.x"); |
// Get element with failed access check. |
- CHECK(CompileRun("other[0]").IsEmpty()); |
- CHECK(try_catch.HasCaught()); |
- try_catch.Reset(); |
+ ExpectUndefined("other[0]"); |
// Set property with failed access check. |
- CHECK(CompileRun("other.x = new Object()").IsEmpty()); |
- CHECK(try_catch.HasCaught()); |
- try_catch.Reset(); |
+ v8::Handle<v8::Value> result = CompileRun("other.x = new Object()"); |
+ CHECK(result->IsObject()); |
// Set element with failed access check. |
- CHECK(CompileRun("other[0] = new Object()").IsEmpty()); |
- CHECK(try_catch.HasCaught()); |
- try_catch.Reset(); |
+ result = CompileRun("other[0] = new Object()"); |
+ CHECK(result->IsObject()); |
// Get property attribute with failed access check. |
- CHECK(CompileRun("\'x\' in other").IsEmpty()); |
- CHECK(try_catch.HasCaught()); |
- try_catch.Reset(); |
+ ExpectFalse("\'x\' in other"); |
// Get property attribute for element with failed access check. |
- CHECK(CompileRun("0 in other").IsEmpty()); |
- CHECK(try_catch.HasCaught()); |
- try_catch.Reset(); |
+ ExpectFalse("0 in other"); |
// Delete property. |
- CHECK(CompileRun("delete other.x").IsEmpty()); |
- CHECK(try_catch.HasCaught()); |
- try_catch.Reset(); |
+ ExpectFalse("delete other.x"); |
// Delete element. |
CHECK_EQ(false, global0->Delete(0)); |
@@ -16857,25 +16841,15 @@ |
global0->SetAccessor(v8_str("x"), GetXValue, NULL, v8_str("x"))); |
// Define JavaScript accessor. |
- CHECK(CompileRun( |
- "Object.prototype.__defineGetter__.call(" |
- " other, \'x\', function() { return 42; })").IsEmpty()); |
- CHECK(try_catch.HasCaught()); |
- try_catch.Reset(); |
+ ExpectUndefined("Object.prototype.__defineGetter__.call(" |
+ " other, \'x\', function() { return 42; })"); |
// LookupAccessor. |
- CHECK(CompileRun( |
- "Object.prototype.__lookupGetter__.call(" |
- " other, \'x\')").IsEmpty()); |
- CHECK(try_catch.HasCaught()); |
- try_catch.Reset(); |
+ ExpectUndefined("Object.prototype.__lookupGetter__.call(" |
+ " other, \'x\')"); |
// HasOwnElement. |
- CHECK(CompileRun( |
- "Object.prototype.hasOwnProperty.call(" |
- "other, \'0\')").IsEmpty()); |
- CHECK(try_catch.HasCaught()); |
- try_catch.Reset(); |
+ ExpectFalse("Object.prototype.hasOwnProperty.call(other, \'0\')"); |
CHECK_EQ(false, global0->HasRealIndexedProperty(0)); |
CHECK_EQ(false, global0->HasRealNamedProperty(v8_str("x"))); |