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

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

Issue 3526008: Add a check that accessors set to instance template work even if we have a custom call handler. (Closed)
Patch Set: Addressing Mads' comments Created 10 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 | « no previous file | 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 527c9a38cc42caa5daa7acbce8cc3c750d3919fe..984177bf79ec57c631ebe9606e7436f319852a04 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -766,6 +766,12 @@ static v8::Handle<Value> construct_call(const v8::Arguments& args) {
return args.This();
}
+static v8::Handle<Value> Return239(Local<String> name, const AccessorInfo&) {
+ ApiTestFuzzer::Fuzz();
+ return v8_num(239);
+}
+
+
THREADED_TEST(FunctionTemplate) {
v8::HandleScope scope;
LocalContext env;
@@ -792,6 +798,7 @@ THREADED_TEST(FunctionTemplate) {
Local<v8::FunctionTemplate> fun_templ =
v8::FunctionTemplate::New(construct_call);
fun_templ->SetClassName(v8_str("funky"));
+ fun_templ->InstanceTemplate()->SetAccessor(v8_str("m"), Return239);
Local<Function> fun = fun_templ->GetFunction();
env->Global()->Set(v8_str("obj"), fun);
Local<Script> script = v8_compile("var s = new obj(); s.x");
@@ -799,6 +806,9 @@ THREADED_TEST(FunctionTemplate) {
Local<Value> result = v8_compile("(new obj()).toString()")->Run();
CHECK_EQ(v8_str("[object funky]"), result);
+
+ result = v8_compile("(new obj()).m")->Run();
+ CHECK_EQ(239, result->Int32Value());
}
}
@@ -6509,12 +6519,6 @@ THREADED_TEST(InterceptorLoadICInvalidatedFieldViaGlobal) {
}
-static v8::Handle<Value> Return239(Local<String> name, const AccessorInfo&) {
- ApiTestFuzzer::Fuzz();
- return v8_num(239);
-}
-
-
static void SetOnThis(Local<String> name,
Local<Value> value,
const AccessorInfo& info) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698