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

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

Issue 6223: Make sure that the name accessor on functions return the expected... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 12 years, 2 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/v8natives.js ('k') | test/mjsunit/function-names.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
===================================================================
--- test/cctest/test-api.cc (revision 413)
+++ test/cctest/test-api.cc (working copy)
@@ -4937,3 +4937,22 @@
CHECK_EQ(1234, script1->Run()->Int32Value());
CHECK_EQ(1234, script2->Run()->Int32Value());
}
+
+
+static v8::Handle<Value> FunctionNameCallback(const v8::Arguments& args) {
+ ApiTestFuzzer::Fuzz();
+ return v8_num(42);
+}
+
+
+THREADED_TEST(CallbackFunctionName) {
+ v8::HandleScope scope;
+ LocalContext context;
+ Local<ObjectTemplate> t = ObjectTemplate::New();
+ t->Set(v8_str("asdf"), v8::FunctionTemplate::New(FunctionNameCallback));
+ context->Global()->Set(v8_str("obj"), t->NewInstance());
+ v8::Handle<v8::Value> value = CompileRun("obj.asdf.name");
+ CHECK(value->IsString());
+ v8::String::AsciiValue name(value);
+ CHECK_EQ("asdf", *name);
+}
« no previous file with comments | « src/v8natives.js ('k') | test/mjsunit/function-names.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698