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

Unified Diff: gin/wrappable_unittest.cc

Issue 184253004: gin: Bug fix: Fix CreateHandle to return an emtpy handle in some extreme cases (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Bug fix: remove an extra include Created 6 years, 10 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 | « gin/wrappable.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/wrappable_unittest.cc
diff --git a/gin/wrappable_unittest.cc b/gin/wrappable_unittest.cc
index 09fef241ab08ff8f7678405f04b13977d3534358..b95a98771339b3b010f8c05f47bbf7cfada70645 100644
--- a/gin/wrappable_unittest.cc
+++ b/gin/wrappable_unittest.cc
@@ -191,4 +191,26 @@ TEST_F(WrappableTest, WrappableSubclass) {
EXPECT_EQ("Hello, Lily", object->result);
}
+TEST_F(WrappableTest, ErrorInObjectConstructorProperty) {
+ v8::Isolate* isolate = instance_->isolate();
+ v8::HandleScope handle_scope(isolate);
+
+ v8::Handle<v8::String> source = StringToV8(
+ isolate,
+ "(function() {"
+ " Object.defineProperty(Object.prototype, 'constructor', {"
+ " get: function() { throw 'Error'; },"
+ " set: function() { throw 'Error'; }"
+ " });"
+ "})();");
+ EXPECT_FALSE(source.IsEmpty());
+ v8::Handle<v8::Script> script = v8::Script::New(source);
+ script->Run();
+
+ gin::TryCatch try_catch;
+ gin::Handle<MyObject> obj = MyObject::Create(isolate);
+ EXPECT_TRUE(obj.IsEmpty());
+ EXPECT_TRUE(try_catch.HasCaught());
+}
+
} // namespace gin
« no previous file with comments | « gin/wrappable.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698