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

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

Issue 6931056: Check that receiver is JSObject on API calls. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 7 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/builtins.cc ('k') | test/mjsunit/regress/regress-1369.js » ('j') | 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 f48d5b49ffadc54b54f791ea6736c2fbdd5b155e..ab94085a95f0da53624a80c4b0edede4310bfb00 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -14391,3 +14391,20 @@ THREADED_TEST(AllowCodeGenFromStrings) {
V8::SetAllowCodeGenerationFromStringsCallback(&CodeGenerationDisallowed);
CheckCodeGenerationDisallowed();
}
+
+
+static v8::Handle<Value> NonObjectThis(const v8::Arguments& args) {
+ return v8::Undefined();
+}
+
+
+THREADED_TEST(CallAPIFunctionOnNonObject) {
+ v8::HandleScope scope;
+ LocalContext context;
+ Handle<FunctionTemplate> templ = v8::FunctionTemplate::New(NonObjectThis);
+ Handle<Function> function = templ->GetFunction();
+ context->Global()->Set(v8_str("f"), function);
+ TryCatch try_catch;
+ CompileRun("f.call(2)");
+ CHECK(try_catch.HasCaught());
+}
« no previous file with comments | « src/builtins.cc ('k') | test/mjsunit/regress/regress-1369.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698