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

Unified Diff: test/cctest/test-api.cc

Issue 1175323004: Revert of Use the LookupIterator in SetAccessor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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")));
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698